From b1e7f92a4897f76537cd4d62d24ec9a0bbd7984eaf781a043eba8add049dd745 Mon Sep 17 00:00:00 2001 From: Tony Jones Date: Wed, 17 Jan 2018 21:04:11 +0000 Subject: [PATCH] Accepting request 566726 from home:scarabeus_iv:branches:security - Add conditions around python plugins to allow us to conditionalize them in enviroment without python2 OBS-URL: https://build.opensuse.org/request/show/566726 OBS-URL: https://build.opensuse.org/package/show/security/audit?expand=0&rev=94 --- audit-secondary.changes | 6 ++++++ audit-secondary.spec | 30 +++++++++++++++++++----------- audit.spec | 2 +- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/audit-secondary.changes b/audit-secondary.changes index b8e8725..f6ec1f5 100644 --- a/audit-secondary.changes +++ b/audit-secondary.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jan 17 15:25:55 UTC 2018 - tchvatal@suse.com + +- Add conditions around python plugins to allow us to conditionalize + them in enviroment without python2 + ------------------------------------------------------------------- Thu Nov 9 16:21:23 UTC 2017 - mpluskal@suse.com diff --git a/audit-secondary.spec b/audit-secondary.spec index 45b70dd..bf34b7f 100644 --- a/audit-secondary.spec +++ b/audit-secondary.spec @@ -1,7 +1,7 @@ # # spec file for package audit-secondary # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 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,8 @@ # +%bcond_without python2 +%bcond_without python3 # This package contains all audit functionality except for audit-libs. # The seperation is required to minimize unnecessary build cycles. %define _name audit @@ -38,8 +40,12 @@ BuildRequires: kernel-headers >= 2.6.30 BuildRequires: libtool BuildRequires: openldap2-devel BuildRequires: pkgconfig +%if %{with python2} BuildRequires: python2-devel +%endif +%if %{with python3} BuildRequires: python3-devel +%endif BuildRequires: swig BuildRequires: systemd-rpm-macros BuildRequires: tcpd-devel @@ -144,10 +150,8 @@ rm -rf %{buildroot}%{_sysconfdir}/rc.d/init.d # https://lists.fedoraproject.org/pipermail/devel/2012-June/169411.html rm -rf %{buildroot}%{_libexecdir}/audit # Clean up some unneeded library files -for ver in %{py_ver} %{py3_ver}; do - rm -f %{buildroot}/%{_libdir}/python${ver}/site-packages/{_audit,_auparse,auparse}.{a,la} - rm -rf %{buildroot}/%{_libdir}/python${ver}/site-packages/__pycache__ -done +rm -f %{buildroot}/%{_libdir}/python*/site-packages/{_audit,_auparse,auparse}.{a,la} +rm -rf %{buildroot}/%{_libdir}/python*/site-packages/__pycache__ # cleanup makefiles for the rules (installed by %%docs command) rm -f %{buildroot}/%{_libdir}/pkgconfig/{audit,auparse}.pc # cleanup files handled by audit.spec @@ -246,15 +250,19 @@ fi %{_unitdir}/auditd.service %{_sbindir}/rcauditd +%if %{with python2} %files -n python2-audit -%attr(755,root,root) %{_libdir}/python%{py_ver}/site-packages/_audit.so -%attr(755,root,root) %{_libdir}/python%{py_ver}/site-packages/auparse.so -%{_libdir}/python%{py_ver}/site-packages/audit.py* +%attr(755,root,root) %{python2_sitearch}/_audit.so +%attr(755,root,root) %{python2_sitearch}/auparse.so +%{python2_sitearch}/audit.py* +%endif +%if %{with python3} %files -n python3-audit -%attr(755,root,root) %{_libdir}/python%{py3_ver}/site-packages/_audit.so -%attr(755,root,root) %{_libdir}/python%{py3_ver}/site-packages/auparse.so -%{_libdir}/python%{py3_ver}/site-packages/audit.py* +%attr(755,root,root) %{python3_sitearch}/_audit.so +%attr(755,root,root) %{python3_sitearch}/auparse.so +%{python3_sitearch}/audit.py* +%endif %files -n audit-audispd-plugins %attr(644,root,root) %{_mandir}/man8/audispd-zos-remote.8.gz diff --git a/audit.spec b/audit.spec index 058eda5..3b900b7 100644 --- a/audit.spec +++ b/audit.spec @@ -1,7 +1,7 @@ # # spec file for package audit # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 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