File: rules

package info (click to toggle)
pam 0.72-35
  • links: PTS
  • area: main
  • in suites: woody
  • size: 796 kB
  • ctags: 18
  • sloc: makefile: 174; perl: 74; sh: 17
file content (126 lines) | stat: -rwxr-xr-x 3,659 bytes parent folder | download
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
#!/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.

# DBS rules
TAR_DIR := Linux-PAM-0.72
include debian/scripts/dbs-build.mk

pdoc=libpam-doc

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: $(STAMP_DIR)/build-stamp
$(STAMP_DIR)/build-stamp: $(patched)
	dh_testdir

	cd $(BUILD_TREE) && \
		( ln -sf defs/debian.defs default.defs; \
		  touch .freezemake )
	# Make libpam.so for linking the modules
	$(MAKE) -C $(BUILD_TREE) bootstrap-libpam
	# Compile everything else
	$(MAKE) -C $(BUILD_TREE) \
		DIRS="libpam_misc modules libpam libpamc"

	touch $(STAMP_DIR)/build-stamp

clean:
	dh_testdir
	rm -rf $(STAMP_DIR) $(SOURCE_DIR)
	perl debian/scripts/dh_split clean
	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/other
	$(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