From 017e0f8dd222cf069de5f5e741c56fe06f3054fd41d2fb1e9cd4cf5469380645 Mon Sep 17 00:00:00 2001 From: Christophe Marin Date: Fri, 15 Mar 2024 08:37:53 +0000 Subject: [PATCH] Accepting request 1158152 from home:Vogtinator:plasma6 - Also attempt pam-config enablement in %posttrans (boo#1221371) - Add patches to avoid depending on Qt: * 0001-Allow-specifing-KWALLETD_BIN_PATH-manually.patch * 0002-Use-GNUInstallDirs-instead-of-KDEInstallDirs.patch OBS-URL: https://build.opensuse.org/request/show/1158152 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks/pam_kwallet6?expand=0&rev=9 --- ...specifing-KWALLETD_BIN_PATH-manually.patch | 32 ++++++++++++++ ...nstallDirs-instead-of-KDEInstallDirs.patch | 44 +++++++++++++++++++ pam_kwallet6.changes | 12 +++++ pam_kwallet6.spec | 25 +++++++---- 4 files changed, 105 insertions(+), 8 deletions(-) create mode 100644 0001-Allow-specifing-KWALLETD_BIN_PATH-manually.patch create mode 100644 0002-Use-GNUInstallDirs-instead-of-KDEInstallDirs.patch diff --git a/0001-Allow-specifing-KWALLETD_BIN_PATH-manually.patch b/0001-Allow-specifing-KWALLETD_BIN_PATH-manually.patch new file mode 100644 index 0000000..7709642 --- /dev/null +++ b/0001-Allow-specifing-KWALLETD_BIN_PATH-manually.patch @@ -0,0 +1,32 @@ +From 9be236e39ef3ac75772066ecc60cab2ca6f54e5c Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Thu, 14 Mar 2024 19:29:48 +0100 +Subject: [PATCH 1/2] Allow specifing KWALLETD_BIN_PATH manually + +That way the dependency on KF6::Wallet can be avoided. +--- + CMakeLists.txt | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4f10b4f..643270e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,9 +43,12 @@ set(pam_kwallet_SRCS + pam_kwallet.c + ) + +-find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS ++if (NOT KWALLETD_BIN_PATH) ++ message (STATUS "KWALLETD_BIN_PATH not set, trying KF6::Wallet") ++ find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS + Wallet +-) ++ ) ++endif () + + add_definitions(-DKWALLETD_BIN_PATH="${KWALLETD_BIN_PATH}") + +-- +2.43.0 + diff --git a/0002-Use-GNUInstallDirs-instead-of-KDEInstallDirs.patch b/0002-Use-GNUInstallDirs-instead-of-KDEInstallDirs.patch new file mode 100644 index 0000000..def0bad --- /dev/null +++ b/0002-Use-GNUInstallDirs-instead-of-KDEInstallDirs.patch @@ -0,0 +1,44 @@ +From ca7f4d4ee95f37d9de9d80b5bba7407e0d11c59a Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Thu, 14 Mar 2024 19:37:30 +0100 +Subject: [PATCH 2/2] Use GNUInstallDirs instead of KDEInstallDirs + +This installs rather generic files so it's not necessary to query Qt here. +--- + CMakeLists.txt | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 643270e..e94130b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,7 +12,7 @@ find_package (ECM ${KF6_MIN_VERSION} REQUIRED NO_MODULE) + set (CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ) + + include(CheckFunctionExists) +-include(KDEInstallDirs) ++include(GNUInstallDirs) + include(KDEClangFormat) + include(ECMConfiguredInstall) + +@@ -90,13 +90,11 @@ target_link_libraries (${library_name} + file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h) + kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) + +-install(TARGETS ${library_name} DESTINATION ${KDE_INSTALL_LIBDIR}/security) ++install(TARGETS ${library_name} DESTINATION ${CMAKE_INSTALL_LIBDIR}/security) + + configure_file(pam_kwallet_init.desktop.cmake ${CMAKE_BINARY_DIR}/pam_kwallet_init.desktop) +- +-install(PROGRAMS pam_kwallet_init DESTINATION ${KDE_INSTALL_LIBEXECDIR}) +- +-install(FILES ${CMAKE_BINARY_DIR}/pam_kwallet_init.desktop DESTINATION ${KDE_INSTALL_AUTOSTARTDIR}) ++install(PROGRAMS pam_kwallet_init DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) ++install(FILES ${CMAKE_BINARY_DIR}/pam_kwallet_init.desktop DESTINATION /etc/xdg/autostart/) + + ecm_install_configured_files(INPUT plasma-kwallet-pam.service.in @ONLY DESTINATION +- ${KDE_INSTALL_SYSTEMDUSERUNITDIR}) ++ ${CMAKE_INSTALL_PREFIX}/lib/systemd/user/) +-- +2.43.0 + diff --git a/pam_kwallet6.changes b/pam_kwallet6.changes index 9672e91..5df4d85 100644 --- a/pam_kwallet6.changes +++ b/pam_kwallet6.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Thu Mar 14 22:28:42 UTC 2024 - Fabian Vogt + +- Also attempt pam-config enablement in %posttrans (boo#1221371) + +------------------------------------------------------------------- +Thu Mar 14 18:59:17 UTC 2024 - Fabian Vogt + +- Add patches to avoid depending on Qt: + * 0001-Allow-specifing-KWALLETD_BIN_PATH-manually.patch + * 0002-Use-GNUInstallDirs-instead-of-KDEInstallDirs.patch + ------------------------------------------------------------------- Wed Mar 13 09:10:02 UTC 2024 - Fabian Vogt diff --git a/pam_kwallet6.spec b/pam_kwallet6.spec index c44653b..0483481 100644 --- a/pam_kwallet6.spec +++ b/pam_kwallet6.spec @@ -34,11 +34,13 @@ Source1: https://download.kde.org/stable/plasma/%{version}/%{rname}-%{ver Source2: plasma.keyring %endif Source3: baselibs.conf +# PATCH-FEATURE-OPENSUSE +Patch1: 0001-Allow-specifing-KWALLETD_BIN_PATH-manually.patch +Patch2: 0002-Use-GNUInstallDirs-instead-of-KDEInstallDirs.patch BuildRequires: kf6-extra-cmake-modules >= %{kf6_version} BuildRequires: pam-devel BuildRequires: pkgconfig BuildRequires: socat -BuildRequires: cmake(KF6Wallet) >= %{kf6_version} BuildRequires: pkgconfig(libgcrypt) >= 1.5.0 # PAM modules need to be available for all archs of PAM on the system, otherwise pam-config # will not enable it. @@ -49,9 +51,9 @@ Requires: pam_kwallet6-common = %{version} Requires(post): coreutils Requires(post): pam Requires(post): pam-config -Requires(postun):coreutils -Requires(postun):pam -Requires(postun):pam-config +Requires(postun): coreutils +Requires(postun): pam +Requires(postun): pam-config Provides: pam_kwallet = %{version} Obsoletes: pam_kwallet < %{version} @@ -76,9 +78,10 @@ module. %build # Before usrmerge, the PAM module goes into /lib*/security/ -%cmake_kf6 \ +%cmake_kf6 -DKWALLETD_BIN_PATH=%{_kf6_bindir}/kwalletd6 \ + -DCMAKE_INSTALL_LIBEXECDIR=%{_libexecdir} \ %if 0%{?suse_version} < 1550 - -DKDE_INSTALL_LIBDIR=/%{_lib} + -DCMAKE_INSTALL_LIBDIR=/%{_lib} %endif %kf6_build @@ -86,8 +89,9 @@ module. %install %kf6_install -# Due to boo#728586 it is necessary to duplicate this in the 32bit variant. -# So you need to edit baselibs.conf if you change this. +# Try to enable it in %post already, but it might not work at this time. +# Due to boo#728586 it is necessary to duplicate this in the 32bit variant, +# so you need to edit baselibs.conf if you change this. %post %{_sbindir}/pam-config -a --kwallet5 || : @@ -96,6 +100,11 @@ if [ "$1" = "0" ]; then %{_sbindir}/pam-config -d --kwallet5 || : fi +# Enable this in posttrans to win over the old package's %postun +# and to run once the modules are installed for all archs (boo#728586). +%posttrans +%{_sbindir}/pam-config -a --kwallet5 || : + %post common %{systemd_user_post plasma-kwallet-pam.service}