@@ -3,11 +3,13 @@ Version: {{ version }}
3
3
Release: {{ release }}%{?dist }
4
4
Summary: YANG data modeling language library
5
5
Url: https://github.com/CESNET/libyang
6
- Source: libyang -%{version }.tar.gz
6
+ Source: %{ url }/archive/v%{ version }/%{ name } -%{version }.tar.gz
7
7
License: BSD
8
8
9
9
BuildRequires: cmake
10
+ BuildRequires: doxygen
10
11
BuildRequires: gcc
12
+ BuildRequires: cmake(cmocka) >= 1.0.1
11
13
BuildRequires: make
12
14
BuildRequires: pkgconfig(libpcre2-8) >= 10.21
13
15
@@ -16,6 +18,10 @@ Summary: Development files for libyang
16
18
Requires: %{name }%{?_isa } = %{version }-%{release }
17
19
Requires: pcre2-devel
18
20
21
+ %package devel-doc
22
+ Summary: Documentation of libyang API
23
+ Requires: %{name }%{?_isa } = %{version }-%{release }
24
+
19
25
%package tools
20
26
Summary: YANG validator tools
21
27
Requires: %{name }%{?_isa } = %{version }-%{release }
@@ -25,6 +31,9 @@ Conflicts: %{name} < 1.0.225-3
25
31
%description devel
26
32
Headers of libyang library.
27
33
34
+ %description devel-doc
35
+ Documentation of libyang API.
36
+
28
37
%description tools
29
38
YANG validator tools.
30
39
@@ -34,21 +43,27 @@ written (and providing API) in C.
34
43
35
44
%prep
36
45
%autosetup -p1
37
- mkdir build
38
46
39
47
%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 }
48
61
49
62
%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
52
67
53
68
%files
54
69
%license LICENSE
@@ -67,6 +82,9 @@ make DESTDIR=%{buildroot} install
67
82
%{_includedir }/libyang/* .h
68
83
%dir %{_includedir }/libyang/
69
84
85
+ %files devel-doc
86
+ %{_docdir }/libyang
87
+
70
88
%changelog
71
- *
Fri Aug 06 2021 Jakub Ružička <[email protected] > -
{{ version }}-{{ release }}
89
+ *
{{ now }} Jakub Ružička <
[email protected] > - {{ version }}-{{ release }}
72
90
- upstream package
0 commit comments