source: trunk/debathena/config/pam-config/debian/rules @ 24465

Revision 24465, 3.6 KB checked in by broder, 14 years ago (diff)
Add a detailed note about why pam-afs-session isn't being used as an auth module.
  • Property svn:executable set to *
Line 
1#!/usr/bin/make -f
2
3pam_types = account auth session password
4pam_krb5_auth_opts = use_authtok
5pam_krb5_passwd_opts = use_authtok
6
7DEB_DIVERT_EXTENSION = .debathena
8
9pam_auth_update = $(shell hash pam-auth-update 2>/dev/null && echo yes)
10
11KRB5_VERSION = $(shell dpkg-query -W -f '$${Version}' krb5-clients)
12HAVE_KRB4 = $(shell dpkg --compare-versions $(KRB5_VERSION) '<<' '1.7~' && echo y)
13
14ifeq ($(pam_auth_update),)
15    DEB_TRANSFORM_FILES_debathena-pam-config += \
16        $(patsubst %,/etc/pam.d/common-%.debathena,$(pam_types))
17
18    ifneq ($(wildcard /usr/share/pam/common-auth),)
19        DEB_CHECK_FILES_SOURCE_/etc/pam.d/common-auth.debathena = /usr/share/pam/common-auth
20        DEB_CHECK_FILES_SOURCE_/etc/pam.d/common-session.debathena = /usr/share/pam/common-session
21        DEB_CHECK_FILES_SOURCE_/etc/pam.d/common-account.debathena = /usr/share/pam/common-account
22        DEB_CHECK_FILES_SOURCE_/etc/pam.d/common-password.debathena = /usr/share/pam/common-password
23    endif
24endif
25
26ifneq ($(wildcard /etc/pam.d/sshd),)
27    PAM_SSHD = /etc/pam.d/sshd.debathena
28    DEB_TRANSFORM_SCRIPT_$(PAM_SSHD) = debian/transform_ssh.debathena
29else
30    PAM_SSHD = /etc/pam.d/ssh.debathena
31endif
32
33DEB_TRANSFORM_FILES_debathena-pam-config += \
34        /etc/pam.d/gdm.debathena \
35        $(PAM_SSHD) \
36        /etc/pam.d/login.debathena
37
38DEB_DIVERT_FILES_debathena-pam-config += \
39        /etc/security/access.conf.debathena
40
41DEB_REMOVE_FILES_debathena-pam-config += \
42        /usr/share/pam-configs/krb5
43
44include /usr/share/cdbs/1/rules/debhelper.mk
45include /usr/share/cdbs/1/rules/config-package.mk
46
47DEB_INSTALL_DOCS_debathena-pam-config = debian/README.pam-afs-session
48
49ifneq ($(pam_auth_update),)
50install/debathena-pam-config::
51        install -D -m 644 debian/athena-session-tmpdir-mktemp.pam-config \
52          $(DEB_DESTDIR)/usr/share/pam-configs/athena-session-tmpdir-mktemp
53        install -D -m 644 debian/libpam-krb5.pam-config \
54          $(DEB_DESTDIR)/usr/share/pam-configs/krb5.debathena
55        install -D -m 644 debian/libpam-afs-session.pam-config \
56          $(DEB_DESTDIR)/usr/share/pam-configs/afs-session
57debathena-pam-config-substvars:
58        ( \
59          echo -n "debathena-pam-config-depends="; \
60          echo -n "libpam-runtime (>= 1.0.1-4ubuntu1),"; \
61          echo -n "libpam-krb5,"; \
62          if [ "$(HAVE_KRB4)" = "y" ]; then \
63            echo -n "libpam-krb524 (>= 1.3-0debathena3~),"; \
64          fi; \
65          echo -n "libpam-afs-session,"; \
66          echo -n "libpam-debathena-home-type (>= 1.1-0debathena2~),"; \
67          echo \
68        ) >>debian/debathena-pam-config.substvars
69else
70debathena-pam-config-substvars:
71        ( \
72          echo -n "debathena-pam-config-depends="; \
73          echo -n "libpam-krb5,"; \
74          if [ "$(HAVE_KRB4)" = "y" ]; then \
75            echo -n "libpam-krb524,"; \
76          fi; \
77          echo -n "libpam-afs-session,"; \
78          echo -n "libpam-debathena-home-type,"; \
79          echo \
80        ) >>debian/debathena-pam-config.substvars
81endif
82
83binary-predeb/debathena-pam-config:: debathena-pam-config-substvars
84
85ifneq ($(wildcard /etc/pam.d/sshd),)
86debian-divert/debathena-pam-config::
87        (echo "if [ \"\$$1\" = configure ] && dpkg-divert --list /etc/pam.d/ssh | grep -xFq 'diversion of /etc/pam.d/ssh to /etc/pam.d/ssh.debathena-orig by $(cdbs_curpkg)'; then"; \
88        echo "    undivert_unlink /etc/pam.d/ssh"; \
89        echo "fi") >> $(CURDIR)/debian/$(cdbs_curpkg).postinst.debhelper
90endif
91
92common-build-indep:: debian/access.conf.debathena
93
94LSB_ID = $(shell lsb_release --short --id)
95debian/access.conf.debathena: $(call debian_check_files,/etc/security/access.conf)
96ifeq ($(LSB_ID), Debian)
97        (cat $<; sed 's/root admin /root /' debian/access.conf.append) > $@
98else
99    ifeq ($(LSB_ID), Ubuntu)
100        cat $< debian/access.conf.append > $@
101    else
102        $(error Unrecognized distribution ID $(LSB_ID).)
103    endif
104endif
105
106clean::
107        rm -f debian/access.conf.debathena
Note: See TracBrowser for help on using the repository browser.