summaryrefslogtreecommitdiffstats
path: root/distro
diff options
context:
space:
mode:
Diffstat (limited to 'distro')
-rw-r--r--distro/README.md4
-rw-r--r--distro/pkg/deb/libyang2.install2
-rw-r--r--distro/pkg/rpm/libyang.spec43
3 files changed, 36 insertions, 13 deletions
diff --git a/distro/README.md b/distro/README.md
index 995cb53..dae5d1c 100644
--- a/distro/README.md
+++ b/distro/README.md
@@ -1,9 +1,9 @@
# upstream packaging
## RPM-based system (Fedora, CentOS, SUSE, ...) quickstart
-
+```
sudo dnf install -y git rpm-build python3-pip
pip3 install apkg
apkg build -i
-
+```
See apkg docs: https://pkg.labs.nic.cz/pages/apkg/
diff --git a/distro/pkg/deb/libyang2.install b/distro/pkg/deb/libyang2.install
index e5f2c1c..9d72c7e 100644
--- a/distro/pkg/deb/libyang2.install
+++ b/distro/pkg/deb/libyang2.install
@@ -1,2 +1,2 @@
usr/lib/*/*.so.*
-usr/share/yang
+usr/share/yang/modules/libyang
diff --git a/distro/pkg/rpm/libyang.spec b/distro/pkg/rpm/libyang.spec
index 374fc4e..f57ef91 100644
--- a/distro/pkg/rpm/libyang.spec
+++ b/distro/pkg/rpm/libyang.spec
@@ -1,3 +1,7 @@
+%if 0%{?rhel} == 8
+%undefine __cmake_in_source_build
+%endif
+
Name: libyang
Version: {{ version }}
Release: {{ release }}%{?dist}
@@ -43,27 +47,46 @@ written (and providing API) in C.
%prep
%autosetup -p1
+%if 0%{?rhel} && 0%{?rhel} < 8
+ mkdir build
+%endif
%build
-%cmake -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
-%cmake_build
-
-%if "x%{?suse_version}" == "x"
-cd redhat-linux-build
+%if 0%{?rhel} && 0%{?rhel} < 8
+ cd build
+ cmake \
+ -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
+ -DCMAKE_BUILD_TYPE:String="Release" \
+ -DCMAKE_C_FLAGS="${RPM_OPT_FLAGS}" \
+ -DCMAKE_CXX_FLAGS="${RPM_OPT_FLAGS}" \
+ ..
+ make
+%else
+ %cmake -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
+ %cmake_build
+ %if "x%{?suse_version}" == "x"
+ cd %{__cmake_builddir}
+ %endif
%endif
make doc
%check
-%if "x%{?suse_version}" == "x"
-cd redhat-linux-build
+%if ( 0%{?rhel} == 0 ) || 0%{?rhel} > 7
+ %if "x%{?suse_version}" == "x"
+ cd %{__cmake_builddir}
+ %endif
%endif
ctest --output-on-failure -V %{?_smp_mflags}
%install
-%cmake_install
-
mkdir -m0755 -p %{buildroot}/%{_docdir}/libyang
-cp -a doc/html %{buildroot}/%{_docdir}/libyang/html
+%if 0%{?rhel} && 0%{?rhel} < 8
+ cd build
+ make DESTDIR=%{buildroot} install
+%else
+ %cmake_install
+ cp -a doc/html %{buildroot}/%{_docdir}/libyang/html
+%endif
%files
%license LICENSE