1- %if 0%{?rhel } == 8
2- %undefine __cmake_in_source_build
3- %endif
4-
51Name: libyang
62Version: {{ version }}
73Release: {{ release }}%{?dist }
@@ -14,7 +10,6 @@ BuildRequires: cmake
1410BuildRequires: doxygen
1511BuildRequires: gcc
1612BuildRequires: cmake(cmocka) >= 1.0.1
17- BuildRequires: make
1813BuildRequires: pkgconfig(libpcre2-8) >= 10.21
1914
2015%package modules
@@ -53,43 +48,23 @@ written (and providing API) in C.
5348
5449%prep
5550%autosetup -p1
56- %if 0%{?rhel } && 0%{?rhel } < 8
57- mkdir build
58- %endif
5951
6052%build
61- %if 0%{?rhel } && 0%{?rhel } < 8
62- cd build
63- cmake \
64- -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix } \
65- -DCMAKE_BUILD_TYPE:String=" Release" \
66- -DCMAKE_C_FLAGS=" ${RPM_OPT_FLAGS} " \
67- -DCMAKE_CXX_FLAGS=" ${RPM_OPT_FLAGS} " \
68- ..
69- make
53+ %cmake -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
54+ %cmake_build
55+ %if 0%{?suse_version }
56+ %cmake_build doc
7057%else
71- %cmake -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
72- %cmake_build
58+ %cmake_build --target doc
7359%endif
74- %cmake_build --target doc
7560
7661%check
77- %if ( 0%{? rhel} == 0 ) || 0%{?rhel } > 7
78- %if " x%{?suse_version}" == " x"
79- cd %{__cmake_builddir}
80- %endif
81- %endif
82- ctest --output-on-failure -V %{?_smp_mflags }
62+ %ctest --output-on-failure
8363
8464%install
8565mkdir -m0755 -p %{buildroot }/%{_docdir }/libyang
86- %if 0%{?rhel } && 0%{?rhel } < 8
87- cd build
88- make DESTDIR=%{buildroot } install
89- %else
90- %cmake_install
91- cp -a doc/html %{buildroot }/%{_docdir }/libyang/html
92- %endif
66+ %cmake_install
67+ cp -a doc/html %{buildroot }/%{_docdir }/libyang/html
9368
9469%files
9570%license LICENSE
0 commit comments