File: rules

package info (click to toggle)
thttpd 2.23beta1-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 684 kB
  • ctags: 679
  • sloc: ansic: 7,908; sh: 1,871; makefile: 310
file content (163 lines) | stat: -rwxr-xr-x 4,361 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
#!/usr/bin/make -f

SHELL=/bin/bash
PACKAGE=thttpd
PACKAGE-util=thttpd-util

tmp=debian/tmp
tmp-util=debian/tmp-util
sysconfdir=etc
docdir=usr/share/doc
mandir=usr/share/man
sbindir=usr/sbin
bindir=usr/bin
cgi-bin=usr/lib/cgi-bin

define checkdir
	test -f config.h
endef

clean: checkroot
	test -f debian/control
	rm -rf $(tmp) $(tmp-util) debian/substvars debian/files *orig* \
	    debian/*bak*
	$(MAKE) distclean || true

checkroot:
	test root = "`whoami`" || (echo Need root privileges; exit 1)

build: config.status
	test -e debian/control
	$(MAKE)
	touch build-stamp

config.status:
	./configure \
	--libdir=/usr/lib \
	--prefix=/usr \
	--exec-prefix=/usr \
	--sbindir=/usr/sbin \
	--bindir=/usr/bin \
	--sysconfdir=/etc \
	--mandir=/usr/share/ \
	--includedir=/usr/include


binary-indep: build
	$(checkroot)

binary-arch: build checkroot
	#
	# Build main package.
	#
	chmod -R g-s debian
	install --mode=755 -d $(tmp)/DEBIAN
	install --mode=755 -d $(tmp)/etc/{init.d,logrotate.d,$(PACKAGE)}
	install --mode=755 -d $(tmp)/usr/sbin
	install --mode=755 -d $(tmp)/usr/share/{doc,man}
	install --mode=755 -d $(tmp)/usr/share/man/man8
	install --mode=755 -d $(tmp)/usr/share/doc/$(PACKAGE)
	install --mode=755 -d $(tmp)/var/{log,www}
	install --mode=755 -d $(tmp)/var/www/users

	#
	# Install documentation
	#
	install --mode=644 debian/README.Debian.thttpd \
		$(tmp)/$(docdir)/$(PACKAGE)/README.Debian
	install --mode=644 debian/copyright \
		$(tmp)/$(docdir)/$(PACKAGE)
	install --mode=644 {README,TODO} \
		$(tmp)/$(docdir)/$(PACKAGE)
	install --mode=644 thttpd.8 \
		$(tmp)/$(mandir)/man8
	install --mode=644 debian/changelog \
		$(tmp)/$(docdir)/$(PACKAGE)/changelog.Debian
	#
	# Install installation scripts and other special files.
	#
	install --mode=644 debian/thttpd.conf $(tmp)/$(sysconfdir)/$(PACKAGE)
	install --mode=644 debian/throttle.conf \
	    $(tmp)/$(sysconfdir)/$(PACKAGE)
	install --mode=755 debian/thttpd.rc   $(tmp)/$(sysconfdir)/init.d/$(PACKAGE)
	install --mode=644 debian/conffiles   $(tmp)/DEBIAN
	install --mode=755 debian/{postinst,postrm,prerm} \
		$(tmp)/DEBIAN
	install --mode=644 debian/thttpd.logrotate \
		$(tmp)/$(sysconfdir)/logrotate.d/thttpd
	#
	# Install binaries
	#
	install --mode=755 -s thttpd $(tmp)/$(sbindir)
	#
	# Compress man pages and other documentation.
	#
	gzip -9f $(tmp)/$(mandir)/man8/*
	gzip -9f $(tmp)/$(docdir)/$(PACKAGE)/changelog*
	#
	# Build the binary package.
	#
	dpkg-shlibdeps $(tmp)/$(sbindir)/*
	dpkg-gencontrol -ips -p$(PACKAGE) -P$(tmp)
	dpkg --build $(tmp) ..
	#
	# Generate thttpd-util package
	#
	install --mode=755 -d $(tmp-util)/DEBIAN
	install --mode=755 -d $(tmp-util)/$(cgi-bin)
	install --mode=755 -d $(tmp-util)/usr/bin
	install --mode=755 -d $(tmp-util)/usr/share/doc/$(PACKAGE-util)
	install --mode=755 -d $(tmp-util)/usr/share/man/{man8,man1}
	#
	# Install documentation
	#
	install --mode=644 extras/*.8 $(tmp-util)/$(mandir)/man8
	install --mode=644 cgi-src/*.8 $(tmp-util)/$(mandir)/man8
	install --mode=644 extras/htpasswd.1 \
	    $(tmp-util)/$(mandir)/man1/thtpasswd.1
	install --mode=644 extras/makeweb.1 \
	    $(tmp-util)/$(mandir)/man1
	install --mode=644 debian/copyright \
	    $(tmp-util)/$(docdir)/$(PACKAGE-util)
	install --mode=644 debian/changelog \
	    $(tmp-util)/$(docdir)/$(PACKAGE-util)/changelog.Debian
	install --mode=644 debian/README.Debian \
	    $(tmp-util)/$(docdir)/$(PACKAGE-util)
	#
	# Install binaries
	#
	install -s --mode=755 cgi-src/{redirect,ssi} \
	    $(tmp-util)/$(cgi-bin)
	install -s --mode=755 extras/htpasswd \
	    $(tmp-util)/$(bindir)/thtpasswd
	install --mode=755 extras/syslogtocern \
	    $(tmp-util)/$(bindir)
	install -s --mode=755 extras/makeweb \
	    $(tmp-util)/$(bindir)
	#
	# Compress documentation
	#
	gzip -9f $(tmp-util)/$(docdir)/$(PACKAGE-util)/changelog*
	gzip -9f $(tmp-util)/$(mandir)/{man8,man1}/*
	#
	# Install special files
	#
	install --mode=755 debian/postinst.util \
	    $(tmp-util)/DEBIAN/postinst
	install --mode=755 debian/prerm.util \
	    $(tmp-util)/DEBIAN/prerm
	install --mode=755 debian/control \
	    $(tmp-util)/DEBIAN
	# 
	# Create the package
	#
	dpkg-shlibdeps $(tmp-util)/$(bindir)/*
	dpkg-gencontrol -ips -p$(PACKAGE-util) -P$(tmp-util)
	dpkg --build $(tmp-util) ..

source diff:
	@echo >&2 'Source and diff are obsolete - use dpkg-source -b'; false

binary:	binary-indep binary-arch