debian swirl logo

Back to the packages list libpam-ldap

#!/usr/bin/make -f

include /usr/share/cdbs/1/class/makefile.mk
DEB_UPSTREAM_VERSION := $(shell echo $(DEB_VERSION) | sed 's/-[^-]*//')
# strip of a optionally added cvs patch (format: upstream+cvs-debian)
DEB_UPSTREAM_TARBALL_VERSION := $(shell echo $(DEB_UPSTREAM_VERSION) | sed 's/+[^+]*//')
DEB_TAR_SRCDIR := pam_ldap-$(DEB_UPSTREAM_TARBALL_VERSION)
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
include /usr/share/cdbs/1/rules/tarball.mk

DEB_DESTDIR = $(CURDIR)/debian/tmp
MY_INSTR_DIR = $(CURDIR)/debian/libpam-ldap
DEB_CONFIGURE_EXTRA_FLAGS += \
		--libdir=/lib/$(DEB_HOST_MULTIARCH) \
		--with-ldap-lib=openldap \
		--with-ldap-conf-file=/etc/pam_ldap.conf \
		--with-ldap-secret-file=/etc/pam_ldap.secret
DEB_OPT_FLAG += -fPIC

# Keep file autoconf list out of the diff
clean::
		rm *.cdbs-config_list

install/libpam-ldap::
		install -D -m 644 debian/libpam-ldap.pam-auth-update debian/tmp/usr/share/pam-configs/ldap

binary-post-install/libpam-ldap::
	# rename man page
		mv $(MY_INSTR_DIR)/usr/share/man/man5/pam_ldap.5 \
			$(MY_INSTR_DIR)/usr/share/man/man5/pam_ldap.conf.5
	# change all references from /etc/ldap.{conf,secret} to /etc/pam_ldap.{conf,secret}
		for file in $(MY_INSTR_DIR)/usr/share/man/man5/pam_ldap.conf.5 \
		            $(MY_INSTR_DIR)/usr/share/libpam-ldap/ldap.conf \
		            $(MY_INSTR_DIR)/usr/share/doc/libpam-ldap/examples/chfn \
		            $(MY_INSTR_DIR)/usr/share/doc/libpam-ldap/examples/chsh ; do \
			sed	-e 's,ldap.conf,pam_ldap.conf,' \
				-e 's,ldap.secret,pam_ldap.secret,' \
				< $$file > $$file-sed; \
			mv $$file-sed $$file; \
		done

Builds:

libpam-ldap
pluggable authentication module for ldap