blob: 6dd4586ab7c71be799714a8a5ec0a67fcc565bb9 [file] [log] [blame]
Jakub Ružička9e08f962021-04-29 21:31:40 +02001Name: libyang2
2Version: {{ version }}
3Release: {{ release }}%{?dist}
4Summary: YANG data modeling language library
5Url: https://github.com/CESNET/libyang
6Source: libyang-%{version}.tar.gz
7License: BSD-3-Clause
8
9BuildRequires: cmake
Jakub Ružička9e08f962021-04-29 21:31:40 +020010BuildRequires: gcc
Jakub Ružička9e08f962021-04-29 21:31:40 +020011BuildRequires: make
12BuildRequires: pcre2-devel
13
14%if "x%{?suse_version}" == "x"
15Requires: pcre2
16%else
17Requires: libpcre2-posix2
18%endif
19
20%package -n libyang2-devel
21Summary: Headers of libyang library
22Conflicts: libyang-devel
23Requires: %{name} = %{version}-%{release}
24Requires: pcre2-devel
25
26%package -n libyang2-tools
27Summary: Helper Tools and examples for libyang library
28Conflicts: libyang
29Provides: libyang-tools
30Requires: %{name} = %{version}-%{release}
31
32%description -n libyang2-devel
33Headers of libyang library.
34
35%description -n libyang2-tools
36Helper Tools and examples for libyang library.
37
38%description
39libyang is a YANG data modelling language parser and toolkit
40written (and providing API) in C.
41
42%prep
43%setup -n libyang-%{version}
44mkdir build
45
46%build
47cd build
48cmake -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 ..
53make
54
55%check
56cd build
57ctest --output-on-failure
58
59%install
60cd build
61make 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