From 102db978a509899ae8366b06a06e31e851ba4047 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Tue, 25 Dec 2018 17:53:19 +0200 Subject: [PATCH] Sync with upstream nginx-mainline and make PKGBUILD prettier --- PKGBUILD | 209 ++++++++++++++++++++++-------------------- fix-displayName.patch | 35 ------- 2 files changed, 111 insertions(+), 133 deletions(-) delete mode 100644 fix-displayName.patch diff --git a/PKGBUILD b/PKGBUILD index 3a3312b..a5250af 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -4,20 +4,27 @@ # Contributor: Sébastien Luttringer # Contributor: Drew DeVault # Contributor: Arti Zirk +# Contributor: Mark Vainomaa +_davext_ver=3.0.0 +_fancyindex_ver=0.4.3 +_headers_more_ver=0.33 +_nchan_ver=1.2.3 + +_pkgname=nginx pkgname=nginx-ilves -pkgver=1.13.5 +pkgver=1.15.7 pkgrel=1 pkgdesc='Lightweight HTTP server and IMAP/POP3 proxy server, mainline release' -arch=('i686' 'x86_64') +arch=('x86_64') url='https://nginx.org' license=('custom') -depends=('pcre' 'zlib' 'openssl' 'geoip') +depends=('pcre' 'zlib' 'openssl' 'geoip' 'mailcap' + 'libxml2') # Extra modules dependencies backup=('etc/nginx/fastcgi.conf' 'etc/nginx/fastcgi_params' 'etc/nginx/koi-win' 'etc/nginx/koi-utf' - 'etc/nginx/mime.types' 'etc/nginx/nginx.conf' 'etc/nginx/scgi_params' 'etc/nginx/uwsgi_params' @@ -26,126 +33,132 @@ backup=('etc/nginx/fastcgi.conf' install=nginx.install provides=('nginx') conflicts=('nginx' 'nginx-mainline') -source=($url/download/nginx-$pkgver.tar.gz{,.asc} - service - logrotate - ngx_davext.tar.gz::https://github.com/arut/nginx-dav-ext-module/archive/v0.1.0.tar.gz - fix-displayName.patch - ngx_fancyindex.tar.gz::https://github.com/aperezdc/ngx-fancyindex/archive/v0.4.2.tar.gz - ngx_headers_more.tar.gz::https://github.com/openresty/headers-more-nginx-module/archive/v0.32.tar.gz - ngx_nchan.tar.gz::https://github.com/slact/nchan/archive/v1.1.7.tar.gz) validpgpkeys=('B0F4253373F8F6F510D42178520A9993A1C052F8') # Maxim Dounin -md5sums=('f193722159adfb1eb8117c0491fd17ec' - 'SKIP' - 'ef491e760e7c1ffec9ca25441a150c83' - '6a01fb17af86f03707c8ae60f98a2dc2' - '2cb502dbda335be4ebd5fed0b3182bae' - '16c5dbad002ae88eadb66aa1a13389c2' - 'e1dd79f0ec82415bbf8a1cb938988955' - '5ce112f12afe155749e2c504997861f7' - '3c50bbc449fd9f1c2fed06687c99ad7f') +source=("${url}/download/${_pkgname}-${pkgver}.tar.gz"{,.asc} + "service" + "logrotate" + "ngx_davext-${_davext_ver}.tar.gz::https://github.com/arut/nginx-dav-ext-module/archive/v${_davext_ver}.tar.gz" + "ngx_fancyindex-${_fancyindex_ver}.tar.gz::https://github.com/aperezdc/ngx-fancyindex/archive/v${_fancyindex_ver}.tar.gz" + "ngx_headers_more-${_headers_more_ver}.tar.gz::https://github.com/openresty/headers-more-nginx-module/archive/v${_headers_more_ver}.tar.gz" + "ngx_nchan-${_nchan_ver}.tar.gz::https://github.com/slact/nchan/archive/v${_nchan_ver}.tar.gz") +sha256sums=('8f22ea2f6c0e0a221b6ddc02b6428a3ff708e2ad55f9361102b1c9f4142bdf93' + 'SKIP' + '65f5af0f27ce3c5263d99d70a57fd3b0cb62aa99df786205029e68563e41e1ee' + '06ebe161af3e761f2e2e35a67c6c0af27bf61aea7cd4ba8b28372ced5e3b3175' + 'd2499d94d82d4e4eac8425d799e52883131ae86a956524040ff2fd230ef9f859' + '81698fb0c1ec9f906ce308c055d5d248085caf390f4b92516c1ec93f87c886d4' + 'a3dcbab117a9c103bc1ea5200fc00a7b7d2af97ff7fd525f16f8ac2632e30fbf' + 'ea44d9f33115db4737abe611e63e3f734fa18cb11d998354b093a40eb7a8e6be') _common_flags=( - --with-compat - --with-file-aio - --with-http_addition_module - --with-http_auth_request_module - --with-http_dav_module - --with-http_degradation_module - --with-http_flv_module - --with-http_geoip_module - --with-http_gunzip_module - --with-http_gzip_static_module - --with-http_mp4_module - --with-http_realip_module - --with-http_secure_link_module - --with-http_slice_module - --with-http_ssl_module - --with-http_stub_status_module - --with-http_sub_module - --with-http_v2_module - --with-mail - --with-mail_ssl_module - --with-pcre-jit - --with-stream - --with-stream_geoip_module - --with-stream_realip_module - --with-stream_ssl_module - --with-stream_ssl_preread_module - --with-threads + --with-compat + --with-file-aio + --with-http_addition_module + --with-http_auth_request_module + --with-http_dav_module + --with-http_degradation_module + --with-http_flv_module + --with-http_geoip_module + --with-http_gunzip_module + --with-http_gzip_static_module + --with-http_mp4_module + --with-http_realip_module + --with-http_secure_link_module + --with-http_slice_module + --with-http_ssl_module + --with-http_stub_status_module + --with-http_sub_module + --with-http_v2_module + --with-pcre-jit + --with-stream + --with-stream_geoip_module + --with-stream_realip_module + --with-stream_ssl_module + --with-stream_ssl_preread_module + --with-threads ) _mainline_flags=( + ) +_module_flags=( + --add-module=../nginx-dav-ext-module-${_davext_ver} + --add-module=../ngx-fancyindex-${_fancyindex_ver} + --add-module=../headers-more-nginx-module-${_headers_more_ver} + --add-module=../nchan-${_nchan_ver} +) + +prepare() { + # Safety first + for dir in "${_module_flags[@]}"; do + dir="${dir/--add-module\=..\/}" + test -d "${dir}" || { + echo ">>> Module directory '${dir}' does not exist!" + return 1 + } + done +} + build() { - mv nginx-dav-ext-module* ngx_davext - cd ngx_davext - patch -p1 -i ../../fix-displayName.patch - cd .. - mv ngx-fancyindex-* ngx_fancyindex - mv headers-more-nginx-module-* ngx_headers_more - mv nchan-* ngx_nchan + cd "${_pkgname}-${pkgver}" + ./configure \ + --prefix=/etc/nginx \ + --conf-path=/etc/nginx/nginx.conf \ + --sbin-path=/usr/bin/nginx \ + --pid-path=/run/nginx.pid \ + --lock-path=/run/lock/nginx.lock \ + --user=http \ + --group=http \ + --http-log-path=/var/log/nginx/access.log \ + --error-log-path=stderr \ + --http-client-body-temp-path=/var/lib/nginx/client-body \ + --http-proxy-temp-path=/var/lib/nginx/proxy \ + --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ + --http-scgi-temp-path=/var/lib/nginx/scgi \ + --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ + --with-cc-opt="${CFLAGS} ${CPPFLAGS}" \ + --with-ld-opt="${LDFLAGS}" \ + ${_common_flags[@]} \ + ${_mainline_flags[@]} \ + ${_module_flags[@]} - cd $provides-$pkgver - ./configure \ - --prefix=/etc/nginx \ - --conf-path=/etc/nginx/nginx.conf \ - --sbin-path=/usr/bin/nginx \ - --pid-path=/run/nginx.pid \ - --lock-path=/run/lock/nginx.lock \ - --user=http \ - --group=http \ - --http-log-path=/var/log/nginx/access.log \ - --error-log-path=stderr \ - --http-client-body-temp-path=/var/lib/nginx/client-body \ - --http-proxy-temp-path=/var/lib/nginx/proxy \ - --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ - --http-scgi-temp-path=/var/lib/nginx/scgi \ - --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ - --with-cc-opt="$CFLAGS $CPPFLAGS" \ - --with-ld-opt="$LDFLAGS" \ - ${_common_flags[@]} \ - ${_mainline_flags[@]} \ - --add-module=../ngx_davext \ - --add-module=../ngx_fancyindex \ - --add-module=../ngx_headers_more \ - --add-module=../ngx_nchan - - make + make } package() { - cd $provides-$pkgver - make DESTDIR="$pkgdir" install + cd "${_pkgname}-${pkgver}" + + make DESTDIR="${pkgdir}" install sed -e 's|\ "$pkgdir"/usr/share/man/man8/nginx.8.gz + install -d "${pkgdir}"/usr/share/man/man8/ + gzip -9c man/nginx.8 > "${pkgdir}"/usr/share/man/man8/nginx.8.gz for i in ftdetect indent syntax; do install -Dm644 contrib/vim/$i/nginx.vim \ - "$pkgdir/usr/share/vim/vimfiles/$i/nginx.vim" + "${pkgdir}/usr/share/vim/vimfiles/$i/nginx.vim" done } diff --git a/fix-displayName.patch b/fix-displayName.patch deleted file mode 100644 index 5c9e4ab..0000000 --- a/fix-displayName.patch +++ /dev/null @@ -1,35 +0,0 @@ -From fa4969880916bbc1634576cd9edcefe3d40e521b Mon Sep 17 00:00:00 2001 -From: Mattias Wadman -Date: Fri, 22 May 2015 15:43:42 +0200 -Subject: [PATCH] Use path basename instead of URI basename as displayName - -Display name value is a text node so it should not use be URL encoded. -Fixes issue withspace and other characters showing as %20 etc. ---- - ngx_http_dav_ext_module.c | 13 +++---------- - 1 file changed, 3 insertions(+), 10 deletions(-) - -diff --git a/ngx_http_dav_ext_module.c b/ngx_http_dav_ext_module.c -index 73d86de..f53819c 100644 ---- a/ngx_http_dav_ext_module.c -+++ b/ngx_http_dav_ext_module.c -@@ -328,16 +328,9 @@ ngx_http_dav_ext_send_propfind_atts(ngx_http_request_t *r, - "" - ); - -- if (uri->len) { -- -- for(name.data = uri->data + uri->len; -- name.data >= uri->data + 1 && name.data[-1] != '/'; -- --name.data); -- -- name.len = uri->data + uri->len - name.data; -- -- NGX_HTTP_DAV_EXT_OUTES(&name); -- } -+ name.data = strrchr(path, '/') + 1; -+ name.len = strlen(name.data); -+ NGX_HTTP_DAV_EXT_OUTES(&name); - - NGX_HTTP_DAV_EXT_OUTL( - "\n"