diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-08-10 03:49:52 +0200 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2016-08-15 20:47:27 +0200 |
commit | eeae9ddc6feb90215dc935559a8377f620f33725 (patch) | |
tree | 8c65d94c1bd2931717e7a55e87bf9a063b7f26f7 /main/nginx/APKBUILD | |
parent | 300aa7e138f99667f4b259e9378e57ec3ad9791e (diff) | |
download | aports-eeae9ddc6feb90215dc935559a8377f620f33725.tar.bz2 aports-eeae9ddc6feb90215dc935559a8377f620f33725.tar.xz |
main/nginx: use dynamic modules where possible, add new subpackages
Naming scheme for submodule subpackages is the same as Fedora and
Debian uses.
Diffstat (limited to 'main/nginx/APKBUILD')
-rw-r--r-- | main/nginx/APKBUILD | 122 |
1 files changed, 65 insertions, 57 deletions
diff --git a/main/nginx/APKBUILD b/main/nginx/APKBUILD index 8cfbdace40..040e15f7a2 100644 --- a/main/nginx/APKBUILD +++ b/main/nginx/APKBUILD @@ -1,10 +1,11 @@ # Maintainer: Cameron Banta <cbanta@gmail.com> # Contributor: Jeff Bilyk <jbilyk@gmail.com> # Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl> +# Contributor: Jakub Jirutka <jakub@jirutka.cz> pkgname=nginx pkgver=1.10.1 -pkgrel=2 +pkgrel=3 pkgdesc="HTTP and reverse proxy server" url="http://www.nginx.org/en" arch="all" @@ -14,23 +15,27 @@ license="custom" _devel_kit_name=ngx_devel_kit _devel_kit_ver=0.3.0 _devel_kit_dir="$srcdir/$_devel_kit_name-$_devel_kit_ver" +_devel_kit_so="ndk_http_module.so" _http_lua_name=lua-nginx-module _http_lua_ver=0.10.5 _http_lua_dir="$srcdir/$_http_lua_name-$_http_lua_ver" +_http_lua_depends="$pkgname-mod-devel-kit" _rtmp_name=nginx-rtmp-module -_rtmp_ver=1.1.7 +_rtmp_ver=1.1.9 _rtmp_dir="$srcdir/$_rtmp_name-$_rtmp_ver" -depends="$pkgname-common !$pkgname-rtmp !$pkgname-lua" -makedepends="perl-dev pcre-dev openssl-dev zlib-dev luajit-dev paxmark linux-headers" +depends="" +makedepends="linux-headers gd-dev geoip-dev libxml2-dev libxslt-dev luajit-dev + openssl-dev pcre-dev perl-dev zlib-dev" pkgusers="nginx" _grp_ngx="nginx" _grp_www="www-data" pkggroups="$_grp_ngx $_grp_www" -install="$pkgname-common.pre-install" -subpackages="$pkgname-doc $pkgname-common $pkgname-vim $pkgname-rtmp $pkgname-lua" +install="$pkgname.pre-install $pkgname.post-upgrade" +subpackages="$pkgname-doc $pkgname-vim" +replaces="$pkgname-common $pkgname-initscripts" source="http://nginx.org/download/$pkgname-$pkgver.tar.gz $_devel_kit_name-$_devel_kit_ver.tar.gz::https://github.com/simpl/$_devel_kit_name/archive/v$_devel_kit_ver.tar.gz $_http_lua_name-$_http_lua_ver.tar.gz::https://github.com/openresty/$_http_lua_name/archive/v$_http_lua_ver.tar.gz @@ -41,13 +46,29 @@ source="http://nginx.org/download/$pkgname-$pkgver.tar.gz " builddir="$srcdir/$pkgname-$pkgver" -_build() { - local binary=$1 - shift +_modules_dir="usr/lib/$pkgname/modules" +_modules=" + http-geoip + http-image-filter + http-perl + http-xslt-filter + mail + stream + devel-kit + http-lua + rtmp" +for _m in $_modules; do + subpackages="$subpackages $pkgname-mod-$_m:_module" +done + + +build() { + cd "$builddir" ./configure \ --prefix=/var/lib/$pkgname \ --sbin-path=/usr/sbin/$pkgname \ + --modules-path=/$_modules_dir \ --conf-path=/etc/$pkgname/$pkgname.conf \ --pid-path=/run/$pkgname/$pkgname.pid \ --lock-path=/run/$pkgname/$pkgname.lock \ @@ -56,6 +77,7 @@ _build() { --http-fastcgi-temp-path=/var/lib/$pkgname/tmp/fastcgi \ --http-uwsgi-temp-path=/var/lib/$pkgname/tmp/uwsgi \ --http-scgi-temp-path=/var/lib/$pkgname/tmp/scgi \ + --with-perl_modules_path=/usr/lib/perl5/vendor_perl \ \ --user=$pkgusers \ --group=$_grp_ngx \ @@ -67,6 +89,9 @@ _build() { --with-http_v2_module \ --with-http_realip_module \ --with-http_addition_module \ + --with-http_xslt_module=dynamic \ + --with-http_image_filter_module=dynamic \ + --with-http_geoip_module=dynamic \ --with-http_sub_module \ --with-http_dav_module \ --with-http_flv_module \ @@ -78,31 +103,18 @@ _build() { --with-http_secure_link_module \ --with-http_slice_module \ --with-http_stub_status_module \ - --with-mail \ + --with-http_perl_module=dynamic \ + --with-mail=dynamic \ --with-mail_ssl_module \ - --with-stream \ + --with-stream=dynamic \ --with-stream_ssl_module \ - $@ || return 1 - - make || return 1 - - mv objs/$pkgname objs/$binary -} - -build() { - cd "$builddir" - - _build $pkgname-lua --build="rtmp,lua" \ - --add-module="$_devel_kit_dir" \ - --add-module="$_rtmp_dir" \ - --add-module="$_http_lua_dir" \ - || return 1 - - _build $pkgname-rtmp --build="rtmp" \ - --add-module="$_rtmp_dir" \ + \ + --add-dynamic-module="$_devel_kit_dir" \ + --add-dynamic-module="$_http_lua_dir" \ + --add-dynamic-module="$_rtmp_dir" \ || return 1 - _build $pkgname || return 1 + make || return 1 } package() { @@ -128,7 +140,7 @@ package() { install -Dm755 "$srcdir"/$pkgname.initd ./etc/init.d/$pkgname install -Dm644 "$srcdir"/$pkgname.logrotate ./etc/logrotate.d/$pkgname - install -dm755 ./etc/$pkgname/conf.d + install -dm755 ./etc/$pkgname/conf.d ./etc/$pkgname/modules install -dm750 -o $pkgusers -g $_grp_ngx ./var/lib/$pkgname install -dm700 -o $pkgusers -g $_grp_ngx ./var/lib/$pkgname/tmp install -dm755 -g $_grp_www ./var/www/localhost/htdocs @@ -136,25 +148,17 @@ package() { install -dm755 ./var/log mv ./var/lib/$pkgname/logs ./var/log/$pkgname || return 1 + ln -sf /$_modules_dir ./var/lib/$pkgname/modules ln -sf /var/log/$pkgname ./var/lib/$pkgname/logs ln -sf /run/$pkgname ./var/lib/$pkgname/run - sed -Ei "s|logs(/nginx.pid.*$)|run\1|" \ + sed -Ei -e "s|logs(/nginx.pid.*$)|run\1|" \ + -e '$a include /etc/nginx/modules/*.conf;' \ ./etc/$pkgname/$pkgname.conf || return 1 rm -rf ./run ./etc/$pkgname/*.default } -common() { - pkgdesc="$pkgdesc (common files)" - depends= - replaces="nginx-initscripts" - arch="noarch" - - mkdir -p "$subpkgdir" - mv "$pkgdir"/etc "$pkgdir"/var "$subpkgdir"/ -} - vim() { pkgdesc="$pkgdesc (vim syntax)" depends= @@ -164,38 +168,42 @@ vim() { cp -r "$builddir"/contrib/vim "$subpkgdir"/usr/share/vim/vimfiles } -rtmp() { - pkgdesc="$pkgdesc (rtmp support)" - depends="$pkgname-common !$pkgname !$pkgname-lua" +_module() { + local name="${subpkgname#$pkgname-mod-}" + name="${name//-/_}" + local soname="$(eval "echo \$_${name}_so")"; + soname="${soname:-"ngx_${name}_module.so"}" - install -Dm755 "$builddir"/objs/$pkgname-rtmp "$subpkgdir"/usr/sbin/$pkgname -} + pkgdesc="$pkgdesc (module $name)" + depends="$pkgname $(eval "echo \$_${name}_depends")" -lua() { - pkgdesc="$pkgdesc (rtmp & lua support)" - depends="$pkgname-common !$pkgname !$pkgname-rtmp" + mkdir -p "$subpkgdir"/$_modules_dir + cd "$subpkgdir" - install -Dm755 "$builddir"/objs/$pkgname-lua "$subpkgdir"/usr/sbin/$pkgname + mv "$pkgdir"/$_modules_dir/$soname ./$_modules_dir/$soname || return 1 + + mkdir -p "$subpkgdir"/etc/nginx/modules + echo "load_module \"modules/$soname\";" > ./etc/nginx/modules/$name.conf } md5sums="088292d9caf6059ef328aa7dda332e44 nginx-1.10.1.tar.gz -9824498b35e879e40d05b9c8348dc4ff lua-nginx-module-0.10.5.tar.gz -8006de2560db3e55bb15d110220076ac nginx-rtmp-module-1.1.7.tar.gz 76c503918c003fcc55005b7688f47add ngx_devel_kit-0.3.0.tar.gz +9824498b35e879e40d05b9c8348dc4ff lua-nginx-module-0.10.5.tar.gz +320a0229e1553f417c227dd965e1c81b nginx-rtmp-module-1.1.9.tar.gz db194cf3c6c4be12c70c757e0c9ad995 nginx.logrotate 16dcac0d7a2b406807d3377841d9b480 nginx.initd 801a87f7f9d27f8ad85b41a78b4c4461 ipv6.patch" sha256sums="1fd35846566485e03c0e318989561c135c598323ff349c503a6c14826487a801 nginx-1.10.1.tar.gz -4f0292c37ab3d7cb980c994825040be1bda2c769cbd800e79c43eb37458347d4 lua-nginx-module-0.10.5.tar.gz -7922b0e3d5f3d9c4b275e4908cfb8f5fb1bfb3ac2df77f4c262cda56df21aab3 nginx-rtmp-module-1.1.7.tar.gz 88e05a99a8a7419066f5ae75966fb1efc409bad4522d14986da074554ae61619 ngx_devel_kit-0.3.0.tar.gz +4f0292c37ab3d7cb980c994825040be1bda2c769cbd800e79c43eb37458347d4 lua-nginx-module-0.10.5.tar.gz +46d914e3ba1f4c2353c1ef01a7423305255cb78226c84fac419586f849b7ea55 nginx-rtmp-module-1.1.9.tar.gz b063611c6cb2d33bd43c4b17bf4135dda25f209bb77e4e66d1b156cffc37fbe6 nginx.logrotate 3d8a90d2f75b7f24c4d74722b5b3ac11d85f416c2d7641b4280d7c126bfe8395 nginx.initd a24ef5843ae0afa538b00c37eb7da7870f9d7f146f52a9668678f7296cf71d9b ipv6.patch" sha512sums="fa1329d40e83340380332dd5e2ed66f08dd59cc7f7582dd0e0193c493353ba550e80dc80e5165c225d70532d4197abc49cc8c760e8ab72e48f630cb57c2803e1 nginx-1.10.1.tar.gz -a02b8614fdcd063b1087a3114f05402c707343ff3bceabaca1fb98531ba30edea1a525fc45e2f5a49ff155de8d6f9e1155e8870e463476da5703acfd5f8fc3fc lua-nginx-module-0.10.5.tar.gz -9883462a04683f1e7af175da04b86d259ff6d677864667588fb073143f7130969eb2a5a5a48ddceda7a555b908580f179bdcacb7f0111413d51db5bfe43b396e nginx-rtmp-module-1.1.7.tar.gz 558764c9be913a4f61d0e277d07bf3c272e1ce086b3fadb85b693a7e92805cd9fca4da7a8d29c96e53fc0d23b331327d3b2561ff61f19d2330e7d5d35ac7d614 ngx_devel_kit-0.3.0.tar.gz +a02b8614fdcd063b1087a3114f05402c707343ff3bceabaca1fb98531ba30edea1a525fc45e2f5a49ff155de8d6f9e1155e8870e463476da5703acfd5f8fc3fc lua-nginx-module-0.10.5.tar.gz +888c268eb0371649e9bf971462e20472f819946f49ef5e50af97d0590a03df6d37c1fa8016eb7ea81faa0c212c429618d399102f513b029c66226d48e444f70c nginx-rtmp-module-1.1.9.tar.gz 09b110693e3f4377349ccea3c43cb8199c8579ee351eae34283299be99fdf764b0c1bddd552e13e4d671b194501618b29c822e1ad53b34101a73a63954363dbb nginx.logrotate 1ea032cf88021ec8aa1401d284ea738364511cdb9f8c01670deb8e59aae570f5bbe17f0cbab73c0e08d6b342a621b6a9c014832168ed41f6028ecfa4211b60cf nginx.initd 68d64a84568ec2df0366925ab282a05ebe21a85044b6c7844a47573cfd8cc8ed119cc772358bc3fff36e2d4fdf583a730592825f5f98632993ca86d1f8438d5f ipv6.patch" |