[22685] | 1 | #!/usr/bin/make -f |
---|
| 2 | |
---|
| 3 | pam_types = account auth session password |
---|
| 4 | pam_krb5_auth_opts = use_authtok |
---|
| 5 | pam_krb5_passwd_opts = use_authtok |
---|
| 6 | |
---|
[22875] | 7 | DEB_DIVERT_EXTENSION = .debathena |
---|
| 8 | |
---|
[23230] | 9 | pam_auth_update = $(shell hash pam-auth-update 2>/dev/null && echo yes) |
---|
| 10 | |
---|
[24179] | 11 | KRB5_VERSION = $(shell dpkg-query -W -f '$${Version}' krb5-clients) |
---|
| 12 | HAVE_KRB4 = $(shell dpkg --compare-versions $(KRB5_VERSION) '<<' '1.7~' && echo y) |
---|
| 13 | |
---|
[23230] | 14 | ifeq ($(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 |
---|
| 24 | endif |
---|
| 25 | |
---|
[25730] | 26 | ifneq ($(wildcard /etc/pam.d/gdm3),) |
---|
| 27 | PAM_GDM = /etc/pam.d/gdm3.debathena |
---|
| 28 | DEB_TRANSFORM_SCRIPT_$(PAM_GDM) = debian/transform_gdm.debathena |
---|
| 29 | else |
---|
| 30 | PAM_GDM = /etc/pam.d/gdm.debathena |
---|
| 31 | endif |
---|
| 32 | |
---|
[22882] | 33 | ifneq ($(wildcard /etc/pam.d/sshd),) |
---|
| 34 | PAM_SSHD = /etc/pam.d/sshd.debathena |
---|
| 35 | DEB_TRANSFORM_SCRIPT_$(PAM_SSHD) = debian/transform_ssh.debathena |
---|
| 36 | else |
---|
| 37 | PAM_SSHD = /etc/pam.d/ssh.debathena |
---|
| 38 | endif |
---|
| 39 | |
---|
[22922] | 40 | DEB_TRANSFORM_FILES_debathena-pam-config += \ |
---|
[25730] | 41 | $(PAM_GDM) \ |
---|
[22882] | 42 | $(PAM_SSHD) \ |
---|
[22875] | 43 | /etc/pam.d/login.debathena |
---|
| 44 | |
---|
| 45 | DEB_DIVERT_FILES_debathena-pam-config += \ |
---|
[22685] | 46 | /etc/security/access.conf.debathena |
---|
[22875] | 47 | |
---|
[24065] | 48 | DEB_REMOVE_FILES_debathena-pam-config += \ |
---|
[24885] | 49 | /usr/share/pam-configs/krb5 \ |
---|
[24887] | 50 | /usr/share/pam-configs/afs-session |
---|
[24065] | 51 | |
---|
[22685] | 52 | include /usr/share/cdbs/1/rules/debhelper.mk |
---|
[22922] | 53 | include /usr/share/cdbs/1/rules/config-package.mk |
---|
[22685] | 54 | |
---|
[24465] | 55 | DEB_INSTALL_DOCS_debathena-pam-config = debian/README.pam-afs-session |
---|
| 56 | |
---|
[23230] | 57 | ifneq ($(pam_auth_update),) |
---|
| 58 | install/debathena-pam-config:: |
---|
| 59 | install -D -m 644 debian/athena-session-tmpdir-mktemp.pam-config \ |
---|
| 60 | $(DEB_DESTDIR)/usr/share/pam-configs/athena-session-tmpdir-mktemp |
---|
[25594] | 61 | install -D -m 644 debian/xdg-cache-home-mktemp.pam-config \ |
---|
| 62 | $(DEB_DESTDIR)/usr/share/pam-configs/xdg-cache-home-mktemp |
---|
[24065] | 63 | install -D -m 644 debian/libpam-krb5.pam-config \ |
---|
| 64 | $(DEB_DESTDIR)/usr/share/pam-configs/krb5.debathena |
---|
[24443] | 65 | install -D -m 644 debian/libpam-afs-session.pam-config \ |
---|
[24888] | 66 | $(DEB_DESTDIR)/usr/share/pam-configs/afs-session.debathena |
---|
[23230] | 67 | debathena-pam-config-substvars: |
---|
| 68 | ( \ |
---|
| 69 | echo -n "debathena-pam-config-depends="; \ |
---|
| 70 | echo -n "libpam-runtime (>= 1.0.1-4ubuntu1),"; \ |
---|
[24065] | 71 | echo -n "libpam-krb5,"; \ |
---|
[24179] | 72 | if [ "$(HAVE_KRB4)" = "y" ]; then \ |
---|
| 73 | echo -n "libpam-krb524 (>= 1.3-0debathena3~),"; \ |
---|
| 74 | fi; \ |
---|
[24443] | 75 | echo -n "libpam-afs-session,"; \ |
---|
[23233] | 76 | echo -n "libpam-debathena-home-type (>= 1.1-0debathena2~),"; \ |
---|
[23686] | 77 | echo \ |
---|
[23230] | 78 | ) >>debian/debathena-pam-config.substvars |
---|
| 79 | else |
---|
| 80 | debathena-pam-config-substvars: |
---|
| 81 | ( \ |
---|
| 82 | echo -n "debathena-pam-config-depends="; \ |
---|
| 83 | echo -n "libpam-krb5,"; \ |
---|
[24179] | 84 | if [ "$(HAVE_KRB4)" = "y" ]; then \ |
---|
| 85 | echo -n "libpam-krb524,"; \ |
---|
| 86 | fi; \ |
---|
[24443] | 87 | echo -n "libpam-afs-session,"; \ |
---|
[23230] | 88 | echo -n "libpam-debathena-home-type,"; \ |
---|
[23686] | 89 | echo \ |
---|
[23230] | 90 | ) >>debian/debathena-pam-config.substvars |
---|
| 91 | endif |
---|
| 92 | |
---|
| 93 | binary-predeb/debathena-pam-config:: debathena-pam-config-substvars |
---|
| 94 | |
---|
[22882] | 95 | ifneq ($(wildcard /etc/pam.d/sshd),) |
---|
| 96 | debian-divert/debathena-pam-config:: |
---|
[23641] | 97 | (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"; \ |
---|
[22882] | 98 | echo " undivert_unlink /etc/pam.d/ssh"; \ |
---|
| 99 | echo "fi") >> $(CURDIR)/debian/$(cdbs_curpkg).postinst.debhelper |
---|
| 100 | endif |
---|
| 101 | |
---|
[22875] | 102 | common-build-indep:: debian/access.conf.debathena |
---|
[22685] | 103 | |
---|
[22761] | 104 | LSB_ID = $(shell lsb_release --short --id) |
---|
[22875] | 105 | debian/access.conf.debathena: $(call debian_check_files,/etc/security/access.conf) |
---|
[22761] | 106 | ifeq ($(LSB_ID), Debian) |
---|
| 107 | (cat $<; sed 's/root admin /root /' debian/access.conf.append) > $@ |
---|
| 108 | else |
---|
| 109 | ifeq ($(LSB_ID), Ubuntu) |
---|
[22685] | 110 | cat $< debian/access.conf.append > $@ |
---|
[22761] | 111 | else |
---|
| 112 | $(error Unrecognized distribution ID $(LSB_ID).) |
---|
| 113 | endif |
---|
| 114 | endif |
---|
[22685] | 115 | |
---|
| 116 | clean:: |
---|
[22875] | 117 | rm -f debian/access.conf.debathena |
---|