aboutsummaryrefslogtreecommitdiffstats
path: root/main/nginx/APKBUILD
blob: 3a62af968a6f3ee6b06c57ab596ef3abb6c08157 (plain)
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
# Maintainer: Cameron Banta <cbanta@gmail.com>
# Contributor: Jeff Bilyk <jbilyk@gmail.com>
# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>

pkgname=nginx
pkgver=1.6.3
_nginxrtmpver=1.1.6
pkgrel=0
pkgdesc="lightweight HTTP and reverse proxy server"
url="http://www.nginx.org"
arch="all"
license="Custom"
pkgusers="nginx"
pkggroups="nginx"
install="$pkgname.pre-install $pkgname.pre-upgrade"
makedepends="pcre-dev openssl-dev zlib-dev"
subpackages="$pkgname-doc $pkgname-vim:vim"
source="http://nginx.org/download/$pkgname-$pkgver.tar.gz
	nginx-rtmp-module-$_nginxrtmpver.tar.gz::https://github.com/arut/nginx-rtmp-module/archive/v$_nginxrtmpver.tar.gz
	musl-crypt-fix.patch
	ipv6.patch

	nginx.initd
	nginx.logrotate
	"

_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
	done
}

_rundir=/var/run/$pkgname
_logdir=/var/log/$pkgname
_homedir=/var/lib/$pkgname
_tmpdir=$_homedir/tmp
_datadir=/usr/share/$pkgname
_confdir=/etc/$pkgname

build() {
	cd "$_builddir"
	./configure \
		--prefix=$_datadir \
		--sbin-path=/usr/sbin/$pkgname \
		--conf-path=$_confdir/$pkgname.conf \
		--pid-path=$_rundir/$pkgname.pid \
		--lock-path=$_rundir/$pkgname.lock \
		--error-log-path=$_logdir/error.log \
		--http-log-path=$_logdir/access.log \
		--http-client-body-temp-path=$_tmpdir/client_body \
		--http-proxy-temp-path=$_tmpdir/proxy \
		--http-fastcgi-temp-path=$_tmpdir/fastcgi \
		--http-uwsgi-temp-path=$_tmpdir/uwsgi \
		--http-scgi-temp-path=$_tmpdir/scgi \
		--user=nginx \
		--group=nginx \
		--with-ipv6 \
		--with-pcre-jit \
		--with-http_dav_module \
		--with-http_ssl_module \
		--with-http_stub_status_module \
		--with-http_gzip_static_module \
		--with-http_spdy_module \
		--with-mail \
		--with-mail_ssl_module \
		--add-module="$srcdir/nginx-rtmp-module-$_nginxrtmpver" \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" INSTALLDIRS=vendor install || return 1

	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.logrotate \
		"$pkgdir"/etc/logrotate.d/$pkgname

	install -m644 -D LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
	install -m644 -D man/$pkgname.8 "$pkgdir"/usr/share/man/man8/$pkgname.8

	install -d -m0755 "$pkgdir"/$_confdir/conf.d || return 1
	install -d -m0755 "$pkgdir"/$_confdir/default.d || return 1
	install -d -m0755 "$pkgdir"/var/www/localhost/htdocs || return 1
	install -d -m0700 "$pkgdir"/$_homedir || return 1
	install -d -m0700 "$pkgdir"/$_tmpdir || return 1
	install -d -m0700 "$pkgdir"/$_logdir || return 1
}

vim() {
	local t

	depends=""
	pkgdesc="Vim syntax for Nginx"
	arch="noarch"

	for t in ftdetect syntax indent; do
		install -Dm644 "$_builddir"/contrib/vim/$t/$pkgname.vim \
			"$subpkgdir"/usr/share/vim/vimfiles/$t/$pkgname.vim
	done
}

md5sums="ea813aee2c344c2f5b66cdb24a472738  nginx-1.6.3.tar.gz
ceca9874cd89e6027fae8178f5c3af86  nginx-rtmp-module-1.1.6.tar.gz
3aeb488921109e60d02ed64d36790aeb  musl-crypt-fix.patch
801a87f7f9d27f8ad85b41a78b4c4461  ipv6.patch
8c586f7a2fdce37e16717b76acccf471  nginx.initd
d3f30c25c84c55252a6babd9e9b0325b  nginx.logrotate"
sha256sums="0a98e95b366e4d6042f331e1fa4d70e18fd1e49d8993e589008e70e742b7e757  nginx-1.6.3.tar.gz
4039d1e7febd93188f729b594772d04d8a1137b2e90b12fa53bb061f200add87  nginx-rtmp-module-1.1.6.tar.gz
8c398640bd379c1c6a2fafcd2b3848a72902e47924e8e2490b312c141eec5d70  musl-crypt-fix.patch
a24ef5843ae0afa538b00c37eb7da7870f9d7f146f52a9668678f7296cf71d9b  ipv6.patch
d358482795e5f550852652ad246c4e1c8253355fdb26cc58f6d849a2a507f6c2  nginx.initd
6b89872994508cc7b4b225bca3301d7942767f37b8b691134141d95995740890  nginx.logrotate"
sha512sums="b6e59a8379ab8bcd999611808c431045553a3a45e9c67490a79c75ab753216c3c4f469968dd05d7b6404b3d976905f013435e908f324ac5e0d24ab0ff418cb2f  nginx-1.6.3.tar.gz
6db0cc5a3cff600a836483f9cc4ff76860e9c893167561ad818cb41e2eb4fa31af8a4213e42c7c5766e389aed0ad713cffe776aa4bc4ebf279dd63eb65d4162c  nginx-rtmp-module-1.1.6.tar.gz
21114c775e4bdd1f7b8b9abc143284945e96ed1d8c49904ddf918abad87b16253f918ba47976cd2df32f0fdb8a7dad399d4200e879db2da6cf93a28aab236a75  musl-crypt-fix.patch
68d64a84568ec2df0366925ab282a05ebe21a85044b6c7844a47573cfd8cc8ed119cc772358bc3fff36e2d4fdf583a730592825f5f98632993ca86d1f8438d5f  ipv6.patch
fd7ceddee6e75e6c799fe9ec14e2ef7295f93b5c511f8f79a9f5fda9eaf0677d66d26184eea32f12479c620d8956cd657670c67e04d2d014447b441990996412  nginx.initd
fda91710185d6b801dd746c8c3678b5719b408de0b715bef7b1985f1ee17db1e8378d440759ea6234b1f70454a35870a2917bd1d6cd309ddc70e1c066fc8d4b8  nginx.logrotate"