]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- added configure option for location of PAM module 660/head
authorArvin Schnell <aschnell@suse.de>
Wed, 16 Jun 2021 11:02:55 +0000 (13:02 +0200)
committerArvin Schnell <aschnell@suse.de>
Wed, 16 Jun 2021 11:02:55 +0000 (13:02 +0200)
configure.ac
dists/debian/rules
package/snapper.changes
pam/Makefile.am
snapper.spec.in

index 7d195e17a53af0212144c4d37546bc0a504edf44..3f5c911250f67b4f201c2333e0f5a30aa96ca641 100644 (file)
@@ -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(
index 2ba23fe1920a618214ae09c37a95a50e80cddea7..8b3f08436a59526e124325f9e68e805a214b8fd2 100644 (file)
@@ -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
index 2745e1081c9847635518cd305cb1748ae1a0e451..62712fff40c0560968958b659ebd921943f1c446 100644 (file)
@@ -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
 
index befccf8584b8408a4a6bc3e50508a6ced37665f2..b1b96f244f7def93bd0116fd1118ba7d021666c8 100644 (file)
@@ -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)
index 2bc50055893ca108cc8d9367d79e298846078326..5ab0d7e1caf8d9b7803a6252f7e29591a63103a5 100644 (file)
 #
 
 
-#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*