Jakub Ružička | c82b421 | 2021-09-27 15:13:10 +0200 | [diff] [blame] | 1 | Name: libyang |
| 2 | Version: {{ version }} |
| 3 | Release: {{ release }}%{?dist} |
| 4 | Summary: YANG data modeling language library |
| 5 | Url: https://github.com/CESNET/libyang |
Jakub Ružička | ab10588 | 2022-04-20 14:22:28 +0200 | [diff] [blame] | 6 | Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz |
Jakub Ružička | c82b421 | 2021-09-27 15:13:10 +0200 | [diff] [blame] | 7 | License: BSD |
| 8 | |
| 9 | BuildRequires: cmake |
Jakub Ružička | ab10588 | 2022-04-20 14:22:28 +0200 | [diff] [blame] | 10 | BuildRequires: doxygen |
Jakub Ružička | c82b421 | 2021-09-27 15:13:10 +0200 | [diff] [blame] | 11 | BuildRequires: gcc |
Jakub Ružička | ab10588 | 2022-04-20 14:22:28 +0200 | [diff] [blame] | 12 | BuildRequires: cmake(cmocka) >= 1.0.1 |
Jakub Ružička | c82b421 | 2021-09-27 15:13:10 +0200 | [diff] [blame] | 13 | BuildRequires: make |
| 14 | BuildRequires: pkgconfig(libpcre2-8) >= 10.21 |
| 15 | |
| 16 | %package devel |
| 17 | Summary: Development files for libyang |
| 18 | Requires: %{name}%{?_isa} = %{version}-%{release} |
| 19 | Requires: pcre2-devel |
| 20 | |
Jakub Ružička | ab10588 | 2022-04-20 14:22:28 +0200 | [diff] [blame] | 21 | %package devel-doc |
| 22 | Summary: Documentation of libyang API |
| 23 | Requires: %{name}%{?_isa} = %{version}-%{release} |
| 24 | |
Jakub Ružička | c82b421 | 2021-09-27 15:13:10 +0200 | [diff] [blame] | 25 | %package tools |
| 26 | Summary: YANG validator tools |
| 27 | Requires: %{name}%{?_isa} = %{version}-%{release} |
| 28 | # This was not properly split out before |
| 29 | Conflicts: %{name} < 1.0.225-3 |
| 30 | |
| 31 | %description devel |
| 32 | Headers of libyang library. |
| 33 | |
Jakub Ružička | ab10588 | 2022-04-20 14:22:28 +0200 | [diff] [blame] | 34 | %description devel-doc |
| 35 | Documentation of libyang API. |
| 36 | |
Jakub Ružička | c82b421 | 2021-09-27 15:13:10 +0200 | [diff] [blame] | 37 | %description tools |
| 38 | YANG validator tools. |
| 39 | |
| 40 | %description |
| 41 | Libyang is YANG data modeling language parser and toolkit |
| 42 | written (and providing API) in C. |
| 43 | |
| 44 | %prep |
| 45 | %autosetup -p1 |
Jakub Ružička | c82b421 | 2021-09-27 15:13:10 +0200 | [diff] [blame] | 46 | |
| 47 | %build |
Jakub Ružička | ab10588 | 2022-04-20 14:22:28 +0200 | [diff] [blame] | 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} |
Jakub Ružička | c82b421 | 2021-09-27 15:13:10 +0200 | [diff] [blame] | 61 | |
Jakub Ružička | c82b421 | 2021-09-27 15:13:10 +0200 | [diff] [blame] | 62 | %install |
Jakub Ružička | ab10588 | 2022-04-20 14:22:28 +0200 | [diff] [blame] | 63 | %cmake_install |
| 64 | |
| 65 | mkdir -m0755 -p %{buildroot}/%{_docdir}/libyang |
| 66 | cp -a doc/html %{buildroot}/%{_docdir}/libyang/html |
Jakub Ružička | c82b421 | 2021-09-27 15:13:10 +0200 | [diff] [blame] | 67 | |
| 68 | %files |
| 69 | %license LICENSE |
| 70 | %{_libdir}/libyang.so.2 |
| 71 | %{_libdir}/libyang.so.2.* |
Michal Vasko | 9494749 | 2022-06-08 07:52:10 +0200 | [diff] [blame] | 72 | %dir %{_datadir}/yang/ |
Michal Vasko | 9436df3 | 2022-06-09 08:04:34 +0200 | [diff] [blame^] | 73 | %dir %{_datadir}/yang/modules/ |
| 74 | %dir %{_datadir}/yang/modules/libyang/ |
Jakub Ružička | c82b421 | 2021-09-27 15:13:10 +0200 | [diff] [blame] | 75 | |
| 76 | %files tools |
| 77 | %{_bindir}/yanglint |
| 78 | %{_bindir}/yangre |
| 79 | %{_datadir}/man/man1/yanglint.1.gz |
Jakub Ružička | b6a86a4 | 2021-09-27 15:15:26 +0200 | [diff] [blame] | 80 | %{_datadir}/man/man1/yangre.1.gz |
Jakub Ružička | c82b421 | 2021-09-27 15:13:10 +0200 | [diff] [blame] | 81 | |
| 82 | %files devel |
| 83 | %{_libdir}/libyang.so |
| 84 | %{_libdir}/pkgconfig/libyang.pc |
| 85 | %{_includedir}/libyang/*.h |
| 86 | %dir %{_includedir}/libyang/ |
| 87 | |
Jakub Ružička | ab10588 | 2022-04-20 14:22:28 +0200 | [diff] [blame] | 88 | %files devel-doc |
| 89 | %{_docdir}/libyang |
| 90 | |
Jakub Ružička | c82b421 | 2021-09-27 15:13:10 +0200 | [diff] [blame] | 91 | %changelog |
Jakub Ružička | ab10588 | 2022-04-20 14:22:28 +0200 | [diff] [blame] | 92 | * {{ now }} Jakub Ružička <jakub.ruzicka@nic.cz> - {{ version }}-{{ release }} |
Jakub Ružička | c82b421 | 2021-09-27 15:13:10 +0200 | [diff] [blame] | 93 | - upstream package |