Skip to content

Commit

Permalink
Clean up PAM build/install rules; move to pam-redhat
Browse files Browse the repository at this point in the history
The build system was inconsistent in its handling of pam files.  The
multistack files had names ending in .pam, which we copied to an
unsuffixed file, and installed via pam_DATA.  The non-multistack files
had unsuffixed filenames in the source, which we installed manually
via install-data-local.

Let's clean this up by naming every file with ".pam", and do the
rename when we put them in the install root.  This is faster and
requires less makefile boilerplate to copy the files during the build
process.

Note: This also drops the previous crappy implementation of a
configuration management scheme where we only installed the files if
they didn't already exist.  I'm not aware of anyone who actually uses
'make install' for gdm and cares about that semantic.

Finally, because all of these pam files are Red Hat specific, move
them to a separate pam-redhat directory, to ease the addition of a
future patch which adds PAM files for different systems.

https://bugzilla.gnome.org/show_bug.cgi?id=675085
  • Loading branch information
cgwalters committed Jul 10, 2012
1 parent a325fcb commit f42e685
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 35 deletions.
50 changes: 15 additions & 35 deletions data/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
NULL =
EXTRA_DIST =

SUBDIRS = \
applications \
Expand Down Expand Up @@ -88,32 +89,23 @@ localealias_DATA = locale.alias
sessiondir = $(datadir)/gnome-session/sessions
session_DATA = gdm-fallback.session gdm-shell.session

gdm-password: gdm-password.pam
cp $(srcdir)/gdm-password.pam $(builddir)/gdm-password

gdm-fingerprint: gdm-fingerprint.pam
cp $(srcdir)/gdm-fingerprint.pam $(builddir)/gdm-fingerprint

gdm-smartcard: gdm-smartcard.pam
cp $(srcdir)/gdm-smartcard.pam $(builddir)/gdm-smartcard

pamdir = $(PAM_PREFIX)/pam.d
pam_DATA = gdm-fingerprint gdm-smartcard gdm-password
pam_redhat_files = pam-redhat/gdm.pam \
pam-redhat/gdm-autologin.pam \
pam-redhat/gdm-welcome.pam \
pam-redhat/gdm-fingerprint.pam \
pam-redhat/gdm-smartcard.pam \
pam-redhat/gdm-password.pam \
$(NULL)
EXTRA_DIST += $(pam_redhat_files)

EXTRA_DIST = \
EXTRA_DIST += \
$(schemas_in_files) \
$(schemas_DATA) \
$(dbusconf_in_files) \
$(localealias_DATA) \
gdm.schemas.in.in \
gdm.conf-custom.in \
Xsession.in \
gdm \
gdm-autologin \
gdm-welcome \
gdm-password.pam \
gdm-fingerprint.pam \
gdm-smartcard.pam \
gdm-fallback.session \
Init.in \
PreSession.in \
Expand All @@ -133,9 +125,6 @@ CLEANFILES = \
PreSession \
PostSession \
$(gsettings_SCHEMAS) \
gdm-password \
gdm-fingerprint \
gdm-smartcard \
$(NULL)

DISTCLEANFILES = \
Expand All @@ -146,9 +135,6 @@ DISTCLEANFILES = \

MAINTAINERCLEANFILES = \
*~ \
gdm-password \
gdm-fingerprint \
gdm-smartcard \
Makefile.in

uninstall-hook:
Expand All @@ -159,9 +145,6 @@ uninstall-hook:
$(DESTDIR)$(postlogindir)/Default.sample \
$(DESTDIR)$(predir)/Default \
$(DESTDIR)$(postdir)/Default \
$(DESTDIR)$(PAM_PREFIX)/pam.d/gdm \
$(DESTDIR)$(PAM_PREFIX)/pam.d/gdm-autologin \
$(DESTDIR)$(PAM_PREFIX)/pam.d/gdm-welcome \
$(DESTDIR)$(sysconfdir)/dconf/db/gdm \
$(DESTDIR)$(sysconfdir)/dconf/profile/gdm \
-rf \
Expand Down Expand Up @@ -239,14 +222,11 @@ install-data-hook: gdm.conf-custom Xsession Init PostSession PreSession 00-upstr
$(mkinstalldirs) $(DESTDIR)$(PAM_PREFIX)/pam.d; \
chmod 755 $(DESTDIR)$(PAM_PREFIX)/pam.d; \
fi; \
if test $$system = Linux && test '!' -f $(DESTDIR)$(PAM_PREFIX)/pam.d/gdm; then \
$(INSTALL_DATA) $(srcdir)/gdm $(DESTDIR)$(PAM_PREFIX)/pam.d/gdm; \
fi; \
if test $$system = Linux && test '!' -f $(DESTDIR)$(PAM_PREFIX)/pam.d/gdm-autologin; then \
$(INSTALL_DATA) $(srcdir)/gdm-autologin $(DESTDIR)$(PAM_PREFIX)/pam.d/gdm-autologin; \
fi; \
if test $$system = Linux && test '!' -f $(DESTDIR)$(PAM_PREFIX)/pam.d/gdm-welcome; then \
$(INSTALL_DATA) $(srcdir)/gdm-welcome $(DESTDIR)$(PAM_PREFIX)/pam.d/gdm-welcome; \
if test $$system = Linux; then \
for pamfile in $(pam_redhat_files); do \
bn=$$(basename $$pamfile .pam); \
$(INSTALL_DATA) $(srcdir)/$$pamfile $(DESTDIR)$(PAM_PREFIX)/pam.d/$$bn; \
done; \
fi; \
if test $$system = SunOS; then \
echo "Please add PAM authentication for gdm, gdm-autologin and gdm-welcome in $(PAM_PREFIX)/pam.conf!"; \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f42e685

Please sign in to comment.