diff --git a/akonadi-apparmor-opensuse.diff b/akonadi-apparmor-opensuse.diff new file mode 100644 index 0000000..fe4763e --- /dev/null +++ b/akonadi-apparmor-opensuse.diff @@ -0,0 +1,70 @@ +Subject: Adjust Akonadi AppArmor profiles for openSUSE and AppArmor 3.0 + +From: Christian Boltz + +- add paths to match the openSUSE file location +- add 'abi' rules to enable and enforce all AppArmor features + + +Index: b/apparmor/mariadbd_akonadi +=================================================================== +--- a/apparmor/mariadbd_akonadi 2021-04-22 18:21:40.000000000 +0200 ++++ b/apparmor/mariadbd_akonadi 2021-06-05 18:47:31.029159467 +0200 +@@ -1,3 +1,5 @@ ++abi , ++ + #include + + @{xdg_data_home}=@{HOME}/.local/share +Index: b/apparmor/mysqld_akonadi +=================================================================== +--- a/apparmor/mysqld_akonadi 2021-04-22 18:21:40.000000000 +0200 ++++ b/apparmor/mysqld_akonadi 2021-06-05 18:47:36.609147822 +0200 +@@ -1,3 +1,5 @@ ++abi , ++ + #include + + @{xdg_data_home}=@{HOME}/.local/share +Index: b/apparmor/postgresql_akonadi +=================================================================== +--- a/apparmor/postgresql_akonadi 2021-04-22 18:21:40.000000000 +0200 ++++ b/apparmor/postgresql_akonadi 2021-06-05 18:47:38.149144609 +0200 +@@ -1,3 +1,5 @@ ++abi , ++ + #include + + @{xdg_data_home}=@{HOME}/.local/share +Index: b/apparmor/usr.bin.akonadiserver +=================================================================== +--- a/apparmor/usr.bin.akonadiserver 2021-04-22 18:21:40.000000000 +0200 ++++ b/apparmor/usr.bin.akonadiserver 2021-06-05 18:47:44.697130942 +0200 +@@ -1,3 +1,5 @@ ++abi , ++ + #include + + @{xdg_data_home}=@{HOME}/.local/share +@@ -37,6 +39,7 @@ + /etc/xdg/** r, + /usr/bin/akonadiserver mr, + /usr/lib/x86_64-linux-gnu/libexec/drkonqi PUx, ++ /usr/lib{,64}/libexec/drkonqi PUx, + /usr/bin/mariadb-admin PUx -> mariadbd_akonadi, + /usr/bin/mariadb-check PUx -> mariadbd_akonadi, + /usr/bin/mariadb-install-db PUx -> mariaddbd_akonadi, +@@ -49,10 +52,12 @@ + /{usr/,usr/lib/postgresql/*/,opt/pgsql*/}bin/pg_ctl PUx -> postgresql_akonadi, + /{usr/,usr/lib/postgresql/*/}bin/pg_upgrade PUx -> postgresql_akonadi, + /usr/sbin/mysqld PUx -> mysqld_akonadi, ++ /usr/share/icu/[0-9]*.[0-9]*/*.dat r, + /usr/share/mime/mime.cache r, + /usr/share/mime/packages/ r, + /usr/share/mime/types r, +- /usr/share/qt/translations/* r, ++ /usr/share/qt5/qtlogging.ini r, ++ /usr/share/qt{,5}/translations/* r, + /usr/share/mysql/** r, + @{PROC}/sys/kernel/core_pattern r, + @{PROC}/sys/kernel/random/boot_id r, diff --git a/akonadi-server.changes b/akonadi-server.changes index 6e937c0..3898adc 100644 --- a/akonadi-server.changes +++ b/akonadi-server.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jun 3 18:22:09 UTC 2021 - Christian Boltz + +- Install AppArmor profiles (as -apparmor subpackage) +- add akonadi-apparmor-opensuse.diff to adjust the profiles to + openSUSE paths, and to add 'abi' rules to the profiles + ------------------------------------------------------------------- Wed May 12 06:06:35 UTC 2021 - Christophe Giboudeaux diff --git a/akonadi-server.spec b/akonadi-server.spec index 4672842..e2a67c1 100644 --- a/akonadi-server.spec +++ b/akonadi-server.spec @@ -34,6 +34,10 @@ Source1: https://download.kde.org/stable/release-service/%{version}/src/% Source2: applications.keyring %endif Source99: akonadi-server-rpmlintrc +# PATCH-FIX-OPENSUSE akonadi-apparmor-opensuse.diff - adjust AppArmor profiles to work on openSUSE +Patch: akonadi-apparmor-opensuse.diff +BuildRequires: apparmor-abstractions +BuildRequires: apparmor-rpm-macros BuildRequires: extra-cmake-modules >= %{kf5_version} BuildRequires: kf5-filesystem BuildRequires: libQt5Sql-private-headers-devel @@ -161,13 +165,20 @@ Provides: libKF5AkonadiPrivate-devel = %{version} This package contains development files of Akonadi, the KDE PIM storage service. +%package apparmor +Summary: AppArmor profiles for Akonadi +Requires: apparmor-abstractions + +%description apparmor +This package contains AppArmor profiles for Akonadi. + %lang_package %prep %autosetup -p1 -n %{rname}-%{version} %build - %cmake_kf5 -d build -- -DINSTALL_QSQLITE_IN_QT_PREFIX=TRUE -DQT_PLUGINS_DIR=%{_kf5_plugindir} -DINSTALL_APPARMOR=FALSE + %cmake_kf5 -d build -- -DINSTALL_QSQLITE_IN_QT_PREFIX=TRUE -DQT_PLUGINS_DIR=%{_kf5_plugindir} %cmake_build %install @@ -190,6 +201,9 @@ service. %post -n libKF5AkonadiXml5 -p /sbin/ldconfig %postun -n libKF5AkonadiXml5 -p /sbin/ldconfig +%post apparmor +%apparmor_reload %{_sysconfdir}/apparmor.d/mariadbd_akonadi %{_sysconfdir}/apparmor.d/mysqld_akonadi %{_sysconfdir}/apparmor.d/postgresql_akonadi %{_sysconfdir}/apparmor.d/usr.bin.akonadiserver + %files %license LICENSES/* %doc AUTHORS @@ -263,6 +277,12 @@ service. %dir %{_kf5_sharedir}/kdevappwizard/ %{_kf5_sharedir}/kdevappwizard/templates/ +%files apparmor +%config(noreplace) %{_sysconfdir}/apparmor.d/mariadbd_akonadi +%config(noreplace) %{_sysconfdir}/apparmor.d/mysqld_akonadi +%config(noreplace) %{_sysconfdir}/apparmor.d/postgresql_akonadi +%config(noreplace) %{_sysconfdir}/apparmor.d/usr.bin.akonadiserver + %if %{with lang} %files lang -f %{name}.lang %license LICENSES/*