aboutsummaryrefslogtreecommitdiffstats
path: root/testing/nginx-naxsi/APKBUILD
blob: d12181a1ba4a3c5bef4b1800667309be33f0dbdc (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
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
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
# Contributor: Cameron Banta <cbanta@gmail.com>
# Contributor: Jeff Bilyk <jbilyk@gmail.com>
# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>

pkgname=nginx-naxsi
_pkgname=nginx
pkgver=1.11.5
_ngx_naxsi_ver=0.55.1
_ngx_cache_purge_ver=2.3
_ngx_upstream_fair_ver=0.1.0
_ngx_http_sysguard_ver=2.1.0
pkgrel=1
pkgdesc="lightweight HTTP and reverse proxy server with Naxsi WAF support, see also 'nxapi'"
url="http://www.nginx.org | https://github.com/nbs-system/naxsi"
arch="all"
license="custom"
install="$pkgname.pre-install $pkgname.pre-upgrade"
depends="!nginx"
makedepends="pcre-dev libressl-dev zlib-dev paxmark linux-headers"
subpackages="$pkgname-doc $pkgname-vim:vim"
source="http://nginx.org/download/$_pkgname-$pkgver.tar.gz
	naxsi-$_ngx_naxsi_ver.tar.gz::https://github.com/nbs-system/naxsi/archive/$_ngx_naxsi_ver.tar.gz
	ngx_cache_purge-$_ngx_cache_purge_ver.tar.gz::https://github.com/FRiCKLE/ngx_cache_purge/archive/$_ngx_cache_purge_ver.tar.gz
	upstream-fair-$_ngx_upstream_fair_ver.tar.gz::https://github.com/hnlq715/nginx-upstream-fair/archive/v$_ngx_upstream_fair_ver.tar.gz
	sysguard-$_ngx_http_sysguard_ver.tar.gz::https://github.com/itoffshore/nginx-http-sysguard/archive/$_ngx_http_sysguard_ver.tar.gz

	anonymise.patch
	ipv6.patch
	sysguard.patch

	nginx.initd
	nginx.logrotate
	"

_builddir="$srcdir"/$_pkgname-$pkgver

prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	./configure \
		--prefix=/usr \
		--conf-path=/etc/$_pkgname/$_pkgname.conf \
		--pid-path=/var/run/$_pkgname.pid \
		--lock-path=/var/run/$_pkgname.lock \
		--error-log-path=/var/log/$_pkgname/error.log \
		--http-log-path=/var/log/$_pkgname/access.log \
		--http-client-body-temp-path=/tmp/$_pkgname/client-body \
		--http-proxy-temp-path=/tmp/$_pkgname/proxy \
		--http-fastcgi-temp-path=/tmp/$_pkgname/fastcgi \
		--user=nginx \
		--group=nginx \
		--with-http_ssl_module \
		--with-http_realip_module \
		--with-http_addition_module \
		--with-http_sub_module \
		--with-http_dav_module \
		--with-http_flv_module \
		--with-http_mp4_module \
		--with-http_gunzip_module \
		--with-http_gzip_static_module \
		--with-http_random_index_module \
		--with-http_secure_link_module \
		--with-http_stub_status_module \
		--with-http_auth_request_module \
		--with-threads \
		--with-stream \
		--with-stream_ssl_module \
		--with-http_slice_module \
		--with-mail \
		--with-mail_ssl_module \
		--with-file-aio \
		--with-http_v2_module \
		--without-http_uwsgi_module \
		--without-http_scgi_module \
		--add-module="$srcdir/naxsi-$_ngx_naxsi_ver/naxsi_src" \
		--add-module="$srcdir/ngx_cache_purge-$_ngx_cache_purge_ver" \
		--add-module="$srcdir/nginx-upstream-fair-$_ngx_upstream_fair_ver" \
		--add-module="$srcdir/nginx-http-sysguard-$_ngx_http_sysguard_ver" \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install

	local paxflags="-m"
	[ "$CARCH" = "x86" ] && paxflags="-msp"
	paxmark "$paxflags" "$pkgdir"/usr/sbin/nginx || 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 "$srcdir"/naxsi-$_ngx_naxsi_ver/naxsi_config/naxsi_core.rules "$pkgdir"/etc/nginx/naxsi_core.rules
}

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="db43f2b19746f6f47401c3afc3924dc6  nginx-1.11.5.tar.gz
b894ea5327a3d102a56aeddb79d2e047  naxsi-0.55.1.tar.gz
dc4c0688ed03ca7f5563097c2a8a76ca  ngx_cache_purge-2.3.tar.gz
f3562ef6573f616e254d382d6f86b8e1  upstream-fair-0.1.0.tar.gz
fdb072dc8d67b573a0ea7983530a7d2b  sysguard-2.1.0.tar.gz
31d29937da95b31714faa399aeb07407  anonymise.patch
f478d8391dafa32a8b0b3a9f21d7a080  ipv6.patch
50357b75049d878c0bcce10d0c60f9ed  sysguard.patch
609ea97ab6c3c30f9e8329968aadc4f3  nginx.initd
8823274a834332d3db4f62bf7dd1fb7d  nginx.logrotate"
sha256sums="223f8a2345a75f891098cf26ccdf208b293350388f51ce69083674c9432db6f6  nginx-1.11.5.tar.gz
45dd0df7a6b0b6aa9c64eb8c39a8e294d659d87fb18e192cf58f1402f3cdb0a8  naxsi-0.55.1.tar.gz
cb7d5f22919c613f1f03341a1aeb960965269302e9eb23425ccaabd2f5dcbbec  ngx_cache_purge-2.3.tar.gz
dd0bfb79d2489f48ea63ac004d91890cd471eb4020500ce9179c3612cb13246c  upstream-fair-0.1.0.tar.gz
97e0cc9a36fcce375c5b0667b002d2f7acd580e968a2318e3276fbdc1b99f8e4  sysguard-2.1.0.tar.gz
28adf3605875197d5822fa382f5fd3c9c80f7d3a561e904fee223fa051f98810  anonymise.patch
4a1a24a92657432012f08c52e8099c7abae390c9c4cb76483cacd012e26a57ac  ipv6.patch
18090329435c32d91621a5943acc5b8bbe89aaa3c2fa334c3a4cdeb00efb6226  sysguard.patch
8cbef405295eac299dfc3b9b119c02bda354a9b335923bed6ff6992c1fd8f493  nginx.initd
cea0c6f8de55a4c3a3eccc57910de1c3116634082c8e5b660630fb927a29f38d  nginx.logrotate"
sha512sums="f41b21b5d8c6b7fe7f8713e96fb6b1c40da49bf64ebb790fb5aa38f036a37b36fcf048ff72c2216552b2f75366b30c5fcdef26312bd4e5515b2476a1cd944b8c  nginx-1.11.5.tar.gz
aebda20e5b78e9111b7bac1e15829258e6b85b80e4ce333e4dba8caead36287b3f0fcb453c51d7c59f07d637fa62f5c6b23aecd3bf6a3c3da4abebf1a6689f14  naxsi-0.55.1.tar.gz
81929ca57ce5c2e1af6ec43882a54ff1da8dc77786bfb7505ff94fbcf970ae8870b419dc5c0bc7b80794d75a359e0100f360c1cf458a300f802b1d8bd7053811  ngx_cache_purge-2.3.tar.gz
2ff9894986c5cd483ecee97d8818675ef6d063e5f45bb66e8cf56c78bbd043b9c0c37eb3cf650b7cfb6d40da9f7a4ba0e030fe39de5ef1f715cbcd6560248428  upstream-fair-0.1.0.tar.gz
f9587b8aa7a2b09be016dc6f7a07fe3fee154d16172194e899bf3c78a3f4e373c78f79932794cd9ac75793514c606ab878f88be9400b70e37528d263f1541b34  sysguard-2.1.0.tar.gz
f8e46dafcf553edd35699dc2a47a54756e0a4c690fc13f81436ad9db1026739ba331ad99d3d05d8a7c089a5c067bf45f4aca3a98fdd9483b7b0123a837e695be  anonymise.patch
cae9f842c3d1188730d4355440476ad2338b19c027c4b329efe88d4487e90d96bf60dea6feb4be6a6f96d4b356fc154345e32c2bb643d70f68e428df26330a49  ipv6.patch
2dca2ac74fb92e330fde7b6b6120b2fd2565c377a629c9536cf77beebe41aa4b092d4229d5b487b0fb02be4f2cc5b897c429c87bbbbc7b0d31e1cbb94231ddce  sysguard.patch
6e9a37176c0ca5a463a2745401bc5a6f9c002a236244b615a2803ec04404cc768678a1fa27ee047f81f4ccf002f7bea4b803522049f4ef839c61bb83577b9d65  nginx.initd
01b77cff16f6e8bfd7fa1d4d20f625bbcddd08f0509173452d060c342c93dc315a7b0560f4734323a5d29ea294de0491f2e3f32e5337574e1a28ebc005eceea8  nginx.logrotate"