summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 5784bd1f65ece2673431463fd373b6d4dbf5f44f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/make -f

DEB_LDFLAGS_MAINT_APPEND := -Wl,-z,defs
DEB_CFLAGS_MAINT_APPEND  := $(shell getconf LFS_CFLAGS)
export DEB_LDFLAGS_MAINT_APPEND DEB_CFLAGS_MAINT_APPEND

DEB_HOST_MULTIARCH	:= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

LC_COLLATE=C
export LC_COLLATE

export QUILT_PATCH_DIR = debian/patches-applied

d = $(CURDIR)/debian
dl = $(d)/local

%:
	dh $@ --with quilt

override_dh_auto_configure:
	dh_auto_configure -- --enable-static --enable-shared \
		--libdir=/lib/$(DEB_HOST_MULTIARCH) --sbindir=/sbin \
		--enable-isadir=/lib/security --disable-audit

# make sure the SAG, MWG, ADG are readable with a browser.
override_dh_compress:
	dh_compress -Xhtml

# .install files don't have "except for" handling, so we need to exclude
# our module that doesn't match right here
override_dh_install:
	sed -e"s/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g" $(d)/libpam0g-dev.install.in > $(d)/libpam0g-dev.install
ifneq (,$(findstring libpam-modules, $(shell dh_listpackages)))
	dh_install -plibpam-modules -Xpam_cracklib
endif
	dh_install -Nlibpam-modules

# again, excluding files by hand; also, build our local manpage for pam_getenv
# from the XML
override_dh_installman:
	pod2man --section 8 --release="Debian GNU/Linux" $(dl)/pam_getenv >$(dl)/pam_getenv.8
	dh_installman
	rm -f $(d)/libpam-modules/usr/share/man/man5/pam.conf.5
	rm -f $(d)/libpam-modules/usr/share/man/man8/pam_cracklib.8

# dh_link doesn't do wildcards, so we can't auto-link to the right per-arch
# directory
override_dh_link:
	sed -e"s,^/lib,/lib/$(DEB_HOST_MULTIARCH)," $(d)/libpam0g-dev.links.in > $(d)/libpam0g-dev.links
	dh_link

# using perms that differ from upstream (sgid instead of suid) /and/ that
# dh_fixperms doesn't want
override_dh_fixperms:
	dh_fixperms
ifneq (,$(findstring libpam-modules, $(shell dh_listpackages)))
	chgrp shadow $(d)/libpam-modules-bin/sbin/unix_chkpwd
	chmod 02755 $(d)/libpam-modules-bin/sbin/unix_chkpwd
endif