--- /dev/null
+--- apparmor-2.10.1/utils/Makefile.orig 2015-11-18 21:29:25.000000000 +0100
++++ apparmor-2.10.1/utils/Makefile 2016-04-26 18:56:36.173658050 +0200
+@@ -57,7 +57,7 @@
+ $(MAKE) install_manpages DESTDIR=${DESTDIR}
+ $(MAKE) -C vim install DESTDIR=${DESTDIR}
+ ln -sf aa-status.8 ${DESTDIR}/${MANDIR}/man8/apparmor_status.8
+- ${PYTHON} ${PYSETUP} install --prefix=${PYPREFIX} --root=${DESTDIR} --version=${VERSION}
++ ${PYTHON} ${PYSETUP} install --prefix=${PYPREFIX} --root=${DESTDIR} $(PYSETUP_INSTALL_ARGS) --version=${VERSION}
+
+ .PHONY: clean
+ ifndef VERBOSE
-
+#
+# Conditional build:
%bcond_with python3 # use Python 3 instead of Python 2
Summary: AppArmor userlevel utilities that are useful in creating AppArmor profiles
Group: Base
Source0: http://launchpad.net/apparmor/2.10/%{version}/+download/apparmor-%{version}.tar.gz
# Source0-md5: c9d82e04d699b0530b12dec15136027d
+Patch0: %{name}-pysetup.patch
URL: http://wiki.apparmor.net/
BuildRequires: gettext-tools
%if %{with python3}
%prep
%setup -q -n apparmor-%{version}
+%patch0 -p1
%if %{with python3}
%{__sed} -i -e '1s, */usr/bin/env python,%{__python3},' utils/aa-*
%{__make} install \
%if %{with python3}
PYTHON="%{__python3}" \
+ PYSETUP_INSTALL_ARGS="--install-purelib=%{py3_sitescriptdir}" \
%else
PYTHON="%{__python}" \
+ PYSETUP_INSTALL_ARGS="--install-purelib=%{py_sitescriptdir}" \
%endif
DESTDIR=$RPM_BUILD_ROOT \
BINDIR=$RPM_BUILD_ROOT%{_sbindir} \
%dir %{_datadir}/apparmor
%{_datadir}/apparmor/easyprof
%if %{with python3}
-%{py3_sitedir}/apparmor
-%{py3_sitedir}/apparmor-%{version}-py*.egg-info
+%{py3_sitescriptdir}/apparmor
+%{py3_sitescriptdir}/apparmor-%{version}-py*.egg-info
%else
-%dir %{py_sitedir}/apparmor
-%{py_sitedir}/apparmor/*.py[co]
-%dir %{py_sitedir}/apparmor/rule
-%{py_sitedir}/apparmor/rule/*.py[co]
-%{py_sitedir}/apparmor-%{version}-py*.egg-info
+%dir %{py_sitescriptdir}/apparmor
+%{py_sitescriptdir}/apparmor/*.py[co]
+%dir %{py_sitescriptdir}/apparmor/rule
+%{py_sitescriptdir}/apparmor/rule/*.py[co]
+%{py_sitescriptdir}/apparmor-%{version}-py*.egg-info
%endif
%{_mandir}/man5/logprof.conf.5*
%{_mandir}/man8/aa-*.8*