Jakub Ružička | 9e08f96 | 2021-04-29 21:31:40 +0200 | [diff] [blame] | 1 | Name: libyang2 |
| 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-3-Clause |
| 8 | |
| 9 | BuildRequires: cmake |
Jakub Ružička | 9e08f96 | 2021-04-29 21:31:40 +0200 | [diff] [blame] | 10 | BuildRequires: gcc |
Jakub Ružička | 9e08f96 | 2021-04-29 21:31:40 +0200 | [diff] [blame] | 11 | BuildRequires: make |
| 12 | BuildRequires: pcre2-devel |
| 13 | |
| 14 | %if "x%{?suse_version}" == "x" |
| 15 | Requires: pcre2 |
| 16 | %else |
| 17 | Requires: libpcre2-posix2 |
| 18 | %endif |
| 19 | |
| 20 | %package -n libyang2-devel |
| 21 | Summary: Headers of libyang library |
| 22 | Conflicts: libyang-devel |
| 23 | Requires: %{name} = %{version}-%{release} |
| 24 | Requires: pcre2-devel |
| 25 | |
| 26 | %package -n libyang2-tools |
| 27 | Summary: Helper Tools and examples for libyang library |
| 28 | Conflicts: libyang |
| 29 | Provides: libyang-tools |
| 30 | Requires: %{name} = %{version}-%{release} |
| 31 | |
| 32 | %description -n libyang2-devel |
| 33 | Headers of libyang library. |
| 34 | |
| 35 | %description -n libyang2-tools |
| 36 | Helper Tools and examples for libyang library. |
| 37 | |
| 38 | %description |
| 39 | libyang is a YANG data modelling language parser and toolkit |
| 40 | written (and providing API) in C. |
| 41 | |
| 42 | %prep |
| 43 | %setup -n libyang-%{version} |
| 44 | mkdir build |
| 45 | |
| 46 | %build |
| 47 | cd build |
| 48 | cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr \ |
| 49 | -DCMAKE_BUILD_TYPE:String="Release" \ |
| 50 | -DCMAKE_C_FLAGS="${RPM_OPT_FLAGS}" \ |
| 51 | -DCMAKE_CXX_FLAGS="${RPM_OPT_FLAGS}" \ |
| 52 | .. |
| 53 | make |
| 54 | |
| 55 | %check |
| 56 | cd build |
| 57 | ctest --output-on-failure |
| 58 | |
| 59 | %install |
| 60 | cd build |
| 61 | make DESTDIR=%{buildroot} install |
| 62 | |
| 63 | %post -p /sbin/ldconfig |
| 64 | |
| 65 | %postun -p /sbin/ldconfig |
| 66 | |
| 67 | %files |
| 68 | %defattr(-,root,root) |
| 69 | %{_libdir}/libyang.so.2* |
| 70 | |
| 71 | %files -n libyang2-devel |
| 72 | %defattr(-,root,root) |
| 73 | %{_libdir}/libyang.so |
| 74 | %{_libdir}/pkgconfig/libyang.pc |
| 75 | %{_includedir}/libyang/*.h |
| 76 | %dir %{_includedir}/libyang/ |
| 77 | |
| 78 | %files -n libyang2-tools |
| 79 | %{_bindir}/yanglint |
| 80 | %{_bindir}/yangre |
| 81 | %{_mandir}/man1/yanglint.1.gz |
| 82 | |
| 83 | %changelog |
| 84 | * Fri Apr 30 2021 Jakub Ružička <jakub.ruzicka@nic.cz> - {{ version }}-{{ release }} |
| 85 | - upstream package |