File: rules

package info (click to toggle)
proftpd 1.2.0pre9-4
  • links: PTS
  • area: main
  • in suites: slink
  • size: 2,392 kB
  • ctags: 2,648
  • sloc: ansic: 24,012; sh: 1,754; makefile: 536; perl: 281
file content (132 lines) | stat: -rwxr-xr-x 4,204 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
#!/usr/bin/make -f
# -*- makefile -*- made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.

SHELL = /bin/bash
CC = gcc

# This is only compiled if /usr/src/linux/Makefile is 2.2.x or later.
ifeq ("$(shell bash debian/getkernelversion)", "privs")
LINUXPRIVS = mod_linuxprivs:
endif

# This kills the mod_pam and FHS doc stuff on a slink build.
ifeq ("$(shell dh_testversion 2.0.40 2> /dev/null && echo potato)", "potato")
PAM = mod_pam:
DOC = usr/share/doc
else
DOC = usr/doc
endif

# This is the suite of modules maintained in debian/, not upstream CVS.
EXTRAMODS = mod_ratio:

# This should be commented out for the build to succeed.
# DEBUG = -DDEBUG_NOFORK

build: stamp-configure
	$(checkdir)
	$(MAKE)
	touch build

stamp-configure:
	ln -sf ../debian/mod_ratio.c modules/mod_ratio.c
	ln -sf ../debian/mod_sqlpw.c modules/mod_sqlpw.c
	ln -sf ../debian/mod_pgsql.c modules/mod_pgsql.c
	ln -sf ../debian/mod_mysql.c modules/mod_mysql.c
	CC="$(CC) -Wall -g3 $(DEBUG) -I ../ -I/usr/include/mysql \
		-I/usr/include/postgresql" \
		./configure --prefix=/usr \
		--sysconfdir=/etc --localstatedir=/var/run \
		--enable-autoshadow \
		--with-modules=$(LINUXPRIVS)$(EXTRAMODS)$(PAM)mod_readme
	touch stamp-configure

l33ch:
	rm -rf debian/www && install -d debian/www/www.proftpd.org
	cd debian/www && wget -nv -r -l2 -k www.proftpd.org
	rm -rv debian/www/www.proftpd.org/_*
	cd debian/www && tar -czvf ../www.proftpd.org.tar.gz www.proftpd.org
	test -f debian/www/www.proftpd.org/index.html
	uuencode www.proftpd.org.tar.gz \
		< debian/www.proftpd.org.tar.gz > debian/manual.uue
	rm debian/www.proftpd.org.tar.gz

clean:
	$(checkdir)
	dh_clean
	rm -f build stamp-configure contrib/{mod_ratio*,mod_mysql*}
	-$(MAKE) distclean
	rm -f $$(find . -type l) $$(find . -name "*~" -o -name "*.o")
	rm -f proftpd config.cache config.log lib/*.a ftpshut Make.rules
	rm -rf $$(find debian/* -type d) debian/{files*,*substvars*,*.gz} core
	rm -f $$(find * -name "*.orig") modules/mod_ratio.c
	chmod +x debian/{preinst,postinst,postrm,init,cron.monthly}
	chmod +x debian/getkernelversion

binary-indep:	checkroot build
	$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch:	checkroot build
	$(checkdir)
	dh_clean
	dh_installdirs $(DOC) etc/pam.d
	dh_installdocs README README.Solaris2.5x INSTALL doc/rfc \
		$$(find doc/* -type f -maxdepth 0 | egrep -v "Get|Show|license") 
	dh_installinit
	dh_installchangelogs ChangeLog
	$(MAKE) install prefix=$$(pwd)/debian/tmp/usr \
		rundir=$$(pwd)/debian/tmp/var/run/proftpd \
		sysconfdir=$$(pwd)/debian/tmp/etc INSTALL=install
	cd debian/tmp/usr/man/man5 && mv xferlog.5 xferlog.proftpd.5
	if [ "$(DOC)" != "usr/doc" ] ; then \
		cd debian/tmp/usr && mkdir -p share && mv man share ; fi
	rm debian/tmp/usr/sbin/in.proftpd
	install contrib/xferstats.holger-preiss \
		debian/tmp/usr/sbin/ftpstats
	cp debian/basic.conf debian/tmp/etc/proftpd.conf

#	cd debian && uudecode manual.uue && tar -zxvf www.proftpd.org.tar.gz
#	cp -a debian/www.proftpd.org/{images,*.html} \
#		debian/tmp/$(DOC)/proftpd

	cp -a debian/cron.monthly debian/tmp/etc/cron.monthly/proftpd
	dh_installexamples sample-configurations/*
	dh_undocumented ftpstats.8
	cp -av debian/pam debian/tmp/etc/pam.d/ftp
	dh_compress
	dh_fixperms
	dh_installdeb
	# installdebconf is not used because postrm was edited manually.
	cp -v debian/templates debian/tmp/DEBIAN
	dh_shlibdeps
	dh_gencontrol -u-isp
	dh_strip
	dh_md5sums
	dh_fixperms
	dpkg --build debian/tmp ..
	if egrep "^DEBUG" debian/rules; then false; fi

define checkdir
	test -f debian/rules
endef

# Below here is fairly generic really

binary:		binary-indep binary-arch

checkroot:
	$(checkdir)
	test root = "`whoami`"

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

tidy:
	rm -f o *~ debian/*~
	cd debian && indent -v mod_sqlpw.c mod_mysql.c mod_pgsql.c mod_ratio.c
	cd debian && makeinfo --no-headers -o mod_mysql.txt mod_mysql.texi
	cd debian && makeinfo --no-headers -o mod_pgsql.txt mod_pgsql.texi
	cd debian && makeinfo --no-headers -o mod_sqlpw.txt mod_sqlpw.texi