FS#50746 - [audit] Please install python2 binding, which is used by community/perf

Attached to Project: Community Packages
Opened by Alain Kalker (ackalker) - Monday, 12 September 2016, 00:21 GMT
Last edited by Christian Rebischke (Shibumi) - Wednesday, 17 May 2017, 20:17 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Christian Rebischke (Shibumi)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

Several scripts in community/perf want to use the python2 binding for audit, for example, running:

# perf script syscall-counts
[sudo] password for miki:
Install the audit-libs-python package to get syscall names.
For example:
# apt-get install python-audit (Ubuntu)
# yum install audit-libs-python (Fedora)
etc.

Press control+C to stop and show the summary
^C
syscall events:
[...]

Syscalls show as numbers, not very convenient.

I've verified that the following patch to PKGBUILD will install both python2 _and_ python3 bindings:

diff --git a/audit/repos/community-x86_64/PKGBUILD b/audit/repos/community-x86_64/PKGBUILD
index cc8a3eb..f1b2a0c 100644
--- a/audit/repos/community-x86_64/PKGBUILD
+++ b/audit/repos/community-x86_64/PKGBUILD
@@ -12,7 +12,7 @@ pkgdesc='Userspace components of the audit framework'
url='https://people.redhat.com/sgrubb/audit'
arch=(i686 x86_64)
depends=(krb5 libcap-ng)
-makedepends=(libldap swig linux-headers python)
+makedepends=(libldap swig linux-headers python python2)
license=(GPL)
options=(emptydirs)
backup=(
@@ -33,13 +33,12 @@ install=$pkgname.install

build() {
cd $pkgname-$pkgver
- export PYTHON=/usr/bin/python3
+ export PYTHON=/usr/bin/python2
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
--sysconfdir=/etc \
--libexecdir=/usr/lib/audit \
- --with-python=yes \
--enable-gssapi-krb5=yes \
--enable-systemd=yes \
--with-libcap-ng=yes

Yes, the configure arguments may look a bit strange, but they do work (I've studied the logic in both the configure script and the generated Makefiles).

Additional info:
* package version(s)
perf 4.7-2
audit 2.6.6-1
* config and/or log files etc.
[with patch applied]
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/site-packages
configure: Python bindings will be built
checking whether to create python3 bindings... investigating
checking for python3-config... /usr/bin/python3-config
Python3 bindings WILL be built
checking for python3... /usr/bin/python3


Steps to reproduce:
This task depends upon

Closed by  Christian Rebischke (Shibumi)
Wednesday, 17 May 2017, 20:17 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed with 2.7.5-2
Comment by Alain Kalker (ackalker) - Monday, 12 September 2016, 00:26 GMT
Sorry for the botched formatting, I'm attaching the patch as a file instead.
Comment by Christian Rebischke (Shibumi) - Wednesday, 26 April 2017, 15:51 GMT
Hello everybody,
I am the new maintainer.
You are right your PKGBUILD patch looks weird..
You have just changed the python3 part to python2 and removed the --with-python-option.

So for me it looks like the key is removing the --with-python-option because then the configure-script
will automatically check for python versions.

But I would add python2 AND python3 to makedepends to make sure that the configure-script will find both.

I will have a look at this and move a version to testing. It would be nice if you could test afterwards if it works like expected.
Comment by Christian Rebischke (Shibumi) - Wednesday, 26 April 2017, 16:11 GMT
@ackalker

Please checkout audit-2.7.5-2 in testing. Thanks

Loading...