#!/usr/bin/make -f pam_types = account auth session password pam_krb5_auth_opts = use_authtok pam_krb5_passwd_opts = use_authtok DEB_DIVERT_EXTENSION = .debathena pam_auth_update = $(shell hash pam-auth-update 2>/dev/null && echo yes) KRB5_VERSION = $(shell dpkg-query -W -f '$${Version}' krb5-clients) HAVE_KRB4 = $(shell dpkg --compare-versions $(KRB5_VERSION) '<<' '1.7~' && echo y) ifeq ($(pam_auth_update),) DEB_TRANSFORM_FILES_debathena-pam-config += \ $(patsubst %,/etc/pam.d/common-%.debathena,$(pam_types)) ifneq ($(wildcard /usr/share/pam/common-auth),) DEB_CHECK_FILES_SOURCE_/etc/pam.d/common-auth.debathena = /usr/share/pam/common-auth DEB_CHECK_FILES_SOURCE_/etc/pam.d/common-session.debathena = /usr/share/pam/common-session DEB_CHECK_FILES_SOURCE_/etc/pam.d/common-account.debathena = /usr/share/pam/common-account DEB_CHECK_FILES_SOURCE_/etc/pam.d/common-password.debathena = /usr/share/pam/common-password endif endif ifneq ($(wildcard /etc/pam.d/sshd),) PAM_SSHD = /etc/pam.d/sshd.debathena DEB_TRANSFORM_SCRIPT_$(PAM_SSHD) = debian/transform_ssh.debathena else PAM_SSHD = /etc/pam.d/ssh.debathena endif DEB_TRANSFORM_FILES_debathena-pam-config += \ /etc/pam.d/gdm.debathena \ $(PAM_SSHD) \ /etc/pam.d/login.debathena DEB_DIVERT_FILES_debathena-pam-config += \ /etc/security/access.conf.debathena DEB_REMOVE_FILES_debathena-pam-config += \ /usr/share/pam-configs/krb5 include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/rules/config-package.mk DEB_INSTALL_DOCS_debathena-pam-config = debian/README.pam-afs-session ifneq ($(pam_auth_update),) install/debathena-pam-config:: install -D -m 644 debian/athena-session-tmpdir-mktemp.pam-config \ $(DEB_DESTDIR)/usr/share/pam-configs/athena-session-tmpdir-mktemp install -D -m 644 debian/libpam-krb5.pam-config \ $(DEB_DESTDIR)/usr/share/pam-configs/krb5.debathena install -D -m 644 debian/libpam-afs-session.pam-config \ $(DEB_DESTDIR)/usr/share/pam-configs/afs-session debathena-pam-config-substvars: ( \ echo -n "debathena-pam-config-depends="; \ echo -n "libpam-runtime (>= 1.0.1-4ubuntu1),"; \ echo -n "libpam-krb5,"; \ if [ "$(HAVE_KRB4)" = "y" ]; then \ echo -n "libpam-krb524 (>= 1.3-0debathena3~),"; \ fi; \ echo -n "libpam-afs-session,"; \ echo -n "libpam-debathena-home-type (>= 1.1-0debathena2~),"; \ echo \ ) >>debian/debathena-pam-config.substvars else debathena-pam-config-substvars: ( \ echo -n "debathena-pam-config-depends="; \ echo -n "libpam-krb5,"; \ if [ "$(HAVE_KRB4)" = "y" ]; then \ echo -n "libpam-krb524,"; \ fi; \ echo -n "libpam-afs-session,"; \ echo -n "libpam-debathena-home-type,"; \ echo \ ) >>debian/debathena-pam-config.substvars endif binary-predeb/debathena-pam-config:: debathena-pam-config-substvars ifneq ($(wildcard /etc/pam.d/sshd),) debian-divert/debathena-pam-config:: (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"; \ echo " undivert_unlink /etc/pam.d/ssh"; \ echo "fi") >> $(CURDIR)/debian/$(cdbs_curpkg).postinst.debhelper endif common-build-indep:: debian/access.conf.debathena LSB_ID = $(shell lsb_release --short --id) debian/access.conf.debathena: $(call debian_check_files,/etc/security/access.conf) ifeq ($(LSB_ID), Debian) (cat $<; sed 's/root admin /root /' debian/access.conf.append) > $@ else ifeq ($(LSB_ID), Ubuntu) cat $< debian/access.conf.append > $@ else $(error Unrecognized distribution ID $(LSB_ID).) endif endif clean:: rm -f debian/access.conf.debathena