# Maintainer: Stuart Cardall # Maintainer: Cameron Banta # Contributor: Jeff Bilyk # Contributor: Bartłomiej Piotrowski pkgname=nginx-naxsi _pkgname=nginx pkgver=1.9.0 _ngx_naxsi_ver=0.54rc2 _ngx_cache_purge_ver=2.3 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 openssl-dev zlib-dev paxmark" _upstreamfair_sha="a18b4099fbd458111983200e098b6f0c8efed4bc" _httpsysguard_sha="3fcdf27ff91482e1e54eb6fae4e059e814b85d78" 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.zip::https://github.com/gnosek/nginx-upstream-fair/tarball/${_upstreamfair_sha}.zip sysguard.zip::https://github.com/alibaba/nginx-http-sysguard/archive/${_httpsysguard_sha}.zip 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 \ --add-module="$srcdir/naxsi-$_ngx_naxsi_ver/naxsi_src" \ --add-module="$srcdir/nginx-http-sysguard-master" \ --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-ipv6 \ --with-pcre-jit \ --with-http_ssl_module \ --with-http_gzip_static_module \ --with-http_spdy_module \ --without-mail_pop3_module \ --without-mail_smtp_module \ --without-mail_imap_module \ --without-http_uwsgi_module \ --without-http_scgi_module \ --with-http_realip_module \ --with-http_stub_status_module \ --with-http_auth_request_module \ --add-module="$srcdir/ngx_cache_purge-$_ngx_cache_purge_ver" \ --add-module="$srcdir/nginx-upstream-fair-master" \ || 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 } md5sums="487c26cf0470d8869c41a73621847268 nginx-1.9.0.tar.gz 6b091c34a0aa76184effaaeb26af7c09 naxsi-0.54rc2.tar.gz dc4c0688ed03ca7f5563097c2a8a76ca ngx_cache_purge-2.3.tar.gz aed2bd7f224af5092d52ae7abe8483c4 upstream-fair.zip 3e9b9b6dfaba87b01d73b38341e09bed sysguard.zip a07569b8a023f1b89dcd11e0beda4df6 anonymise.patch 801a87f7f9d27f8ad85b41a78b4c4461 ipv6.patch 50357b75049d878c0bcce10d0c60f9ed sysguard.patch 609ea97ab6c3c30f9e8329968aadc4f3 nginx.initd 8823274a834332d3db4f62bf7dd1fb7d nginx.logrotate" sha256sums="e12aa1d5b701edde880ebcc7be47ca171c3fbeed8fa7c8c62054a6f19d27f248 nginx-1.9.0.tar.gz 2f7f2c0fb4dacf489febb719e7834a2b16c9b471e16ef1125e7f87174defeecc naxsi-0.54rc2.tar.gz cb7d5f22919c613f1f03341a1aeb960965269302e9eb23425ccaabd2f5dcbbec ngx_cache_purge-2.3.tar.gz 37eae38c3b868e07a1066d27b507d8721448f1c5329c1c8381b379cd5536af27 upstream-fair.zip 3d77b9a131750a0cb011f8b561c0755968a303db54bb34fee9b0d08906f4f977 sysguard.zip 1923ebdb4a64a22f8903c3da619677bd3aaf769c99bee1aa4262edac58f05ba3 anonymise.patch a24ef5843ae0afa538b00c37eb7da7870f9d7f146f52a9668678f7296cf71d9b ipv6.patch 18090329435c32d91621a5943acc5b8bbe89aaa3c2fa334c3a4cdeb00efb6226 sysguard.patch 8cbef405295eac299dfc3b9b119c02bda354a9b335923bed6ff6992c1fd8f493 nginx.initd cea0c6f8de55a4c3a3eccc57910de1c3116634082c8e5b660630fb927a29f38d nginx.logrotate" sha512sums="a7750b8b9a0c89b2de9467b14b4af6fb61e5064995a6ef7bb04cd10424ce4fd2fda31eee0f24551c222ceef491be4621e88d30708f3b2cc088767c8e8bb70589 nginx-1.9.0.tar.gz cd79ed8aa51482edaa68bd6f34cd64848bb990a31452fe4da14b17bf94a178102892fb51868cdc39d7712b523a0d3a85135af3f9d02f7eb566a0b87fc0cf6414 naxsi-0.54rc2.tar.gz 81929ca57ce5c2e1af6ec43882a54ff1da8dc77786bfb7505ff94fbcf970ae8870b419dc5c0bc7b80794d75a359e0100f360c1cf458a300f802b1d8bd7053811 ngx_cache_purge-2.3.tar.gz ccbc38737bf40e4000a73e25d8b9bf7e0fc62862dd22329e9ea3aac23dbcf9a68fcdbb92eb07500ad5dbeac233c5956b0c7db32d368f8ddc523c4319ba1531e2 upstream-fair.zip 6b1033a8dd25f513f6c0f3707f68300a2698390b624c5556a6dbf252dbc4a37eb3c0c0e57e81fedaa4de92d5e75609b2df37575e718b38abd381acd90a6011ac sysguard.zip 5899097b6b6ed04deb7ae474fb65205d9c50843f30929c1370c0c1d70df3f02fe51b8ea90d3d2c3b4c53aeb3895717729e0c9773b880ca529e89a5b07fc26a5b anonymise.patch 68d64a84568ec2df0366925ab282a05ebe21a85044b6c7844a47573cfd8cc8ed119cc772358bc3fff36e2d4fdf583a730592825f5f98632993ca86d1f8438d5f ipv6.patch 2dca2ac74fb92e330fde7b6b6120b2fd2565c377a629c9536cf77beebe41aa4b092d4229d5b487b0fb02be4f2cc5b897c429c87bbbbc7b0d31e1cbb94231ddce sysguard.patch 6e9a37176c0ca5a463a2745401bc5a6f9c002a236244b615a2803ec04404cc768678a1fa27ee047f81f4ccf002f7bea4b803522049f4ef839c61bb83577b9d65 nginx.initd 01b77cff16f6e8bfd7fa1d4d20f625bbcddd08f0509173452d060c342c93dc315a7b0560f4734323a5d29ea294de0491f2e3f32e5337574e1a28ebc005eceea8 nginx.logrotate"