1#!/usr/bin/make -f
2# Sample debian/rules that uses debhelper.
3# GNU copyright 1997 by Joey Hess.
4#
5# This version is for a hypothetical package that builds an
6# architecture-dependant package, as well as an architecture-independent
7# package.
8
9# Uncomment this to turn on verbose mode.
10#export DH_VERBOSE=1
11
12# This is the debhelper compatability version to use.
13export DH_COMPAT=1
14
15# This has to be exported to make some magic below work.
16export DH_OPTIONS
17
18configure: configure-stamp
19configure-stamp:
20	dh_testdir
21	# Add here commands to configure the package.
22	autoconf
23	./configure --prefix=/usr --mandir=\$${prefix}/share/man \
24		--infodir=\$${prefix}/share/info --disable-auth \
25		--sysconfdir=/etc
26
27	touch configure-stamp
28
29build: configure-stamp build-stamp
30build-stamp:
31	dh_testdir
32
33	# Add here commands to compile the package.
34	$(MAKE)
35
36	touch build-stamp
37
38clean:
39	dh_testdir
40	dh_testroot
41	rm -f build-stamp configure-stamp
42
43	# Add here commands to clean up after the build process.
44	-$(MAKE) distclean
45	-$(MAKE) clean
46	-rm -f `find . -name "config.cache"`
47	-rm -f config.status
48	-rm -f `find . -name "config.log"`
49	-rm -f Makefile.config gopher/Makefile gopher/locales/Makefile \
50		Makefile config.h doc/Makefile \
51		gophfilt/Makefile object/Makefile
52
53	dh_clean
54
55install: DH_OPTIONS=
56install: build
57	dh_testdir
58	dh_testroot
59	dh_clean -k
60	dh_installdirs
61
62	# Add here commands to install the package into debian/tmp.
63	$(MAKE) install prefix=`pwd`/debian/tmp/usr \
64		PREFIX=`pwd`/debian/tmp/usr \
65		DESTDIR=`pwd`/debian/tmp
66
67	chmod -R a-x debian/tmp/etc
68
69	dh_movefiles
70	chmod u+x debian/tmp/etc/gopher debian/tmp/etc
71
72# Build architecture-independent files here.
73# Pass -i to all debhelper commands in this target to reduce clutter.
74binary-indep: DH_OPTIONS=-i
75binary-indep: build install
76	# Need this version of debhelper for DH_OPTIONS to work.
77	dh_testversion 2.0.103
78	dh_testdir
79	dh_testroot
80#	dh_installdebconf
81	dh_installdocs
82	dh_installexamples
83	dh_installmenu
84#	dh_installemacsen
85#	dh_installpam
86	dh_installinit
87	dh_installcron
88	dh_installlogrotate
89#	dh_installmanpages
90	dh_installinfo
91#	dh_undocumented
92	dh_installchangelogs
93	dh_link
94	dh_compress
95	dh_fixperms
96	# You may want to make some executables suid here.
97	dh_suidregister
98	dh_installdeb
99#	dh_perl
100	dh_gencontrol
101	dh_md5sums
102	dh_builddeb
103
104# Build architecture-dependent files here.
105# Pass -a to all debhelper commands in this target to reduce clutter.
106binary-arch: DH_OPTIONS=-a
107binary-arch: build install
108	# Need this version of debhelper for DH_OPTIONS to work.
109	dh_testversion 1.1.17
110	dh_testdir
111	dh_testroot
112#	dh_installdebconf
113	dh_installdocs
114	dh_installexamples
115	dh_installmenu
116#	dh_installemacsen
117#	dh_installpam
118	dh_installinit
119	dh_installlogrotate
120	dh_installcron
121#	dh_installmanpages
122	dh_installinfo
123#	dh_undocumented
124	dh_installchangelogs
125	dh_strip
126	dh_link
127	dh_compress
128	dh_fixperms
129	# You may want to make some executables suid here.
130	dh_suidregister
131	dh_installdeb
132#	dh_makeshlibs
133#	dh_perl
134	dh_shlibdeps
135	dh_gencontrol
136	dh_md5sums
137	dh_builddeb
138
139binary: binary-arch
140.PHONY: build clean binary-arch binary install
141