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 |
| 6 | Source: libyang-%{version}.tar.gz |
| 7 | License: BSD |
| 8 | |
| 9 | BuildRequires: cmake |
| 10 | BuildRequires: gcc |
| 11 | BuildRequires: make |
| 12 | BuildRequires: pkgconfig(libpcre2-8) >= 10.21 |
| 13 | |
| 14 | %package devel |
| 15 | Summary: Development files for libyang |
| 16 | Requires: %{name}%{?_isa} = %{version}-%{release} |
| 17 | Requires: pcre2-devel |
| 18 | |
| 19 | %package tools |
| 20 | Summary: YANG validator tools |
| 21 | Requires: %{name}%{?_isa} = %{version}-%{release} |
| 22 | # This was not properly split out before |
| 23 | Conflicts: %{name} < 1.0.225-3 |
| 24 | |
| 25 | %description devel |
| 26 | Headers of libyang library. |
| 27 | |
| 28 | %description tools |
| 29 | YANG validator tools. |
| 30 | |
| 31 | %description |
| 32 | Libyang is YANG data modeling language parser and toolkit |
| 33 | written (and providing API) in C. |
| 34 | |
| 35 | %prep |
| 36 | %autosetup -p1 |
| 37 | mkdir build |
| 38 | |
| 39 | %build |
| 40 | cd build |
| 41 | cmake \ |
| 42 | -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \ |
| 43 | -DCMAKE_BUILD_TYPE:String="Package" \ |
| 44 | -DCMAKE_C_FLAGS="${RPM_OPT_FLAGS}" \ |
| 45 | -DCMAKE_CXX_FLAGS="${RPM_OPT_FLAGS}" \ |
| 46 | .. |
| 47 | make |
| 48 | |
| 49 | %check |
| 50 | cd build |
| 51 | ctest --output-on-failure |
| 52 | |
| 53 | %install |
| 54 | cd build |
| 55 | make DESTDIR=%{buildroot} install |
| 56 | |
| 57 | %files |
| 58 | %license LICENSE |
| 59 | %{_libdir}/libyang.so.2 |
| 60 | %{_libdir}/libyang.so.2.* |
| 61 | |
| 62 | %files tools |
| 63 | %{_bindir}/yanglint |
| 64 | %{_bindir}/yangre |
| 65 | %{_datadir}/man/man1/yanglint.1.gz |
| 66 | |
| 67 | %files devel |
| 68 | %{_libdir}/libyang.so |
| 69 | %{_libdir}/pkgconfig/libyang.pc |
| 70 | %{_includedir}/libyang/*.h |
| 71 | %dir %{_includedir}/libyang/ |
| 72 | |
| 73 | %changelog |
| 74 | * Fri Aug 06 2021 Jakub Ružička <jakub.ruzicka@nic.cz> - {{ version }}-{{ release }} |
| 75 | - upstream package |