blob: 895567ebb38e1f3d76a3a126a1849df82e914d32 [file] [log] [blame]
Jakub Ružičkac82b4212021-09-27 15:13:10 +02001Name: libyang
2Version: {{ version }}
3Release: {{ release }}%{?dist}
4Summary: YANG data modeling language library
5Url: https://github.com/CESNET/libyang
Jakub Ružičkaab105882022-04-20 14:22:28 +02006Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Jakub Ružičkac82b4212021-09-27 15:13:10 +02007License: BSD
8
9BuildRequires: cmake
Jakub Ružičkaab105882022-04-20 14:22:28 +020010BuildRequires: doxygen
Jakub Ružičkac82b4212021-09-27 15:13:10 +020011BuildRequires: gcc
Jakub Ružičkaab105882022-04-20 14:22:28 +020012BuildRequires: cmake(cmocka) >= 1.0.1
Jakub Ružičkac82b4212021-09-27 15:13:10 +020013BuildRequires: make
14BuildRequires: pkgconfig(libpcre2-8) >= 10.21
15
16%package devel
17Summary: Development files for libyang
18Requires: %{name}%{?_isa} = %{version}-%{release}
19Requires: pcre2-devel
20
Jakub Ružičkaab105882022-04-20 14:22:28 +020021%package devel-doc
22Summary: Documentation of libyang API
23Requires: %{name}%{?_isa} = %{version}-%{release}
24
Jakub Ružičkac82b4212021-09-27 15:13:10 +020025%package tools
26Summary: YANG validator tools
27Requires: %{name}%{?_isa} = %{version}-%{release}
28# This was not properly split out before
29Conflicts: %{name} < 1.0.225-3
30
31%description devel
32Headers of libyang library.
33
Jakub Ružičkaab105882022-04-20 14:22:28 +020034%description devel-doc
35Documentation of libyang API.
36
Jakub Ružičkac82b4212021-09-27 15:13:10 +020037%description tools
38YANG validator tools.
39
40%description
41Libyang is YANG data modeling language parser and toolkit
42written (and providing API) in C.
43
44%prep
45%autosetup -p1
Jakub Ružičkac82b4212021-09-27 15:13:10 +020046
47%build
Jakub Ružičkaab105882022-04-20 14:22:28 +020048%cmake -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
49%cmake_build
50
51%if "x%{?suse_version}" == "x"
52cd redhat-linux-build
53%endif
54make doc
55
56%check
57%if "x%{?suse_version}" == "x"
58cd redhat-linux-build
59%endif
60ctest --output-on-failure -V %{?_smp_mflags}
Jakub Ružičkac82b4212021-09-27 15:13:10 +020061
Jakub Ružičkac82b4212021-09-27 15:13:10 +020062%install
Jakub Ružičkaab105882022-04-20 14:22:28 +020063%cmake_install
64
65mkdir -m0755 -p %{buildroot}/%{_docdir}/libyang
66cp -a doc/html %{buildroot}/%{_docdir}/libyang/html
Jakub Ružičkac82b4212021-09-27 15:13:10 +020067
68%files
69%license LICENSE
70%{_libdir}/libyang.so.2
71%{_libdir}/libyang.so.2.*
Michal Vasko94947492022-06-08 07:52:10 +020072%dir %{_datadir}/yang/
Jakub Ružičkac82b4212021-09-27 15:13:10 +020073
74%files tools
75%{_bindir}/yanglint
76%{_bindir}/yangre
77%{_datadir}/man/man1/yanglint.1.gz
Jakub Ružičkab6a86a42021-09-27 15:15:26 +020078%{_datadir}/man/man1/yangre.1.gz
Jakub Ružičkac82b4212021-09-27 15:13:10 +020079
80%files devel
81%{_libdir}/libyang.so
82%{_libdir}/pkgconfig/libyang.pc
83%{_includedir}/libyang/*.h
84%dir %{_includedir}/libyang/
85
Jakub Ružičkaab105882022-04-20 14:22:28 +020086%files devel-doc
87%{_docdir}/libyang
88
Jakub Ružičkac82b4212021-09-27 15:13:10 +020089%changelog
Jakub Ružičkaab105882022-04-20 14:22:28 +020090* {{ now }} Jakub Ružička <jakub.ruzicka@nic.cz> - {{ version }}-{{ release }}
Jakub Ružičkac82b4212021-09-27 15:13:10 +020091- upstream package