Drop with_python3 and use python2_sitearch macros

Fixes:
error: File not found: /home/user/rpmbuild/BUILDROOT/libsemanage-2.7-6.fc28.x86_64/_semanage.so
error: File not found: /home/user/rpmbuild/BUILDROOT/libsemanage-2.7-6.fc28.x86_64/semanage.py*
This commit is contained in:
Petr Lautrbach 2018-01-22 20:08:33 +01:00
parent b590caa247
commit 9be262bc6e
1 changed files with 2 additions and 15 deletions

View File

@ -1,6 +1,3 @@
%global with_python3 1
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))")}
%define libsepolver 2.7-3
%define libselinuxver 2.7-6
@ -24,10 +21,8 @@ BuildRequires: libsepol-devel >= %{libsepolver}
BuildRequires: audit-libs-devel
BuildRequires: python2 python2-devel bison flex bzip2-devel
%if 0%{?with_python3}
BuildRequires: python3
BuildRequires: python3-devel
%endif # if with_python3
Requires: bzip2-libs audit-libs
@ -79,7 +74,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
The libsemanage-python package contains the python bindings for developing
SELinux management applications.
%if 0%{?with_python3}
%package -n python3-libsemanage
Summary: semanage python 3 bindings for libsemanage
Group: Development/Libraries
@ -94,7 +88,6 @@ Obsoletes: %{name}-python3 < %{version}-%{release}
%description -n python3-libsemanage
The libsemanage-python3 package contains the python 3 bindings for developing
SELinux management applications.
%endif # if with_python3
%prep
%autosetup -n libsemanage-%{version} -p 1
@ -123,10 +116,8 @@ make CFLAGS="%{optflags}" LIBDIR="%{_libdir}" SHLIBDIR="%{_lib}" all
BuildPythonWrapper \
%{__python}
%if 0%{?with_python3}
BuildPythonWrapper \
%{__python3}
%endif # with_python3
%install
InstallPythonWrapper() {
@ -149,11 +140,9 @@ InstallPythonWrapper \
%{__python} \
.so
%if 0%{?with_python3}
InstallPythonWrapper \
%{__python3} \
$(python3-config --extension-suffix)
%endif # with_python3
cp %{SOURCE1} ${RPM_BUILD_ROOT}/etc/selinux/semanage.conf
ln -sf %{_libdir}/libsemanage.so.1 ${RPM_BUILD_ROOT}/%{_libdir}/libsemanage.so
@ -193,17 +182,15 @@ rm -rf ${RPM_BUILD_ROOT}
%files -n python2-libsemanage
%defattr(-,root,root)
%{python_sitearch}/_semanage.so
%{python_sitearch}/semanage.py*
%{python2_sitearch}/_semanage.so
%{python2_sitearch}/semanage.py*
%if 0%{?with_python3}
%files -n python3-libsemanage
%defattr(-,root,root)
%{python3_sitearch}/*.so
%{python3_sitearch}/semanage.py*
%{python3_sitearch}/__pycache__/semanage*
%{_libexecdir}/selinux/semanage_migrate_store
%endif # if with_python3
%changelog
* Tue Jan 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.7-6