APKBUILD 3.76 KB
Newer Older
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
1
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
2
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
3
pkgname=squid
4
pkgver=3.5.27
Natanael Copa's avatar
Natanael Copa committed
5
pkgrel=1
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
6 7
pkgdesc="A full-featured Web proxy cache server."
url="http://www.squid-cache.org"
8
install="squid.pre-install squid.pre-upgrade"
9 10
pkgusers="squid"
pkggroups="squid"
11
arch="all"
12
license="GPL2"
13
depends="logrotate"
14
makedepends="libressl-dev perl-dev autoconf automake heimdal-dev libtool
15
	libcap-dev linux-headers"
16
subpackages="$pkgname-doc"
Natanael Copa's avatar
Natanael Copa committed
17
linguas="af ar az bg ca cs da de el es et fa fi fr he hu hy id it ja ka ko lt
18 19 20
	lv ms nl oc pl pt ro ru sk sl sr sv th tr uk uz vi zh"
langdir="/usr/share/squid/errors"

21
source="http://www.squid-cache.org/Versions/v3/${pkgver%.*}/squid-${pkgver}.tar.xz
22
	bug-3679.patch
Natanael Copa's avatar
Natanael Copa committed
23
	CVE-2019-13345.patch
24

Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
25 26
	squid.initd
	squid.confd
27
	$pkgname.logrotate
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
28
	"
29

30 31
pkgusers="squid"
pkggroups="squid"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
32

33
# secfixes:
Natanael Copa's avatar
Natanael Copa committed
34 35
#   3.5.27-r1:
#     - CVE-2019-13345
36 37 38 39
#   3.5.27-r0:
#     - CVE-2018-1000024
#     - CVE-2018-1000027

40 41 42 43 44 45 46
_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
47
	done
48
	find -name config.sub | xargs chmod u+w
49
}
50

51 52
build() {
	cd "$_builddir"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
53

54 55 56 57
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
58 59 60
		--datadir=/usr/share/squid \
		--sysconfdir=/etc/squid \
		--libexecdir=/usr/lib/squid \
61
		--localstatedir=/var \
62
		--with-logdir=/var/log/squid \
63
		--disable-strict-error-checking \
64
		--disable-arch-native \
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
65
		--enable-removal-policies="lru,heap" \
Natanael Copa's avatar
Natanael Copa committed
66
		--enable-auth-digest \
Timo Teräs's avatar
Timo Teräs committed
67
		--enable-auth-basic="getpwnam,NCSA,SMB,SMB_LM,RADIUS" \
68
		--enable-epoll \
69
		--enable-external-acl-helpers="file_userip,unix_group,wbinfo_group,session" \
Natanael Copa's avatar
Natanael Copa committed
70 71
		--enable-auth-ntlm="fake,smb_lm" \
		--enable-auth-negotiate="kerberos,wrapper" \
72 73 74 75
		--disable-mit \
		--enable-heimdal \
		--enable-delay-pools \
		--enable-arp-acl \
Natanael Copa's avatar
Natanael Copa committed
76 77
		--enable-openssl \
		--enable-ssl-crtd \
78 79 80 81 82 83 84 85 86 87
		--enable-linux-netfilter \
		--enable-ident-lookups \
		--enable-useragent-log \
		--enable-cache-digests \
		--enable-referer-log \
		--enable-async-io \
		--enable-truncate \
		--enable-arp-acl \
		--enable-htcp \
		--enable-carp \
88
		--enable-poll \
89
		--enable-follow-x-forwarded-for \
90
		--with-large-files \
91
		--with-default-user=squid \
Natanael Copa's avatar
Natanael Copa committed
92
		--with-openssl \
93
		|| return 1
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
94 95

	make || return 1
96 97 98 99
}

package() {
	cd "$_builddir"
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
100 101 102 103
	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
104 105
	install -m644 -D "$srcdir"/$pkgname.logrotate \
		"$pkgdir"/etc/logrotate.d/squid
106

107 108 109 110
	install -d -o squid -g squid \
		"$pkgdir"/var/cache/squid \
		"$pkgdir"/var/log/squid \
		"$pkgdir"/var/run/squid
111
	chmod +x "$pkgdir"/usr/lib/squid/*
Carlo Lanmdeter's avatar
Carlo Lanmdeter committed
112 113
}

114 115 116 117 118
squid_kerb_auth() {
	pkgdesc="Squid kerberos authetication helper"
	install -d "$subpkgdir"/usr/lib/squid
	mv "$pkgdir"/usr/lib/squid/squid_kerb_auth "$subpkgdir"/usr/lib/squid/
}
119 120
sha512sums="4172a053c3b7ffe7a12dfb3febac96942d0fbbe7e98e3f797f22cd75b0a3a89cbbfe7260b5daad099e79d5e9303bb5dfbfee7499cb30a90590aa1bd242ff4817  squid-3.5.27.tar.xz
a403573bf3d3d600f7a1ff8639f0f48ac45963b028c7aa09e00f95173b7a9d46c42c21a609d987a18869d850a4be0537c3dc0d0f10398b67509b2a43ccf81776  bug-3679.patch
Natanael Copa's avatar
Natanael Copa committed
121
9ca3f86fbce36f109a35c35cdb0a9ed21a6fe5cbe7bbb4b92f4527fedd57c19599d338087b099e048084db0374b2ea28bdcbe1798fa37aea8a13d54f6cc0d6a4  CVE-2019-13345.patch
122
15d95f7d787be8c2e6619ef1661fd8aae8d2c1ede706748764644c7dc3d7c34515ef6e8b7543295fddc4e767bbd74a7cf8c42e77cf60b3d574ff11b3f6e336c9  squid.initd
123
7292661de344e8a87d855c83afce49511685d2680effab3afab110e45144c0117935f3bf73ab893c9e6d43f7fb5ba013635e24f6da6daf0eeb895ef2e9b5baa9  squid.confd
Natanael Copa's avatar
Natanael Copa committed
124
89a703fa4f21b6c7c26e64a46fd52407e20f00c34146ade0bea0c4b63d050117c0f8e218f2256a1fbf6abb84f4ec9b0472c9a4092ff6e78f07c4f5a25d0892a5  squid.logrotate"