From fa71176da9ce4958730e71d154b4e7749d621a9348d33fc91bdf8c25fe1bd876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 28 Sep 2017 07:52:04 +0000 Subject: [PATCH] Accepting request 528990 from devel:languages:python:singlespec-staging - build both python2 and python3 version of the semanage binding with the singlespec machinery OBS-URL: https://build.opensuse.org/request/show/528990 OBS-URL: https://build.opensuse.org/package/show/security:SELinux/libsemanage?expand=0&rev=61 --- libsemanage.spec | 2 +- python-semanage.changes | 7 +++++++ python-semanage.spec | 29 ++++++++++++++++++++++------- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/libsemanage.spec b/libsemanage.spec index 8cce518..a28b9ea 100644 --- a/libsemanage.spec +++ b/libsemanage.spec @@ -1,7 +1,7 @@ # # spec file for package libsemanage # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/python-semanage.changes b/python-semanage.changes index ed9c3f8..fb55374 100644 --- a/python-semanage.changes +++ b/python-semanage.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Sep 27 15:51:27 UTC 2017 - jmatejek@suse.com + +- build both python2 and python3 version of the semanage binding + with the singlespec machinery + ------------------------------------------------------------------- Sun Jul 17 15:21:03 UTC 2016 - jengelh@inai.de @@ -171,3 +177,4 @@ Tue Jul 15 16:58:47 CEST 2008 - prusnak@suse.cz - initial version 2.0.25 * based on Fedora package by Dan Walsh + diff --git a/python-semanage.spec b/python-semanage.spec index b5a3e31..af801df 100644 --- a/python-semanage.spec +++ b/python-semanage.spec @@ -1,7 +1,7 @@ # # spec file for package python-semanage # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,7 @@ # +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-semanage Version: 2.5 Release: 0 @@ -26,6 +27,7 @@ Url: https://github.com/SELinuxProject/selinux Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20160223/libsemanage-%{version}.tar.gz Source1: baselibs.conf Patch0: suse_path.patch +BuildRequires: %{python_module devel} BuildRequires: audit-devel BuildRequires: bison BuildRequires: flex @@ -33,11 +35,12 @@ BuildRequires: libbz2-devel BuildRequires: libselinux-devel BuildRequires: libsepol-devel BuildRequires: libustr-devel -BuildRequires: python-devel +BuildRequires: python-rpm-macros BuildRequires: swig # Ensure same version Requires: libsemanage1 = %{version} BuildRoot: %{_tmppath}/%{name}-%{version}-build +%python_subpackages %description This package contains the Python bindings for developing @@ -45,18 +48,30 @@ SELinux policy management applications. %prep %setup -q -n libsemanage-%{version} -%patch0 -p0 +%patch0 %build make %{?_smp_mflags} clean -make -j1 CFLAGS="%{optflags}" swigify -make -j1 CFLAGS="%{optflags}" LIBDIR="%{_libdir}" LIBEXECDIR="%{_libexecdir}" SHLIBDIR="%{_lib}" all pywrap +%{python_expand # loop over possible pythons +make -j1 PYTHON=$python CFLAGS="%{optflags}" swigify +make -j1 PYTHON=$python CFLAGS="%{optflags}" \ + LIBDIR="%{_libdir}" \ + LIBEXECDIR="%{_libexecdir}" \ + SHLIBDIR="%{_lib}" \ + all pywrap +} %install mkdir -p %{buildroot}/%{_lib} mkdir -p %{buildroot}%{_libdir} mkdir -p %{buildroot}%{_includedir} -make DESTDIR=%{buildroot} LIBDIR="%{buildroot}%{_libdir}" LIBEXECDIR="%{buildroot}%{_libexecdir}" SHLIBDIR="%{buildroot}/%{_lib}" install install-pywrap +%{python_expand # loop over possible pythons +make PYTHON=$python DESTDIR=%{buildroot} \ + LIBDIR="%{buildroot}%{_libdir}" \ + LIBEXECDIR="%{buildroot}%{_libexecdir}" \ + SHLIBDIR="%{buildroot}/%{_lib}" \ + install install-pywrap +} # remove files contained in other packages rm -rf %{buildroot}%{_sysconfdir} @@ -70,7 +85,7 @@ rm -f %{buildroot}%{_libdir}/libsemanage.* rm -rf %{buildroot}%{_libdir}/pkgconfig rm -rf %{buildroot}%{_mandir} -%files +%files %{python_files} %defattr(-,root,root) %{python_sitearch}/*