@@ -14,28 +14,12 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
1414 %define with_lang_bind 1
1515%endif
1616
17- %if 0%{?rhel} && 0%{?rhel} < 7
18- # CentOS/RedHat before 7.0 contains old pcre without pcre_free_study().
19- # With cache disabled, this isn't needed
20- %define with_enable_cache 0
21- # CentOS/RedHat before 7.0 contains old valgrind which can't run
22- # valgrind tests. Disable them
23- %define with_valgrind 0
24- %else
25- %define with_enable_cache 1
26- %define with_valgrind 1
27- %endif
28-
2917Requires: pcre
3018BuildRequires: cmake
3119BuildRequires: doxygen
3220BuildRequires: pcre-devel
3321BuildRequires: gcc
3422
35- %if %{with_valgrind}
36- BuildRequires: valgrind
37- %endif
38-
3923%if %{with_lang_bind}
4024BuildRequires: gcc-c++
4125BuildRequires: swig >= 3.0.12
@@ -44,12 +28,9 @@ BuildRequires: libcmocka-devel
4428%if 0%{?suse_version} + 0%{?fedora} > 0
4529BuildRequires: python3-devel
4630%else
47- %if 0%{?rhel} && 0%{?rhel} > 7
4831BuildRequires: python36-devel
49- %else
50- BuildRequires: python34-devel
51- %endif
5232%endif
33+
5334%endif
5435
5536Conflicts: @CONFLICT_PACKAGE_NAME@ = @LIBYANG_MAJOR_VERSION@.@LIBYANG_MINOR_VERSION@
@@ -101,22 +82,12 @@ cd build
10182%else
10283 %define cmake_lang_bind "-DGEN_LANGUAGE_BINDINGS=OFF"
10384%endif
104- %if %{with_enable_cache}
105- %define cmake_enable_cache ""
106- %else
107- %define cmake_enable_cache "-DENABLE_CACHE=OFF"
108- %endif
109- %if %{with_valgrind}
110- %define cmake_valgrind ""
111- %else
112- %define cmake_valgrind "-DENABLE_VALGRIND_TESTS=OFF"
113- %endif
11485cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr \
11586 -DCMAKE_BUILD_TYPE:String="@BUILD_TYPE@" \
11687 -DENABLE_LYD_PRIV=ON \
11788 -DGEN_JAVA_BINDINGS=OFF \
11889 -DGEN_JAVASCRIPT_BINDINGS=OFF \
119- %{cmake_valgrind} %{ cmake_lang_bind} %{cmake_enable_cache } ..
90+ %{cmake_lang_bind} ..
12091make
12192
12293%check
@@ -129,13 +100,13 @@ make DESTDIR=%{buildroot} install
129100
130101%post -p /sbin/ldconfig
131102%if %{with_lang_bind}
132- %post -n libyang-cpp@PACKAGE_PART_NAME@ -p /sbin/ldconfig
133- %endif
103+ %post -n libyang-cpp@PACKAGE_PART_NAME@ -p /sbin/ldconfig
104+ %endif
134105
135106%postun -p /sbin/ldconfig
136107%if %{with_lang_bind}
137- %postun -n libyang-cpp@PACKAGE_PART_NAME@ -p /sbin/ldconfig
138- %endif
108+ %postun -n libyang-cpp@PACKAGE_PART_NAME@ -p /sbin/ldconfig
109+ %endif
139110
140111%files
141112%defattr(-,root,root)
0 commit comments