File: rules

package info (click to toggle)
squid 1.1.21-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 2,828 kB
  • ctags: 3,705
  • sloc: ansic: 34,400; sh: 1,975; perl: 899; makefile: 559
file content (194 lines) | stat: -rwxr-xr-x 5,760 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#!/usr/bin/make -f
#
#	debian/rules file for squid and squid-novm
#
#	The debian/ directory is setup so that it can be used
#	without change for both squid versions.
#

# Version.
package = squid
#package = squid-novm

arch    = $(shell dpkg --print-architecture)
tmp	= debian/tmp

bindir       = /usr/sbin
libexecdir   = /usr/lib/squid
sysconfdir   = /etc
logdir       = /var/log/squid

DEFAULTS     =	logdir=$(logdir) \
		DEFAULT_CACHE_LOG=$(logdir)/cache.log \
		DEFAULT_ACCESS_LOG=$(logdir)/access.log \
		DEFAULT_STORE_LOG=$(logdir)/store.log \
		DEFAULT_PID_FILE=/var/run/squid.pid \
		DEFAULT_SWAP_DIR=/var/spool/squid \
		ICMP_OPT=-DUSE_ICMP=1 \
		AUTH_OPT=-DUSE_PROXY_AUTH=1 \
		RELOAD_INTO_IMS=-DRELOAD_INTO_IMS=1

define checkdir
	test -f src/squid.h
endef


# Build the binaries.
build: config.status
	$(checkdir)
	$(MAKE) $(DEFAULTS) all
	touch build

# Configure the package.
config.status: 
	./configure \
	--prefix=/usr \
	--exec_prefix=/usr \
	--bindir=/usr/sbin \
	--libexecdir=/usr/lib/squid \
	--sysconfdir=/etc \
	--localstatedir=/var/spool/squid \
	$(arch)-debian-linux
	perl -pi -e 's/^#define SQUID_MAXFD.*/#define SQUID_MAXFD 3000/' \
		include/autoconf.h

# Architecture independant files.
binary-indep:	build
	$(checkdir)

# Make a binary package (.deb file)
binary-arch:	build checkroot gencontrol
	#
	#	Build squid package.
	#
	-rm -rf $(tmp) debian/files
	install -m 755 -g root -d $(tmp)/DEBIAN
	install -m 755 -g root -d $(tmp)/etc/{cron.daily,init.d}
	install -m 755 -g root -d $(tmp)/usr/{bin,sbin}
	install -m 755 -g root -d $(tmp)/usr/doc/$(package)
	install -m 755 -g root -d $(tmp)/usr/lib/squid
	install -m 755 -g root -d $(tmp)/var/log/squid
	install -m 755 -g root -d $(tmp)/var/spool/squid
	install -m 755 -g root -d $(tmp)/usr/man/man8
	#
	install -s -m 755 -g root src/squid $(tmp)/usr/sbin
	install -s -m 755 -g root src/{dnsserver,ftpget,pinger,unlinkd} \
		$(tmp)/usr/lib/squid
	#
	install -m 644 -g root debian/squid.conf \
		./$(tmp)/etc/squid.conf
ifeq ($(package), squid-novm)
	perl -pi -e 's/^#memory_pools .*/#memory_pools off/' \
		./$(tmp)/etc/squid.conf
endif
	install -m 755 -g root debian/squid.cron.daily \
		$(tmp)/etc/cron.daily/squid
	install -m 755 -g root debian/squid.RunCache \
		$(tmp)/$(libexecdir)/RunCache

	install -m 644 -g root ChangeLog $(tmp)/usr/doc/$(package)/changelog
	install -m 644 -g root debian/changelog \
		$(tmp)/usr/doc/$(package)/changelog.Debian
	install -m 644 -g root CONTRIBUTORS QUICKSTART \
		README debian/README.transparent-proxy \
		debian/README.morefds doc/* $(tmp)/usr/doc/$(package)
	gzip -9f $(tmp)/usr/doc/$(package)/*
	install -m 644 -g root debian/copyright $(tmp)/usr/doc/$(package)
	install -m 644 -g root debian/FAQ*.html $(tmp)/usr/doc/$(package)
	install -m 644 debian/squid.8 $(tmp)/usr/man/man8
	gzip -9f $(tmp)/usr/man/man?/*
	install -m 755 debian/squid.rc $(tmp)/etc/init.d/squid
	#
	install -m 755 debian/preinst $(tmp)/DEBIAN/preinst
	install -m 755 debian/postinst $(tmp)/DEBIAN/postinst
	install -m 755  debian/prerm $(tmp)/DEBIAN/prerm
	install -m 755  debian/postrm $(tmp)/DEBIAN/postrm
	install -m 644 debian/conffiles $(tmp)/DEBIAN/conffiles
	dpkg-shlibdeps src/squid
	dpkg-gencontrol -p$(package)
	dpkg --build $(tmp) ..
	rm -f debian/substvars
	rm -rf $(tmp)
ifeq ($(package), squid)
	#
	#	Generate squidclient package.
	#
	install -m 755 -g root -d $(tmp)/DEBIAN
	install -m 755 -g root -d $(tmp)/usr/bin
	install -m 755 -g root -d $(tmp)/usr/doc/squidclient
	install -m 755 -g root -d $(tmp)/usr/man/man1
	#
	install -s -m 755 -g root src/client $(tmp)/usr/bin/squidclient
	install -m 644 -g root debian/squidclient.1 $(tmp)/usr/man/man1
	install -m 644 -g root ChangeLog $(tmp)/usr/doc/squidclient/changelog
	install -m 644 -g root debian/changelog \
		$(tmp)/usr/doc/squidclient/changelog.Debian
	gzip -9f $(tmp)/usr/doc/squidclient/*
	install -m 644 -g root debian/copyright $(tmp)/usr/doc/squidclient
	gzip -9f $(tmp)/usr/man/man?/*
	#
	dpkg-shlibdeps src/client
	dpkg-gencontrol -psquidclient
	dpkg --build $(tmp) ..
	rm -f debian/substvars
	rm -rf $(tmp)
	#
	#	Generate squid-cgi package.
	#
	install -m 755 -g root -d $(tmp)/DEBIAN
	install -m 755 -g root -d $(tmp)/usr/lib/cgi-bin
	install -m 755 -g root -d $(tmp)/usr/doc/squid-cgi
	install -m 755 -g root -d $(tmp)/usr/man/man8
	#
	install -s -m 755 -g root src/cachemgr.cgi $(tmp)/usr/lib/cgi-bin/
	install -m 644 -g root debian/squid-cgi.8 $(tmp)/usr/man/man8
	install -m 644 -g root ChangeLog $(tmp)/usr/doc/squid-cgi/changelog
	install -m 644 -g root debian/changelog \
		$(tmp)/usr/doc/squid-cgi/changelog.Debian
	install -m 644 -g root debian/cachemgr.README \
		$(tmp)/usr/doc/squid-cgi/README.cachemgr
	gzip -9f $(tmp)/usr/doc/squid-cgi/*
	install -m 644 -g root debian/copyright $(tmp)/usr/doc/squid-cgi
	install -m 644 -g root debian/cachemgrfaq.html $(tmp)/usr/doc/squid-cgi
	gzip -9f $(tmp)/usr/man/man8/*
	install -m 755 -g root -d $(tmp)/usr/doc/squid-cgi/examples
	install -m 644 -g root debian/cachemgr.html \
		$(tmp)/usr/doc/squid-cgi/examples
	#
	dpkg-shlibdeps src/cachemgr.cgi
	dpkg-gencontrol -psquid-cgi
	dpkg --build $(tmp) ..
	rm -rf $(tmp)
endif

#debian/changelog:
#ifeq ($(package), squid)
#	cp debian/changelog.master debian/changelog
#else
#	debian/make.chl.novm
#endif

gencontrol:
ifeq ($(package), squid)
	cp debian/control.vm debian/control
else
	cp debian/control.novm debian/control
endif

# Clean up.
clean:	checkroot gencontrol
	-$(MAKE) -i realclean
	-rm -f build debian/{substvars,files}
	rm -rf $(tmp) *~
	-find . -name '*.bak' -o -name '*~' | xargs -r rm -f --

binary:	binary-indep binary-arch

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

dist:	binary
	dpkg-source -b

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