From 93bf7ad62c252df85f3ff2bcac8f3fc40dbf33e9 Mon Sep 17 00:00:00 2001 From: citizenaspirant Date: Thu, 30 Apr 2020 19:05:11 +0000 Subject: [PATCH] Add apparmor config to data_files for Debian and Ubuntu --- packages/apparmor/pybitmessage | 19 +++++++++++++++++++ setup.py | 25 +++++++++++++++++-------- 2 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 packages/apparmor/pybitmessage diff --git a/packages/apparmor/pybitmessage b/packages/apparmor/pybitmessage new file mode 100644 index 00000000..3ec3d237 --- /dev/null +++ b/packages/apparmor/pybitmessage @@ -0,0 +1,19 @@ +# Last Modified: Wed Apr 29 21:04:08 2020 +#include + +/usr/bin/pybitmessage { + #include + #include + #include + #include + #include + + owner /home/*/.ICEauthority r, + owner /home/*/.Xauthority r, + owner /home/*/.config/PyBitmessage/ rw, + owner /home/*/.config/PyBitmessage/* rwk, + owner /home/*/.config/Trolltech.conf rwk, + owner /home/*/.config/Trolltech.conf.* rw, + owner /proc/*/mounts r, + +} diff --git a/setup.py b/setup.py index 67faed76..efb5abfc 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ #!/usr/bin/env python2.7 import os +import platform import shutil import sys @@ -84,6 +85,21 @@ if __name__ == "__main__": except ImportError: packages += ['pybitmessage.fallback.umsgpack'] + data_files = [ + ('share/applications/', + ['desktop/pybitmessage.desktop']), + ('share/icons/hicolor/scalable/apps/', + ['desktop/icons/scalable/pybitmessage.svg']), + ('share/icons/hicolor/24x24/apps/', + ['desktop/icons/24x24/pybitmessage.png']) + ] + + if platform.dist()[0] in ('Debian', 'Ubuntu'): + data_files += [ + ("etc/apparmor.d/", + ['packages/apparmor/pybitmessage']) + ] + dist = setup( name='pybitmessage', version=softwareVersion, @@ -115,14 +131,7 @@ if __name__ == "__main__": 'translations/*.ts', 'translations/*.qm', 'images/*.png', 'images/*.ico', 'images/*.icns' ]}, - data_files=[ - ('share/applications/', - ['desktop/pybitmessage.desktop']), - ('share/icons/hicolor/scalable/apps/', - ['desktop/icons/scalable/pybitmessage.svg']), - ('share/icons/hicolor/24x24/apps/', - ['desktop/icons/24x24/pybitmessage.png']) - ], + data_files=data_files, ext_modules=[bitmsghash], zip_safe=False, entry_points={