Skip to content

Commit ab10588

Browse files
jruzicka-nicmichalvasko
authored andcommitted
rpm UPDATE packaging from Fedora
Fedora package sources: https://src.fedoraproject.org/rpms/libyang
1 parent a0cc895 commit ab10588

File tree

2 files changed

+33
-15
lines changed

2 files changed

+33
-15
lines changed

distro/config/apkg.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name = "libyang"
33
make_archive_script = "distro/scripts/make-archive.sh"
44

55
[upstream]
6-
archive_url = "https://github.com/CESNET/libyang/archive/v{{ version }}.tar.gz"
6+
archive_url = "https://github.com/CESNET/libyang/archive/v{{ version }}/libyang-{{ version }}.tar.gz"
77
version_script = "distro/scripts/upstream-version.sh"
88

99
[apkg]
10-
compat = 1
10+
compat = 2

distro/pkg/rpm/libyang.spec

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ Version: {{ version }}
33
Release: {{ release }}%{?dist}
44
Summary: YANG data modeling language library
55
Url: https://github.com/CESNET/libyang
6-
Source: libyang-%{version}.tar.gz
6+
Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
77
License: BSD
88

99
BuildRequires: cmake
10+
BuildRequires: doxygen
1011
BuildRequires: gcc
12+
BuildRequires: cmake(cmocka) >= 1.0.1
1113
BuildRequires: make
1214
BuildRequires: pkgconfig(libpcre2-8) >= 10.21
1315

@@ -16,6 +18,10 @@ Summary: Development files for libyang
1618
Requires: %{name}%{?_isa} = %{version}-%{release}
1719
Requires: pcre2-devel
1820

21+
%package devel-doc
22+
Summary: Documentation of libyang API
23+
Requires: %{name}%{?_isa} = %{version}-%{release}
24+
1925
%package tools
2026
Summary: YANG validator tools
2127
Requires: %{name}%{?_isa} = %{version}-%{release}
@@ -25,6 +31,9 @@ Conflicts: %{name} < 1.0.225-3
2531
%description devel
2632
Headers of libyang library.
2733

34+
%description devel-doc
35+
Documentation of libyang API.
36+
2837
%description tools
2938
YANG validator tools.
3039

@@ -34,21 +43,27 @@ written (and providing API) in C.
3443

3544
%prep
3645
%autosetup -p1
37-
mkdir build
3846

3947
%build
40-
cd build
41-
cmake \
42-
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
43-
-DCMAKE_BUILD_TYPE:String="Release" \
44-
-DCMAKE_C_FLAGS="${RPM_OPT_FLAGS}" \
45-
-DCMAKE_CXX_FLAGS="${RPM_OPT_FLAGS}" \
46-
..
47-
make
48+
%cmake -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
49+
%cmake_build
50+
51+
%if "x%{?suse_version}" == "x"
52+
cd redhat-linux-build
53+
%endif
54+
make doc
55+
56+
%check
57+
%if "x%{?suse_version}" == "x"
58+
cd redhat-linux-build
59+
%endif
60+
ctest --output-on-failure -V %{?_smp_mflags}
4861

4962
%install
50-
cd build
51-
make DESTDIR=%{buildroot} install
63+
%cmake_install
64+
65+
mkdir -m0755 -p %{buildroot}/%{_docdir}/libyang
66+
cp -a doc/html %{buildroot}/%{_docdir}/libyang/html
5267

5368
%files
5469
%license LICENSE
@@ -67,6 +82,9 @@ make DESTDIR=%{buildroot} install
6782
%{_includedir}/libyang/*.h
6883
%dir %{_includedir}/libyang/
6984

85+
%files devel-doc
86+
%{_docdir}/libyang
87+
7088
%changelog
71-
* Fri Aug 06 2021 Jakub Ružička <[email protected]> - {{ version }}-{{ release }}
89+
* {{ now }} Jakub Ružička <[email protected]> - {{ version }}-{{ release }}
7290
- upstream package

0 commit comments

Comments
 (0)