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 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365
|
#! /usr/bin/make -f
#
# debian/rules file for squid.
#
# Version.
package = squid
# Include dpatch stuff.
include /usr/share/dpatch/dpatch.make
export DEB_BUILD_HARDENING=1
SHELL = /bin/bash
LC_ALL = POSIX
DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU 2>/dev/null)
DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
CFLAGS = -Wall -g
INSTALL = install
INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644
INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755
INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755
NUMJOBS = 1
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
# Take account of old dpkg-architecture output.
ifeq ($(DEB_HOST_ARCH_CPU),)
DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
ifeq ($(DEB_HOST_ARCH_CPU),x86_64)
DEB_HOST_ARCH_CPU := amd64
endif
endif
ifeq ($(DEB_HOST_ARCH_OS),)
DEB_HOST_ARCH_OS := $(subst -gnu,,$(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM))
ifeq ($(DEB_HOST_ARCH_OS),gnu)
DEB_HOST_ARCH_OS := hurd
endif
endif
tmp = debian/tmp
bindir = /usr/sbin
libexecdir = /usr/lib/squid
sysconfdir = /etc/squid
logdir = /var/log/squid
docdir = /usr/share/doc/squid
datadir = /usr/share/squid
mibdir = /usr/share/snmp/mibs
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 \
DEFAULT_ICON_DIR=$(datadir)/icons \
DEFAULT_ERROR_DIR=$(datadir)/errors/en \
DEFAULT_MIME_TABLE=$(datadir)/mime.conf \
DEFAULT_MIB_PATH=$(mibdir)/SQUID.txt
# The HURD doesn't have pthreads yet.
ifeq ($(DEB_HOST_ARCH_OS), gnu)
with_pthreads = --enable-storeio=ufs,diskd,null
with_netfilter =
with_arp_acl =
with_epoll =
else
ifeq ($(DEB_HOST_ARCH_OS), kfreebsd)
with_pthreads = --enable-async-io --with-pthreads \
--enable-storeio=ufs,aufs,coss,diskd,null
with_netfilter =
with_arp_acl =
with_epoll = --enable-kqueue
else
with_pthreads = --enable-async-io --with-pthreads \
--enable-storeio=ufs,aufs,coss,diskd,null
with_netfilter = --enable-linux-netfilter
with_arp_acl = --enable-arp-acl
with_epoll = --enable-epoll
endif
endif
# setresuid is broken on sparc
ifeq ($(DEB_HOST_ARCH_CPU), sparc)
opt_ac_cv_func_setresuid = ac_cv_func_setresuid=no
else
opt_ac_cv_func_setresuid = ac_cv_func_setresuid=yes
endif
define checkdir
test -f src/squid.h
endef
# Build the binaries.
build: MAKEFLAGS += -j$(NUMJOBS)
build: patch config.status
$(checkdir)
$(MAKE) $(DEFAULTS) all
# Authentication modules
cd helpers/basic_auth/NCSA && make
cd helpers/basic_auth/SMB && make SAMBAPREFIX=/usr INSTALLBIN=/usr/lib/squid
cd helpers/basic_auth/PAM && make
cd helpers/basic_auth/LDAP && make
cd helpers/basic_auth/YP && make
cd helpers/basic_auth/MSNT && make
cd helpers/basic_auth/getpwnam && make
cd helpers/digest_auth/password && make
cd helpers/digest_auth/ldap && make
cd helpers/external_acl/ip_user && make
cd helpers/external_acl/ldap_group && make
cd helpers/external_acl/session && make
cd helpers/external_acl/unix_group && make
cd helpers/external_acl/wbinfo_group && make
cd helpers/ntlm_auth/SMB && make
touch build
# Configure the package.
config.status:
rm cfgaux/config.sub cfgaux/config.guess
ln -s /usr/share/misc/config.sub cfgaux/
ln -s /usr/share/misc/config.guess cfgaux/
$(opt_ac_cv_func_setresuid) \
./configure \
--prefix=/usr \
--exec_prefix=/usr \
--bindir=/usr/sbin --sbindir=/usr/sbin \
--libexecdir=/usr/lib/squid \
--sysconfdir=$(sysconfdir) \
--localstatedir=/var/spool/squid \
--datadir=/usr/share/squid \
$(with_pthreads) \
$(with_netfilter) \
$(with_arp_acl) \
$(with_epoll) \
--enable-removal-policies=lru,heap \
--enable-snmp \
--enable-delay-pools \
--enable-htcp \
--enable-cache-digests \
--enable-underscores \
--enable-referer-log \
--enable-useragent-log \
--enable-auth="basic,digest,ntlm,negotiate" \
--enable-negotiate-auth-helpers=squid_kerb_auth \
--enable-carp \
--enable-follow-x-forwarded-for \
--with-large-files \
--with-maxfd=65536 \
$(DEB_HOST_ARCH_CPU)-debian-$(DEB_HOST_ARCH_OS)
# Architecture independant files.
binary-indep: build checkroot
-rm -rf $(tmp) debian/files
$(checkdir)
#
# Build squid-common package.
#
$(INSTALL_DIR) $(tmp)/DEBIAN
$(INSTALL_DIR) $(tmp)/usr/share/doc/squid-common
$(INSTALL_FILE) ChangeLog $(tmp)/usr/share/doc/squid-common/changelog
$(INSTALL_FILE) debian/changelog \
$(tmp)/usr/share/doc/squid-common/changelog.Debian
gzip -9f $(tmp)/usr/share/doc/squid-common/*
$(INSTALL_FILE) debian/copyright $(tmp)/usr/share/doc/squid-common
$(INSTALL_DIR) $(tmp)/usr/share/$(package)
#$(INSTALL_DIR) $(tmp)/usr/share/squid/errors
ln -sf ../squid-langpack $(tmp)/usr/share/squid/errors
$(INSTALL_DIR) $(tmp)/usr/share/squid/icons
$(INSTALL_DIR) $(tmp)/usr/share/snmp/mibs
$(INSTALL_FILE) src/mib.txt ./$(tmp)$(mibdir)/SQUID.txt
$(INSTALL_FILE) src/mime.conf.default ./$(tmp)$(datadir)/mime.conf
#
#cp -R errors/* ./$(tmp)$(datadir)/errors
#rm -f ./$(tmp)$(datadir)/errors/Makefile*
#rm -f ./$(tmp)$(datadir)/errors/list
#chmod 755 ./$(tmp)$(datadir)/errors/*
#chmod 644 ./$(tmp)$(datadir)/errors/*/*
#chown -R root:root ./$(tmp)$(datadir)/errors
$(INSTALL_FILE) icons/*.gif ./$(tmp)$(datadir)/icons
$(INSTALL_DIR) $(tmp)/usr/share/doc/$(package)
$(INSTALL_DIR) $(tmp)/usr/share/doc/$(package)/examples
$(INSTALL_FILE) debian/doc/README.auth_modules $(tmp)$(docdir)
$(INSTALL_FILE) helpers/basic_auth/SMB/README \
$(tmp)$(docdir)/README.auth_module.smb_auth
umask 022; head -19 helpers/basic_auth/NCSA/ncsa_auth.c > \
$(tmp)$(docdir)/README.auth_module.ncsa_auth
umask 022; head -56 helpers/basic_auth/PAM/pam_auth.c > \
$(tmp)$(docdir)/README.auth_module.pam_auth
$(INSTALL_FILE) debian/README.ldap_auth \
$(tmp)$(docdir)/README.auth_module.ldap_auth
$(INSTALL_FILE) helpers/basic_auth/MSNT/README.html \
$(tmp)$(docdir)/README.auth_module.msnt_auth.html
umask 022; head -21 helpers/basic_auth/getpwnam/getpwnam_auth.c > \
$(tmp)$(docdir)/README.auth_module.getpwnam_auth
umask 022; head -26 helpers/digest_auth/password/digest_pw_auth.c > \
$(tmp)$(docdir)/README.auth_module.digest_pw_auth
$(INSTALL_FILE) helpers/external_acl/ip_user/README \
$(tmp)$(docdir)/README.auth_module.ip_user
$(INSTALL_FILE) helpers/external_acl/ip_user/example.conf \
$(tmp)$(docdir)/examples/ip_user-example.conf
$(INSTALL_FILE) helpers/external_acl/unix_group/README \
$(tmp)$(docdir)/README.auth_module.unix_group
$(INSTALL_FILE) helpers/negotiate_auth/squid_kerb_auth/readme.txt \
$(tmp)$(docdir)/README.squid_kerb_auth
$(INSTALL_FILE) CONTRIBUTORS QUICKSTART RELEASENOTES.html \
README debian/doc/README.transparent-proxy \
debian/doc/README.morefds doc/debug-sections.txt \
$(tmp)/usr/share/doc/$(package)
$(INSTALL_FILE) debian/doc/CompleteFaq $(tmp)/usr/share/doc/$(package)
gzip -9f `find debian/tmp/usr/share/doc/squid/* | grep -v examples`
$(INSTALL_SCRIPT) debian/postinst.squid-common $(tmp)/DEBIAN/postinst
dpkg-gencontrol -isp -psquid-common
dpkg --build $(tmp) ..
rm -f debian/substvars
rm -rf $(tmp)
# Make a binary package (.deb file)
binary-arch: build checkroot
#
# Build squid package.
#
$(INSTALL_DIR) $(tmp)/DEBIAN
$(INSTALL_DIR) $(tmp)/etc/squid
$(INSTALL_DIR) $(tmp)/etc/logrotate.d
$(INSTALL_DIR) $(tmp)/etc/init.d
$(INSTALL_DIR) $(tmp)/etc/resolvconf/update-libc.d
$(INSTALL_DIR) $(tmp)/usr/sbin
$(INSTALL_DIR) $(tmp)/usr/share/doc/$(package)
$(INSTALL_DIR) $(tmp)/usr/share/doc/$(package)/examples
$(INSTALL_DIR) $(tmp)/usr/lib/squid
$(INSTALL_DIR) $(tmp)/var/{log,spool}
install -m 750 -o proxy -g proxy -d $(tmp)/var/log/squid
install -m 750 -o proxy -g proxy -d $(tmp)/var/spool/squid
$(INSTALL_DIR) $(tmp)/usr/share/man/man8
#
$(INSTALL_PROGRAM) src/squid $(tmp)/usr/sbin
$(INSTALL_PROGRAM) src/unlinkd src/fs/diskd-daemon src/logfile-daemon $(tmp)/usr/lib/squid
$(INSTALL_FILE) debian/logrotate $(tmp)/etc/logrotate.d/squid
$(INSTALL_SCRIPT) debian/squid.resolvconf $(tmp)/etc/resolvconf/update-libc.d/squid
$(INSTALL_PROGRAM) helpers/basic_auth/SMB/smb_auth $(tmp)$(libexecdir)
$(INSTALL_SCRIPT) helpers/basic_auth/SMB/smb_auth.sh $(tmp)$(libexecdir)
$(INSTALL_PROGRAM) helpers/basic_auth/NCSA/ncsa_auth $(tmp)$(libexecdir)
$(INSTALL_PROGRAM) -m 2754 -o proxy -g shadow \
helpers/basic_auth/PAM/pam_auth $(tmp)$(libexecdir)
$(INSTALL_PROGRAM) helpers/basic_auth/LDAP/squid_ldap_auth \
$(tmp)$(libexecdir)/ldap_auth
$(INSTALL_PROGRAM) helpers/basic_auth/YP/yp_auth \
$(tmp)$(libexecdir)/yp_auth
$(INSTALL_PROGRAM) helpers/basic_auth/MSNT/msnt_auth \
$(tmp)$(libexecdir)/msnt_auth
$(INSTALL_PROGRAM) -m 2754 -o proxy -g shadow \
helpers/basic_auth/getpwnam/getpwname_auth \
$(tmp)$(libexecdir)/getpwnam_auth
$(INSTALL_PROGRAM) helpers/digest_auth/password/digest_pw_auth \
$(tmp)$(libexecdir)/digest_pw_auth
$(INSTALL_PROGRAM) helpers/external_acl/ip_user/ip_user_check \
$(tmp)$(libexecdir)/ip_user_check
$(INSTALL_PROGRAM) helpers/external_acl/ldap_group/squid_ldap_group \
$(tmp)$(libexecdir)/squid_ldap_group
$(INSTALL_FILE) helpers/external_acl/ldap_group/squid_ldap_group.8 \
$(tmp)/usr/share/man/man8/squid_ldap_group.8
$(INSTALL_PROGRAM) helpers/external_acl/session/squid_session \
$(tmp)$(libexecdir)/squid_session
$(INSTALL_FILE) helpers/external_acl/session/squid_session.8 \
$(tmp)/usr/share/man/man8/squid_session.8
$(INSTALL_PROGRAM) helpers/external_acl/unix_group/squid_unix_group \
$(tmp)$(libexecdir)/squid_unix_group
$(INSTALL_FILE) helpers/external_acl/unix_group/squid_unix_group.8 \
$(tmp)/usr/share/man/man8/squid_unix_group.8
$(INSTALL_SCRIPT) helpers/external_acl/wbinfo_group/wbinfo_group.pl \
$(tmp)$(libexecdir)/wbinfo_group.pl
$(INSTALL_PROGRAM) helpers/ntlm_auth/SMB/ntlm_auth \
$(tmp)$(libexecdir)/ntlm_auth
$(INSTALL_PROGRAM) helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth \
$(tmp)$(libexecdir)/squid_kerb_auth
# the examples. Most have been removed from upstream :/
$(INSTALL_FILE) src/squid.conf.default \
$(tmp)/usr/share/doc/$(package)/examples/squid.conf
$(INSTALL_FILE) debian/default.squid \
$(tmp)/usr/share/doc/$(package)/examples
#
$(INSTALL_FILE) ChangeLog $(tmp)/usr/share/doc/$(package)/changelog
$(INSTALL_FILE) debian/changelog \
$(tmp)/usr/share/doc/$(package)/changelog.Debian
$(INSTALL_FILE) debian/README.Debian \
$(tmp)/usr/share/doc/$(package)/README.Debian
$(INSTALL_FILE) debian/NEWS.Debian \
$(tmp)/usr/share/doc/$(package)/NEWS.Debian
gzip -9f `find debian/tmp/usr/share/doc/squid/* | grep -v examples`
$(INSTALL_FILE) debian/copyright $(tmp)/usr/share/doc/$(package)
$(INSTALL_FILE) doc/squid.8 $(tmp)/usr/share/man/man8
gzip -9f $(tmp)/usr/share/man/man?/*
$(INSTALL_SCRIPT) debian/squid.rc $(tmp)/etc/init.d/squid
#
$(INSTALL_SCRIPT) debian/preinst $(tmp)/DEBIAN/preinst
$(INSTALL_SCRIPT) debian/postinst $(tmp)/DEBIAN/postinst
$(INSTALL_SCRIPT) debian/prerm $(tmp)/DEBIAN/prerm
$(INSTALL_SCRIPT) debian/postrm $(tmp)/DEBIAN/postrm
$(INSTALL_FILE) debian/conffiles $(tmp)/DEBIAN/conffiles
#$(INSTALL_FILE) debian/templates $(tmp)/DEBIAN/templates
po2debconf debian/templates > debian/templates.merged
$(INSTALL_FILE) debian/templates.merged $(tmp)/DEBIAN/templates
$(INSTALL_SCRIPT) debian/config $(tmp)/DEBIAN/config
# overrides file
$(INSTALL_DIR) $(tmp)/usr/share/lintian/overrides/
$(INSTALL_FILE) debian/squid.overrides \
$(tmp)/usr/share/lintian/overrides/squid
dpkg-shlibdeps $(tmp)/usr/sbin/* $(tmp)$(libexecdir)/*
dpkg-gencontrol -isp -p$(package)
dpkg --build $(tmp) ..
rm -f debian/substvars
rm -rf $(tmp)
# Clean up.
clean: clean1 unpatch
clean1: checkroot
[ ! -f Makefile ] || $(MAKE) distclean
rm -f helpers/basic_auth/NCSA/{Makefile,ncsa_auth.o,ncsa_auth}
rm -f helpers/basic_auth/SMB/{smb_auth.o,smb_auth}
rm -f helpers/basic_auth/PAM/{pam_auth.o,pam_auth}
rm -f helpers/basic_auth/YP/{Makefile,yp_auth,yp_auth.o,nis_support.o}
rm -f helpers/basic_auth/MSNT/{Makefile,msnt_auth,*.o}
rm -f helpers/basic_auth/LDAP/{Makefile,squid_ldap_auth,*.o}
rm -f helpers/basic_auth/getpwnam/{Makefile,getpwnam_auth.o,getpwnam_auth}
rm -f helpers/digest_auth/password/{Makefile,digest_pw_auth,digest_pw_auth.o}
rm -f helpers/external_acl/ip_user/{Makefile,ip_user,dict.o,main.o,match.o}
rm -f helpers/external_acl/ldap_group/{Makefile,squid_ldap_group,squid_ldap_group.o}
rm -f helpers/external_acl/unix_group/{Makefile,squid_unix_group,check_group.o}
rm -f helpers/ntlm_auth/SMB/{Makefile,ntlm_auth,*.o,smbval/*.o}
-rm -f build debian/{substvars,files,templates.merged}
rm -rf $(tmp) *~
-find . -name '*.bak' -o -name '*~' | xargs -r rm -f --
#cd icons && /bin/sh ./icons.shar
debconf-updatepo
binary: binary-indep binary-arch
checkroot:
$(checkdir)
test root = "`whoami`"
dist: binary
dpkg-source -b
.PHONY: binary binary-arch binary-indep clean checkroot clean1 patch unpatch
|