File: rules

package info (click to toggle)
am-utils 6.0.7-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 7,728 kB
  • ctags: 8,542
  • sloc: ansic: 34,563; sh: 9,665; perl: 2,424; makefile: 776; lex: 454; yacc: 375
file content (175 lines) | stat: -rwxr-xr-x 4,914 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/usr/bin/make -f
# Amd rules files, placed under the GNU General Public License.
# Copyright (C) 2001 Philippe Troin <phil@fifi.org>.
# Based on:
#   Sample debian/rules that uses debhelper.
#   GPL copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode. 
#export DH_VERBOSE=1

# This is the debhelper compatability version to use.
export DH_COMPAT=3

# This has to be exported to make some magic below work.
export DH_OPTIONS

DEBCFLAGS:=-O2
WGET=wget
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
DEBCFLAGS += -g
endif

DEBVERSION:=$(shell head -1 debian/changelog \
	            | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
UPVERSION:=$(shell echo $(DEBVERSION) | sed -e 's/-[0-9.]*$$//')

build: build-stamp
build-stamp:
	dh_testdir

	ln -sf am-utils.copyright debian/am-utils-doc.copyright

	touch config.h.in stamp-h.in stamp-h config.h configure.in aclocal.m4 configure config.status config.h.in $$(find . -name Makefile.in)
	touch doc/*.info doc/stamp-vti doc/version.texi
	CFLAGS="$(DEBCFLAGS)" ./configure --prefix=/usr --enable-shared \
	  --without-ldap --without-hesiod
	$(MAKE)
	$(MAKE) -C doc ps
	mkdir debian/html
	cd debian/html && texi2html -split_chapter ../../doc/am-utils.texi

	touch build-stamp

clean:
	dh_testdir
	rm -f build-stamp 

	-$(MAKE) distclean
	-rm -fr debian/html
	-rm -f debian/am-utils-doc.copyright

	dh_clean

install: DH_OPTIONS=
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) prefix=`pwd`/debian/tmp/usr install
	install -d debian/tmp/usr/share
	mv debian/tmp/usr/man debian/tmp/usr/share/man
	mv debian/tmp/usr/info debian/tmp/usr/share/info
	rm -fr debian/tmp/usr/etc
	install -d debian/tmp/etc/am-utils
	cp debian/amd.conf debian/tmp/etc/am-utils/amd.conf
	rm debian/tmp/usr/sbin/lostaltmail
	rm debian/tmp/usr/bin/expn
	rm debian/tmp/usr/share/man/man1/expn.1
	rm debian/tmp/usr/share/man/man8/automount2amd.8
	rm debian/tmp/usr/sbin/mk-amd-map
	rm debian/tmp/usr/sbin/am-eject
	rm debian/tmp/usr/share/man/man8/mk-amd-map.8
	rm debian/tmp/usr/sbin/ctl-* debian/tmp/usr/sbin/wait* \
	   debian/tmp/usr/sbin/fix-amd-map \
	   debian/tmp/usr/sbin/fixrmtab
	install -d debian/tmp/usr/include/amd
	cp include/*.h debian/tmp/usr/include/amd
	mv debian/tmp/usr/sbin/fsinfo debian/tmp/usr/sbin/amd-fsinfo
	mv debian/tmp/usr/share/man/man8/fsinfo.8 \
	   debian/tmp/usr/share/man/man8/amd-fsinfo.8

	dh_movefiles

# Arch indep
binary-indep: binary-am-utils-doc

# Doc package
binary-am-utils-doc: DH_OPTIONS=-pam-utils-doc
binary-am-utils-doc: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installchangelogs
	install -d debian/am-utils-doc/usr/share/doc/am-utils/html
	cp debian/html/*.html debian/am-utils-doc/usr/share/doc/am-utils/html/
	cp doc/am-utils.texi debian/am-utils-doc/usr/share/doc/am-utils/
	cp doc/am-utils.ps debian/am-utils-doc/usr/share/doc/am-utils/
	dh_installinfo
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Arch-specific
binary-arch: binary-am-utils binary-am-utils-dev

# am-utils
binary-am-utils: DH_OPTIONS=-pam-utils
binary-am-utils: build install
	# Need this version of debhelper for DH_OPTIONS to work.
	dh_testdir
	dh_testroot
	dh_installdebconf
	dh_installdocs debian/cookbook.txt
	install -d debian/am-utils/usr/share/doc/am-utils/examples
	mv debian/am-utils/usr/sbin/amd2* \
	   debian/am-utils/usr/share/doc/am-utils/examples
	mv debian/am-utils/usr/sbin/automount2amd \
	   debian/am-utils/usr/share/doc/am-utils/examples
	cp debian/a_master debian/am-utils/usr/share/doc/am-utils/examples
	dh_link usr/share/am-utils/amd.net usr/share/doc/am-utils/examples/a_net
	install -d debian/am-utils/usr/share/doc/am-utils/kernel-patches
	cp debian/*.diff debian/am-utils/usr/share/doc/am-utils/kernel-patches
	gzip -v9 debian/am-utils/usr/share/doc/am-utils/kernel-patches/*
	install -d debian/am-utils/usr/share/am-utils
	cp debian/a_net debian/am-utils/usr/share/am-utils/amd.net
	dh_installinit -n
	dh_undocumented
	dh_installchangelogs ChangeLog
	dh_strip
	dh_link
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_perl
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# am-utils-dev
binary-am-utils-dev: DH_OPTIONS=-pam-utils-dev
binary-am-utils-dev: build install
	# Need this version of debhelper for DH_OPTIONS to work.
	dh_testdir
	dh_testroot
	dh_link
	dh_installdocs
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
	test "$$(find debian/tmp ! -type d)" = ""


print-version:
	@echo "Debian version:          $(DEBVERSION)"
	@echo "Upstream version:        $(UPVERSION)"

get-orig-source:
	$(WGET) -O am-utils_$(UPVERSION).orig.tar.gz \
	  ftp://ftp.am-utils.org/pub/am-utils/am-utils-$(UPVERSION).tar.gz

.PHONY: build clean binary-indep binary-arch binary install binary-am-utils \
	binary-am-utils-dev print-version get-orig-source