blob: 163a2e3b4e18b06631995180bbdaac99068987f6 [file] [log] [blame]
PavolVican8fbbbdc2017-03-25 00:55:44 +01001Name: @PACKAGE_NAME@
2Version: @LIBYANG_VERSION@
3Release: 0
4Summary: Libyang library
5Url: https://github.com/CESNET/libyang
6Source: %{url}/archive/@BRANCH@.tar.gz
PavolVican8738eee2018-02-27 01:47:02 +01007Source1: libyang.rpmlintrc
PavolVican8fbbbdc2017-03-25 00:55:44 +01008License: BSD-3-Clause
PavolVican80f962b2017-05-29 16:40:16 +02009BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
PavolVican8fbbbdc2017-03-25 00:55:44 +010010
PavolVican80f962b2017-05-29 16:40:16 +020011Requires: pcre
PavolVican8fbbbdc2017-03-25 00:55:44 +010012BuildRequires: cmake
13BuildRequires: doxygen
PavolVican80f962b2017-05-29 16:40:16 +020014BuildRequires: pcre-devel
PavolVican8fbbbdc2017-03-25 00:55:44 +010015BuildRequires: valgrind
PavolVican80f962b2017-05-29 16:40:16 +020016BuildRequires: libcmocka-devel
PavolVican5fd74d92017-06-08 09:38:39 +020017BuildRequires: gcc
PavolVican8738eee2018-02-27 01:47:02 +010018BuildRequires: gcc-c++
Michal Vasko6341aea2018-09-27 09:03:06 +020019BuildRequires: swig >= 3.0.12
PavolVican8738eee2018-02-27 01:47:02 +010020
21%if 0%{?suse_version} + 0%{?fedora} > 0
22BuildRequires: python3-devel
23%else
24BuildRequires: python34-devel
25%endif
PavolVican8fbbbdc2017-03-25 00:55:44 +010026
PavolVican80f962b2017-05-29 16:40:16 +020027Conflicts: @CONFLICT_PACKAGE_NAME@ = @LIBYANG_MAJOR_VERSION@.@LIBYANG_MINOR_VERSION@
PavolVican8fbbbdc2017-03-25 00:55:44 +010028
29%package devel
30Summary: Headers of libyang library
31Requires: %{name} = %{version}-%{release}
PavolVican80f962b2017-05-29 16:40:16 +020032Requires: pcre-devel
PavolVican8fbbbdc2017-03-25 00:55:44 +010033
PavolVican8738eee2018-02-27 01:47:02 +010034%package -n libyang-cpp@PACKAGE_PART_NAME@
35Summary: Bindings to c++ language
36Requires: %{name} = %{version}-%{release}
37
38%package -n libyang-cpp@PACKAGE_PART_NAME@-devel
39Summary: Headers of bindings to c++ language
PavolVican5b6ce2c2018-02-27 13:51:40 +010040Requires: libyang-cpp@PACKAGE_PART_NAME@ = %{version}-%{release}
41Requires: pcre-devel
PavolVican8738eee2018-02-27 01:47:02 +010042
43%package -n python3-yang@PACKAGE_PART_NAME@
44Summary: Binding to python
PavolVican5b6ce2c2018-02-27 13:51:40 +010045Requires: libyang-cpp@PACKAGE_PART_NAME@ = %{version}-%{release}
PavolVican8738eee2018-02-27 01:47:02 +010046Requires: %{name} = %{version}-%{release}
47
48%description -n libyang-cpp@PACKAGE_PART_NAME@
49Bindings of libyang library to C++ language.
50
51%description -n libyang-cpp@PACKAGE_PART_NAME@-devel
52Headers of bindings to c++ language.
53
54%description -n python3-yang@PACKAGE_PART_NAME@
55Bindings of libyang library to python language.
56
PavolVican8fbbbdc2017-03-25 00:55:44 +010057%description devel
58Headers of libyang library.
59
60%description
61Libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
62
63%prep
64%setup -n libyang-@BRANCH@
PavolVican8738eee2018-02-27 01:47:02 +010065mkdir build
PavolVican8fbbbdc2017-03-25 00:55:44 +010066
PavolVican8fbbbdc2017-03-25 00:55:44 +010067%build
PavolVican8738eee2018-02-27 01:47:02 +010068cd build
69cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -D CMAKE_BUILD_TYPE:String="@BUILD_TYPE@" -DGEN_LANGUAGE_BINDINGS=ON ..
PavolVican8fbbbdc2017-03-25 00:55:44 +010070make
71
72%check
PavolVican8738eee2018-02-27 01:47:02 +010073cd build
PavolVican93d80d12017-06-07 15:18:01 +020074ctest --output-on-failure
PavolVican8fbbbdc2017-03-25 00:55:44 +010075
76%install
PavolVican8738eee2018-02-27 01:47:02 +010077cd build
PavolVican8fbbbdc2017-03-25 00:55:44 +010078make DESTDIR=%{buildroot} install
PavolVican8fbbbdc2017-03-25 00:55:44 +010079
80%post -p /sbin/ldconfig
PavolVican8738eee2018-02-27 01:47:02 +010081%post -n libyang-cpp@PACKAGE_PART_NAME@ -p /sbin/ldconfig
PavolVican8fbbbdc2017-03-25 00:55:44 +010082
83%postun -p /sbin/ldconfig
PavolVican8738eee2018-02-27 01:47:02 +010084%postun -n libyang-cpp@PACKAGE_PART_NAME@ -p /sbin/ldconfig
PavolVican8fbbbdc2017-03-25 00:55:44 +010085
86%files
PavolVican80f962b2017-05-29 16:40:16 +020087%defattr(-,root,root)
88%{_bindir}/yanglint
Radek Krejci9d4bb982017-07-12 15:20:34 +020089%{_bindir}/yangre
PavolVican80f962b2017-05-29 16:40:16 +020090%{_datadir}/man/man1/yanglint.1.gz
David Lamparter2f2a4b62018-11-09 16:38:12 +010091%{_datadir}/man/man1/yangre.1.gz
PavolVican8fbbbdc2017-03-25 00:55:44 +010092%{_libdir}/libyang.so.*
PavolVican507091b2018-03-09 13:33:14 +010093%{_libdir}/libyang/*
PavolVican80f962b2017-05-29 16:40:16 +020094%dir %{_libdir}/libyang/
PavolVican8fbbbdc2017-03-25 00:55:44 +010095
96%files devel
PavolVican80f962b2017-05-29 16:40:16 +020097%defattr(-,root,root)
PavolVican8fbbbdc2017-03-25 00:55:44 +010098%{_libdir}/libyang.so
99%{_libdir}/pkgconfig/libyang.pc
PavolVican8738eee2018-02-27 01:47:02 +0100100%{_includedir}/libyang/*.h
PavolVican80f962b2017-05-29 16:40:16 +0200101%dir %{_includedir}/libyang/
102
PavolVican8738eee2018-02-27 01:47:02 +0100103%files -n libyang-cpp@PACKAGE_PART_NAME@
104%defattr(-,root,root)
105%{_libdir}/libyang-cpp.so.*
106
107%files -n libyang-cpp@PACKAGE_PART_NAME@-devel
108%defattr(-,root,root)
109%{_libdir}/libyang-cpp.so
110%{_includedir}/libyang/*.hpp
PavolVican887993f2018-06-25 20:27:11 +0200111%{_libdir}/pkgconfig/libyang-cpp.pc
PavolVican8738eee2018-02-27 01:47:02 +0100112%dir %{_includedir}/libyang/
113
114%files -n python3-yang@PACKAGE_PART_NAME@
115%defattr(-,root,root)
116%{_libdir}/python*
117
PavolVican80f962b2017-05-29 16:40:16 +0200118%changelog