summaryrefslogtreecommitdiff
path: root/rules
blob: 211ff04bf7f387b9e1781d484afc2cfe80cdc1e3 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/usr/bin/make -f
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independant
# package.

DH_COMPAT = 3
export DH_COMPAT

BUILD_TREE=Linux-PAM

d = $(shell pwd)/debian
dl = $(d)/local
i = install -p -m 0644
ie = install -p -m 0755

#version=${shell expr `pwd` : '.*-\([0-9.]*\)'}
#version_major=${shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*'}

build:   build-stamp
build-stamp: configure-stamp
	dh_testdir

	# Make libpam.so for linking the modules
	$(MAKE) -C $(BUILD_TREE) bootstrap-libpam
	# Compile everything else
	$(MAKE) -C $(BUILD_TREE) \

	touch build-stamp

configure: configure-stamp

configure-stamp:
	(cd $(BUILD_TREE) && \
	sh configure --sysconfdir=/etc --prefix=/usr --enable-static-libpam \
	--mandir=/usr/share/man --infodir=/usr/share/info --enable-securedir=/lib/security \
	--sbindir=/sbin)
	touch configure-stamp


clean:
	dh_testdir
	dh_testroot
	-$(MAKE) -C $(BUILD_TREE) distclean
	rm -f build-stamp configure-stamp
	dh_clean

# Build architecture-independent files here.
binary-indep: build $(dh_mak_deps)
	dh_testdir -i
	dh_testroot -i
	dh_clean -i -k
	dh_installdirs -i

	$(MAKE) -C $(BUILD_TREE) DIRS=doc

	cd $(BUILD_TREE)/doc && ( \
		$(i) *.sgml $(d)/$(pdoc)/usr/share/doc/$(pdoc)/sgml ; \
		$(i) ps/*.ps $(d)/$(pdoc)/usr/share/doc/$(pdoc)/ps ; \
		$(i) html/*.html $(d)/$(pdoc)/usr/share/doc/$(pdoc)/html ; \
		$(i) txts/*.txt $(d)/$(pdoc)/usr/share/doc/$(pdoc)/txt ; \
		$(i) modules/*.sgml $(d)/$(pdoc)/usr/share/doc/$(pdoc)/sgml/modules )

	$(i) $(dl)/pam-*-guide $(d)/$(pdoc)/usr/share/doc-base/

	dh_installdocs -i
	dh_installchangelogs -i $(BUILD_TREE)/CHANGELOG
	dh_compress -i -X.html
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build module_check $(dh_mak_deps)
	dh_testdir -a
	dh_testroot -a
	dh_clean -a -k
	dh_installdirs -a

	$(MAKE) install -C $(BUILD_TREE) FAKEROOT=$(d)/tmp \
		DIRS="libpam libpam_misc modules libpamc"
	$(i) $(dl)/pam.conf $(d)/tmp/etc
	$(i) $(dl)/other $(d)/tmp/etc/pam.d
	$(i) $(dl)/unix_chkpwd.8 $(d)/libpam-modules/usr/share/man/man8
	dh_movefiles -plibpam-runtime -plibpam0g-dev -plibpam-cracklib
	dh_movefiles -plibpam-modules `cd $(d)/tmp && ls lib/security/*`

	dh_installman -plibpam-runtime $(BUILD_TREE)/doc/man/*.[578]
	dh_installman -plibpam0g-dev $(BUILD_TREE)/doc/man/*.3
	dh_installman -plibpam-runtime $(dl)/pam-undocumented.7

	rmdir --ignore-fail-on-non-empty -p \
		$(d)/tmp/usr/{include/security,share/man/man?,sbin,lib} \
		$(d)/tmp/{sbin,etc/{pam.d,security},lib/security}

	dh_installdocs -a $(BUILD_TREE)/README
	$(i) $(dl)/Debian-PAM-MiniPolicy $(d)/tmp/usr/share/doc/libpam0g
	dh_installexamples -a
	dh_installcron -a
	for func in pam_set_item pam_get_item pam_acct_mgmt \
	    pam_putenv pam_getenv misc_conv pam_misc_paste_env \
	    pam_misc_copy_env pam_misc_drop_env pam_misc_setenv ; do \
		ln -s ../man7/pam-undocumented.7.gz \
		      $(d)/libpam0g-dev/usr/share/man/man3/$$func.3.gz ; \
	done

	dh_installchangelogs -a $(BUILD_TREE)/CHANGELOG
	dh_undocumented -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -Xunix_chkpwd -a
	dh_installdeb -a
	dh_makeshlibs -plibpam0g -V "libpam0g (>= 0.72-1)"
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

module_check:
	for module in `ls build-tree/Linux-PAM-*/modules/pam_*/pam_*.so`; \
	do \
		test=`ldd $$module | grep libpam.so.0`; \
		if [ "x$$test" = "x" ]; then \
			echo $$module is not linked to libpam; \
			exit 1; \
		fi; \
	done

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary