]> git.pld-linux.org Git - packages/apparmor-utils.git/blobdiff - apparmor-utils.spec
- up to 2.10.1
[packages/apparmor-utils.git] / apparmor-utils.spec
index e92985c381c4eea0bf8fa1dfe9e662e622fcaea7..8e03e84251455ee590924872131d713ba5045777 100644 (file)
@@ -1,26 +1,32 @@
-%include       /usr/lib/rpm/macros.perl
-%define                _vimdatadir     %{_datadir}/vim/vimfiles
+
+%bcond_with    python3 # use Python 3 instead of Python 2
+
 Summary:       AppArmor userlevel utilities that are useful in creating AppArmor profiles
 Summary(pl.UTF-8):     Narzędzia przestrzeni użytkownika przydatne do tworzenia profili AppArmor
 Name:          apparmor-utils
-Version:       2.7.2
+Version:       2.10.1
 Release:       1
 Epoch:         1
 License:       GPL v2
 Group:         Base
-Source0:       http://launchpad.net/apparmor/2.7/%{version}/+download/apparmor-%{version}.tar.gz
-# Source0-md5: 2863e85bdfdf9ee35b83db6721fed1f1
-Source1:       Ycp.pm
-URL:           http://apparmor.wiki.kernel.org/
-BuildRequires: gettext-devel
-BuildRequires: rpm-perlprov
-Requires:      perl-DBD-SQLite >= 1.08
+Source0:       http://launchpad.net/apparmor/2.10/%{version}/+download/apparmor-%{version}.tar.gz
+# Source0-md5: c9d82e04d699b0530b12dec15136027d
+URL:           http://wiki.apparmor.net/
+BuildRequires: gettext-tools
+%if %{with python3}
+BuildRequires: python3
+Requires:      python3-LibAppArmor
+%else
+BuildRequires: python
+Requires:      python-LibAppArmor
+%endif
+Requires:      perl-LibAppArmor
 Provides:      subdomain-utils
 Obsoletes:     subdomain-utils
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _noautoreq      'perl(ycp)'
+%define                _vimdatadir     %{_datadir}/vim/vimfiles
 
 %description
 This provides some useful programs to help create and manage AppArmor
@@ -48,28 +54,41 @@ Obsługa plików AppArmor dla Vima.
 %prep
 %setup -q -n apparmor-%{version}
 
+%if %{with python3}
+%{__sed} -i -e '1s, */usr/bin/env python,%{__python3},' utils/aa-*
+%else
+%{__sed} -i -e '1s, */usr/bin/env python,%{__python},' utils/aa-*
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 cd utils
 
 %{__make} install \
+%if %{with python3}
+       PYTHON="%{__python3}" \
+%else
+       PYTHON="%{__python}" \
+%endif
        DESTDIR=$RPM_BUILD_ROOT \
        BINDIR=$RPM_BUILD_ROOT%{_sbindir} \
-       PERLDIR=$RPM_BUILD_ROOT%{perl_vendorlib}/Immunix
-
-install -d $RPM_BUILD_ROOT%{_vimdatadir}/{syntax,ftdetect}
-install apparmor.vim $RPM_BUILD_ROOT%{_vimdatadir}/syntax
-install %{SOURCE1} $RPM_BUILD_ROOT%{perl_vendorlib}/Immunix
-
-# outdated version of pt
-%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/locale/pt_PT
+       VIM_INSTALL_PATH=$RPM_BUILD_ROOT%{_vimdatadir}/syntax
 
+install -d $RPM_BUILD_ROOT%{_vimdatadir}/ftdetect
 cat > $RPM_BUILD_ROOT%{_vimdatadir}/ftdetect/apparmor.vim <<-EOF
 au BufNewFile,BufRead /etc/apparmor.d/*,/etc/apparmor/profiles/* set filetype=apparmor
 EOF
 
 cd ..
 
+# only .pyc are created on install
+%if %{with python3}
+%py3_ocomp $RPM_BUILD_ROOT%{py3_sitescriptdir}/apparmor
+%else
+%py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}/apparmor
+%py_postclean
+%endif
+
 %find_lang %{name}
 
 %clean
@@ -78,12 +97,25 @@ rm -rf $RPM_BUILD_ROOT
 %files -f %{name}.lang
 %defattr(644,root,root,755)
 %dir %{_sysconfdir}/apparmor
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apparmor/*.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apparmor/easyprof.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apparmor/logprof.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apparmor/notify.conf
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apparmor/severity.db
+%attr(755,root,root) %{_bindir}/aa-easyprof
 %attr(755,root,root) %{_sbindir}/aa-*
 %attr(755,root,root) %{_sbindir}/apparmor_status
-%dir %{perl_vendorlib}/Immunix
-%{perl_vendorlib}/Immunix/*.pm
+%dir %{_datadir}/apparmor
+%{_datadir}/apparmor/easyprof
+%if %{with python3}
+%{py3_sitedir}/apparmor
+%{py3_sitedir}/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
+%endif
 %{_mandir}/man5/logprof.conf.5*
 %{_mandir}/man8/aa-*.8*
 %{_mandir}/man8/apparmor_status.8*
@@ -92,3 +124,4 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %{_vimdatadir}/ftdetect/apparmor.vim
 %{_vimdatadir}/syntax/apparmor.vim
+%{_mandir}/man5/apparmor.vim.5*
This page took 0.076339 seconds and 4 git commands to generate.