aboutsummaryrefslogtreecommitdiffstats
path: root/main/nginx-lua/APKBUILD
blob: 8dd0ead08ac76ad834ae130d47a5050958ae011f (plain) (blame)
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
# Maintainer: Cameron Banta <cbanta@gmail.com>
# Contributor: Jeff Bilyk <jbilyk@gmail.com>
# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
# Contributor: Timo Teräs <timo.teras@iki.fi>

pkgname=nginx-lua
_pkgname=nginx
pkgver=1.8.0
_ngx_rtmp_ver=1.1.7
_ngx_devel_kit_ver=0.2.19
_ngx_lua_ver=0.9.16
pkgrel=5
pkgdesc="lightweight HTTP and reverse proxy server with Lua support"
url="http://www.nginx.org"
arch="all"
license="custom"
pkgusers="nginx"
pkggroups="nginx"
install=""
depends="!nginx nginx-initscripts"
subpackages="$pkgname-doc"
makedepends="pcre-dev openssl-dev zlib-dev luajit-dev paxmark linux-headers"
source="http://nginx.org/download/$_pkgname-$pkgver.tar.gz
	nginx-devel-kit-$_ngx_devel_kit_ver.tar.gz::https://github.com/simpl/ngx_devel_kit/archive/v$_ngx_devel_kit_ver.tar.gz
	nginx-rtmp-module-$_ngx_rtmp_ver.tar.gz::https://github.com/arut/nginx-rtmp-module/archive/v$_ngx_rtmp_ver.tar.gz
	lua-nginx-module-$_ngx_lua_ver.tar.gz::https://github.com/openresty/lua-nginx-module/archive/v$_ngx_lua_ver.tar.gz

	ipv6.patch
	"

_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-file-aio \
		--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-http_auth_request_module \
		--with-mail \
		--with-mail_ssl_module \
		--add-module="$srcdir/nginx-rtmp-module-$_ngx_rtmp_ver" \
		--add-module="$srcdir/ngx_devel_kit-$_ngx_devel_kit_ver" \
		--add-module="$srcdir/lua-nginx-module-$_ngx_lua_ver" \
		|| return 1
	make || return 1
}

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

	local paxflags="-m"
	[ "$CARCH" = "x86" ] && paxflags="-msp"
	paxmark "$paxflags" "$pkgdir"/usr/sbin/$_pkgname || 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
}

md5sums="3ca4a37931e9fa301964b8ce889da8cb  nginx-1.8.0.tar.gz
09a18178adca7b5674129d8100ce4f68  nginx-devel-kit-0.2.19.tar.gz
8006de2560db3e55bb15d110220076ac  nginx-rtmp-module-1.1.7.tar.gz
4041309464989fe3970c5a0efa931d53  lua-nginx-module-0.9.16.tar.gz
801a87f7f9d27f8ad85b41a78b4c4461  ipv6.patch"
sha256sums="23cca1239990c818d8f6da118320c4979aadf5386deda691b1b7c2c96b9df3d5  nginx-1.8.0.tar.gz
501f299abdb81b992a980bda182e5de5a4b2b3e275fbf72ee34dd7ae84c4b679  nginx-devel-kit-0.2.19.tar.gz
7922b0e3d5f3d9c4b275e4908cfb8f5fb1bfb3ac2df77f4c262cda56df21aab3  nginx-rtmp-module-1.1.7.tar.gz
a3cda55b8cba5bc6632aa270b8a02d543fdb43f4d60a3bd2cb411c2a3b467656  lua-nginx-module-0.9.16.tar.gz
a24ef5843ae0afa538b00c37eb7da7870f9d7f146f52a9668678f7296cf71d9b  ipv6.patch"
sha512sums="3e5d7e1b01839b2638251c47046149450b9b65985e611ef55e5953846e9eb0128c3708c695540ad4dfd0ce5e3060dfecb51213403048fab1a99dd5cea94f0038  nginx-1.8.0.tar.gz
915954acf16a27fbd3c93c154012d38e864f1d8dfd51cde401bba26e46eb3e3c778ec4c92f4f8ed83ac001e96cee72765554d0e4da06acf6a4be5184b23b3657  nginx-devel-kit-0.2.19.tar.gz
9883462a04683f1e7af175da04b86d259ff6d677864667588fb073143f7130969eb2a5a5a48ddceda7a555b908580f179bdcacb7f0111413d51db5bfe43b396e  nginx-rtmp-module-1.1.7.tar.gz
01be7dca10c1c1f25d2b8e65c9944662d5ba0235ecccba1143f7c30dcb76fad847a4a2fa7a34055906a33d50ecf8fb463aac9f76581390035a88e48c9b9f5319  lua-nginx-module-0.9.16.tar.gz
68d64a84568ec2df0366925ab282a05ebe21a85044b6c7844a47573cfd8cc8ed119cc772358bc3fff36e2d4fdf583a730592825f5f98632993ca86d1f8438d5f  ipv6.patch"