APKBUILD 6.33 KB
Newer Older
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
1 2 3
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=squid
4 5
pkgver=2.7.7
_ver=2.7.STABLE7
6
pkgrel=2
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
7 8
pkgdesc="A full-featured Web proxy cache server."
url="http://www.squid-cache.org"
9
install="squid.pre-install squid.pre-upgrade squid.post-install"
10 11
pkgusers="squid"
pkggroups="squid"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
12
license="GPL-2"
13 14
depends="$pkgname-errors-english logrotate"
makedepends="openssl-dev perl-dev autoconf automake"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
15
subpackages="$pkgname-doc
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
	$pkgname-errors-armenian:errors_armenian
	$pkgname-errors-azerbaijani:errors_azerbaijani
	$pkgname-errors-bulgarian:errors_bulgarian
	$pkgname-errors-catalan:errors_catalan 
	$pkgname-errors-czech:errors_czech
	$pkgname-errors-danish:errors_danish
	$pkgname-errors-dutch:errors_dutch
	$pkgname-errors-english:errors_english
	$pkgname-errors-estonian:errors_estonian
	$pkgname-errors-finnish:errors_finnish
	$pkgname-errors-french:errors_french
	$pkgname-errors-german:errors_german
	$pkgname-errors-greek:errors_greek
	$pkgname-errors-hebrew:errors_hebrew
	$pkgname-errors-hungarian:errors_hungarian
	$pkgname-errors-italian:errors_italian
	$pkgname-errors-japanese:errors_japanese
	$pkgname-errors-korean:errors_korean
	$pkgname-errors-lithuanian:errors_lithuanian
	$pkgname-errors-polish:errors_polish
	$pkgname-errors-portuguese:errors_portuguese
	$pkgname-errors-romanian:errors_romanian
	$pkgname-errors-russian-1251:errors_russian_1251
	$pkgname-errors-russian-koi8-r:errors_russian_koi8_r
	$pkgname-errors-serbian:errors_serbian
	$pkgname-errors-simplify_chinese:errors_simplify_chinese
	$pkgname-errors-slovak:errors_slovak
	$pkgname-errors-spanish:errors_spanish
	$pkgname-errors-swedish:errors_swedish
	$pkgname-errors-traditional_chinese:errors_traditional_chinese
	$pkgname-errors-turkish:errors_turkish
	$pkgname-errors-ukrainian-1251:errors_ukrainian_1251
	$pkgname-errors-ukrainian-koi8-u:errors_ukrainian_koi8_u
	$pkgname-errors-ukrainian-utf8:errors_ukrainian_utf8"

51
source="http://www.squid-cache.org/Versions/v2/2.7/${pkgname}-${_ver}.tar.bz2
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
52 53 54
	squid.initd
	squid.confd
	squid-2.7-gentoo.patch
55
	squid-2.7-ims-content-type.patch
56
	$pkgname.logrotate
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
57
	"
58 59
pkgusers="squid"
pkggroups="squid"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
60 61

build() {
62
	cd "$srcdir/$pkgname-$_ver"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
63 64

	patch -p1 -i "$srcdir"/squid-2.7-gentoo.patch || return 1
65
	patch -p1 -i "$srcdir"/squid-2.7-ims-content-type.patch || return 1
66

67 68
	touch NEWS AUTHORS
	aclocal && autoconf && automake -a || return 1
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
69 70 71

	./configure --prefix=/usr --datadir=/usr/share/squid \
		--sysconfdir=/etc/squid --libexecdir=/usr/lib/squid \
72 73
		--localstatedir=/var \
		--enable-auth="basic,digest,ntlm,negotiate" \
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
74 75 76
		--enable-removal-policies="lru,heap" \
		--enable-digest-auth-helpers="password" \
		--enable-storeio="aufs,ufs,diskd,coss,null" \
77
		--enable-basic-auth-helpers="getpwnam,NCSA,SMB,MSNT,multi-domain-NTLM,squid_radius_auth" \
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
78 79 80 81 82 83
		--enable-external-acl-helpers="ip_user,unix_group,wbinfo_group" \
		--enable-ntlm-auth-helpers="SMB,fakeauth,no_check" \
		--enable-delay-pools --enable-arp-acl --enable-ssl \
		--enable-linux-netfilter --enable-ident-lookups \
		--enable-useragent-log --enable-cache-digests --enable-referer-log \
		--enable-async-io --enable-truncate --enable-arp-acl \
84
		--enable-htcp --enable-carp --enable-poll --with-maxfd=4096 \
85 86
		--enable-follow-x-forwarded-for \
		 --with-large-files
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
87 88 89 90 91 92

	make || return 1
	make DESTDIR="$pkgdir" install

	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
93 94
	install -m644 -D "$srcdir"/$pkgname.logrotate \
		"$pkgdir"/etc/logrotate.d/squid
95

96 97 98 99
	install -d -o squid -g squid \
		"$pkgdir"/var/cache/squid \
		"$pkgdir"/var/log/squid \
		"$pkgdir"/var/run/squid
100
	chmod +x "$pkgdir"/usr/lib/squid/*
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
101 102 103 104 105 106 107 108 109 110 111 112 113
}


_mv_error() {
	local d=usr/share/squid/errors
	mkdir -p "$subpkgdir/$d"
	mv "$pkgdir/$d/${1}" "$subpkgdir/$d/" || return 1
	# last one removed the dir
	rmdir "$pkgdir/$d" 2>/dev/null
	return 0
}

errors_armenian() {
114
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
115 116 117 118
	_mv_error Armenian
}

errors_azerbaijani() {
119
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
120 121 122 123
	_mv_error Azerbaijani
}

errors_bulgarian() {
124
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
125 126 127 128
	_mv_error Bulgarian
}

errors_catalan() {
129
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
130 131 132 133
	_mv_error Catalan
}

errors_czech() {
134
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
135 136 137 138
	_mv_error Czech
}

errors_danish() {
139
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
140 141 142 143
	_mv_error Danish
}

errors_dutch() {
144
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
145 146 147 148
	_mv_error Dutch
}

errors_english() {
149
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
150 151 152 153
	_mv_error English
}

errors_estonian() {
154
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
155 156 157 158
	_mv_error Estonian
}

errors_finnish() {
159
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
160 161 162 163
	_mv_error Finnish
}

errors_french() {
164
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
165 166 167 168
	_mv_error French
}

errors_german() {
169
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
170 171 172 173
	_mv_error German
}

errors_greek() {
174
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
175 176 177 178
	_mv_error Greek
}

errors_hebrew() {
179
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
180 181 182 183
	_mv_error Hebrew
}

errors_hungarian() {
184
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
185 186 187 188
	_mv_error Hungarian
}

errors_italian() {
189
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
190 191 192 193
	_mv_error Italian
}

errors_japanese() {
194
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
195 196 197 198
	_mv_error Japanese
}

errors_korean() {
199
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
200 201 202 203
	_mv_error Korean
}

errors_lithuanian() {
204
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
205 206 207 208
	_mv_error Lithuanian
}

errors_polish() {
209
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
210 211 212 213
	_mv_error Polish
}

errors_portuguese() {
214
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
215 216 217 218
	_mv_error Portuguese
}

errors_romanian() {
219
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
220 221 222 223
	_mv_error Romanian
}

errors_russian_1251() {
224
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
225 226 227 228
	_mv_error Russian-1251
}

errors_russian_koi8_r() {
229
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
230 231 232 233
	_mv_error Russian-koi8-r
}

errors_serbian() {
234
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
235 236 237 238
	_mv_error Serbian
}

errors_simplify_chinese() {
239
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
240 241 242 243
	_mv_error Simplify_Chinese
}

errors_slovak() {
244
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
245 246 247 248
	_mv_error Slovak
}

errors_spanish() {
249
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
250 251 252 253
	_mv_error Spanish
}

errors_swedish() {
254
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
255 256 257 258
	_mv_error Swedish
}

errors_traditional_chinese() {
259
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
260 261 262 263
	_mv_error Traditional_Chinese
}

errors_turkish() {
264
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
265 266 267 268
	_mv_error Turkish
}

errors_ukrainian_1251() {
269
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
270 271 272 273
	_mv_error Ukrainian-1251
}

errors_ukrainian_koi8_u() {
274
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
275 276 277 278
	_mv_error Ukrainian-koi8-u
}

errors_ukrainian_utf8() {
279
	depends="$pkgname"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
280 281 282 283
	_mv_error Ukrainian-utf8
}


284
md5sums="c18b0371fca813d5e7c7e0baf87baa22  squid-2.7.STABLE7.tar.bz2
285
57fed05adc40acab6a5480ec7a014154  squid.initd
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
286
44b052db7910f386ef88ddcf69c9ba4e  squid.confd
287
3827f71d940b47eb385a1a1d92a51d66  squid-2.7-gentoo.patch
288
549377b5a6b673bf19ea6c34003d122c  squid-2.7-ims-content-type.patch
289
58823e0b86bc2dc71d270208b7b284b4  squid.logrotate"