From f43ce7b48caf0f39afe3ffaf1eda5eb58fdc8997 Mon Sep 17 00:00:00 2001 From: Arvin Schnell Date: Wed, 16 Jun 2021 13:02:55 +0200 Subject: [PATCH] - added configure option for location of PAM module --- configure.ac | 6 ++++++ dists/debian/rules | 3 ++- package/snapper.changes | 6 ++++++ pam/Makefile.am | 4 ++-- snapper.spec.in | 18 +++++++++++++----- 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 7d195e17a..3f5c91125 100644 --- a/configure.ac +++ b/configure.ac @@ -82,6 +82,11 @@ AS_IF([test "x$with_conf" != xno], [SYSCONFIG="${with_conf}"]) CPPFLAGS="${CPPFLAGS} -DCONF_DIR='\"${SYSCONFIG}\"'" +PAM_SECURITY=${libdir}/security + +AC_ARG_WITH([pam-security], AC_HELP_STRING([--pam-security], [Use a custom pam security directory (default is $libdir/security)]), + [with_pam_security=$withval], [with_pam_security=no]) +AS_IF([test "x$with_pam_security" != xno], [PAM_SECURITY="${with_pam_security}"]) AC_ARG_ENABLE([btrfs], AC_HELP_STRING([--disable-btrfs],[Disable Btrfs internal snapshots support]), [with_btrfs=$enableval],[with_btrfs=yes]) @@ -200,6 +205,7 @@ AC_SUBST(LIBVERSION_MINOR) AC_SUBST(LIBVERSION_PATCHLEVEL) AC_SUBST(LIBVERSION_INFO) AC_SUBST(SYSCONFIG) +AC_SUBST(PAM_SECURITY) AC_SUBST(docdir) AC_OUTPUT( diff --git a/dists/debian/rules b/dists/debian/rules index 2ba23fe19..8b3f08436 100644 --- a/dists/debian/rules +++ b/dists/debian/rules @@ -16,7 +16,8 @@ endif override_dh_auto_configure: dh_auto_configure -- --docdir=/usr/share/doc/packages/snapper --disable-silent-rules \ - --disable-ext4 --enable-xattrs --disable-rollback --disable-btrfs-quota + --disable-ext4 --enable-xattrs --disable-rollback --disable-btrfs-quota \ + --with-pam-security=/lib/security override_dh_auto_install: dh_auto_install diff --git a/package/snapper.changes b/package/snapper.changes index 2745e1081..62712fff4 100644 --- a/package/snapper.changes +++ b/package/snapper.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jun 16 11:50:49 CEST 2021 - aschnell@suse.com + +- added configure option for location of PAM module + (gh#openSUSE/snapper#659) + ------------------------------------------------------------------- Mon May 17 08:39:58 CEST 2021 - aschnell@suse.com diff --git a/pam/Makefile.am b/pam/Makefile.am index befccf858..b1b96f244 100644 --- a/pam/Makefile.am +++ b/pam/Makefile.am @@ -8,9 +8,9 @@ AM_CFLAGS = -D_GNU_SOURCE -Wwrite-strings AM_CPPFLAGS = -I$(top_srcdir) $(DBUS_CFLAGS) -securelibdir = $(shell echo /`basename $(libdir)`/security) +pam_security_libdir = @PAM_SECURITY@ -securelib_LTLIBRARIES = pam_snapper.la +pam_security_lib_LTLIBRARIES = pam_snapper.la pam_snapper_la_LDFLAGS = -no-undefined -avoid-version -module pam_snapper_la_LIBADD = -lpam $(DBUS_LIBS) diff --git a/snapper.spec.in b/snapper.spec.in index 2bc500558..5ab0d7e1c 100644 --- a/snapper.spec.in +++ b/snapper.spec.in @@ -16,12 +16,19 @@ # -#Compat macro for new _fillupdir macro introduced in Nov 2017 +# Compat macro for new _fillupdir macro introduced in Nov 2017 %if ! %{defined _fillupdir} %define _fillupdir /var/adm/fillup-templates %endif -# optionally build with test coverage reporting +# Location for PAM module +%if 0%{?usrmerged} +%define pam_security_dir %{_libdir}/security +%else +%define pam_security_dir /%{_lib}/security +%endif + +# Optionally build with test coverage reporting %bcond_with coverage Name: snapper @@ -117,10 +124,11 @@ export CXXFLAGS="%{optflags} -DNDEBUG" autoreconf -fvi %configure \ - --docdir="%{_defaultdocdir}/snapper" \ + --docdir="%{_defaultdocdir}/snapper" \ %if %{with coverage} --enable-coverage \ %endif + --with-pam-security="%{pam_security_dir}" \ %if 0%{?suse_version} <= 1310 --disable-rollback \ %endif @@ -132,7 +140,7 @@ make %{?_smp_mflags} %install %make_install -rm -f "%{buildroot}/%{_libdir}"/*.la "%{buildroot}/%{_lib}/security/pam_snapper.la" +rm -f "%{buildroot}/%{_libdir}"/*.la "%{buildroot}/%{pam_security_dir}/pam_snapper.la" rm -f %{buildroot}/etc/cron.hourly/suse.de-snapper rm -f %{buildroot}/etc/cron.daily/suse.de-snapper @@ -301,7 +309,7 @@ A PAM module for calling snapper during user login and logout. %files -n pam_snapper %defattr(-,root,root) -/%{_lib}/security/pam_snapper.so +/%{pam_security_dir}/pam_snapper.so %dir /usr/lib/pam_snapper /usr/lib/pam_snapper/*.sh %doc %{_mandir}/*/pam_snapper.8*