Name: libyang Version: 1.0.130 Release: 1%{?dist} Summary: Libyang library Url: https://github.com/CESNET/libyang Source: libyang-1.0.130.tar.gz Source1: libyang.rpmlintrc License: BSD-3-Clause BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} Requires: pcre BuildRequires: doxygen BuildRequires: pcre-devel BuildRequires: valgrind BuildRequires: libcmocka-devel BuildRequires: gcc-c++ BuildRequires: python3-devel %if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: cmake3 BuildRequires: swig3 >= 3.0.12 %else BuildRequires: cmake BuildRequires: swig >= 3.0.12 %endif %package devel Summary: Headers of libyang library Requires: %{name} = %{version}-%{release} Requires: pcre-devel %package -n libyang-cpp Summary: Bindings to c++ language Requires: %{name} = %{version}-%{release} %package -n libyang-cpp-devel Summary: Headers of bindings to c++ language Requires: libyang-cpp = %{version}-%{release} Requires: pcre-devel %package -n python3-yang Summary: Binding to python Requires: libyang-cpp = %{version}-%{release} Requires: %{name} = %{version}-%{release} %description -n libyang-cpp Bindings of libyang library to C++ language. %description -n libyang-cpp-devel Headers of bindings to c++ language. %description -n python3-yang Bindings of libyang library to python language. %description devel Headers of libyang library. %description Libyang is YANG data modelling language parser and toolkit written (and providing API) in C. %prep %setup -q -n libyang-1.0.130 mkdir build %build cd build %if 0%{?rhel} && 0%{?rhel} <= 7 %cmake3 -D CMAKE_BUILD_TYPE:String="Package" -DGEN_LANGUAGE_BINDINGS=ON -DENABLE_LYD_PRIV=ON .. %else %cmake -D CMAKE_BUILD_TYPE:String="Package" -DGEN_LANGUAGE_BINDINGS=ON -DENABLE_LYD_PRIV=ON .. %endif %check cd build %if 0%{?rhel} && 0%{?rhel} <= 7 ctest3 --output-on-failure %else ctest --output-on-failure %endif %install cd build make DESTDIR=%{buildroot} install %post -p /sbin/ldconfig %post -n libyang-cpp -p /sbin/ldconfig %postun -p /sbin/ldconfig %postun -n libyang-cpp -p /sbin/ldconfig %files %defattr(-,root,root) %{_bindir}/yanglint %{_bindir}/yangre %{_datadir}/man/man1/yanglint.1.gz %{_datadir}/man/man1/yangre.1.gz %{_libdir}/libyang.so.* %{_libdir}/libyang/* %dir %{_libdir}/libyang/ %files devel %defattr(-,root,root) %{_libdir}/libyang.so %{_libdir}/pkgconfig/libyang.pc %{_includedir}/libyang/*.h %dir %{_includedir}/libyang/ %files -n libyang-cpp %defattr(-,root,root) %{_libdir}/libyang-cpp.so.* %files -n libyang-cpp-devel %defattr(-,root,root) %{_libdir}/libyang-cpp.so %{_includedir}/libyang/*.hpp %{_libdir}/pkgconfig/libyang-cpp.pc %dir %{_includedir}/libyang/ %files -n python3-yang %defattr(-,root,root) %{_libdir}/python* %changelog