Skip to content

Commit

Permalink
- added configure option for location of PAM module
Browse files Browse the repository at this point in the history
  • Loading branch information
aschnell committed Jun 16, 2021
1 parent bc8c147 commit f43ce7b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
6 changes: 6 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion dists/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions package/snapper.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jun 16 11:50:49 CEST 2021 - [email protected]

- added configure option for location of PAM module
(gh#openSUSE/snapper#659)

-------------------------------------------------------------------
Mon May 17 08:39:58 CEST 2021 - [email protected]

Expand Down
4 changes: 2 additions & 2 deletions pam/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 13 additions & 5 deletions snapper.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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*
Expand Down

0 comments on commit f43ce7b

Please sign in to comment.