SHA256
1
0
forked from pool/libsemanage

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
This commit is contained in:
Tomáš Chvátal 2017-09-28 07:52:04 +00:00 committed by Git OBS Bridge
parent 30ba64d8e9
commit fa71176da9
3 changed files with 30 additions and 8 deletions

View File

@ -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

View File

@ -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 <dwalsh@redhat.com>

View File

@ -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}/*