Sync with upstream nginx-mainline and make PKGBUILD prettier

This commit is contained in:
Mark Vainomaa 2018-12-25 17:53:19 +02:00
parent 3c95d21dae
commit 102db978a5
Signed by: mikroskeem
GPG Key ID: 1B3F9523B542D315
2 changed files with 111 additions and 133 deletions

121
PKGBUILD
View File

@ -4,20 +4,27 @@
# Contributor: Sébastien Luttringer # Contributor: Sébastien Luttringer
# Contributor: Drew DeVault # Contributor: Drew DeVault
# Contributor: Arti Zirk <arti.zirk@gmail.com> # Contributor: Arti Zirk <arti.zirk@gmail.com>
# Contributor: Mark Vainomaa <mikroskeem@mikroskeem.eu>
_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 pkgname=nginx-ilves
pkgver=1.13.5 pkgver=1.15.7
pkgrel=1 pkgrel=1
pkgdesc='Lightweight HTTP server and IMAP/POP3 proxy server, mainline release' pkgdesc='Lightweight HTTP server and IMAP/POP3 proxy server, mainline release'
arch=('i686' 'x86_64') arch=('x86_64')
url='https://nginx.org' url='https://nginx.org'
license=('custom') license=('custom')
depends=('pcre' 'zlib' 'openssl' 'geoip') depends=('pcre' 'zlib' 'openssl' 'geoip' 'mailcap'
'libxml2') # Extra modules dependencies
backup=('etc/nginx/fastcgi.conf' backup=('etc/nginx/fastcgi.conf'
'etc/nginx/fastcgi_params' 'etc/nginx/fastcgi_params'
'etc/nginx/koi-win' 'etc/nginx/koi-win'
'etc/nginx/koi-utf' 'etc/nginx/koi-utf'
'etc/nginx/mime.types'
'etc/nginx/nginx.conf' 'etc/nginx/nginx.conf'
'etc/nginx/scgi_params' 'etc/nginx/scgi_params'
'etc/nginx/uwsgi_params' 'etc/nginx/uwsgi_params'
@ -26,24 +33,22 @@ backup=('etc/nginx/fastcgi.conf'
install=nginx.install install=nginx.install
provides=('nginx') provides=('nginx')
conflicts=('nginx' 'nginx-mainline') 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 <mdounin@mdounin.ru> validpgpkeys=('B0F4253373F8F6F510D42178520A9993A1C052F8') # Maxim Dounin <mdounin@mdounin.ru>
md5sums=('f193722159adfb1eb8117c0491fd17ec' 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' 'SKIP'
'ef491e760e7c1ffec9ca25441a150c83' '65f5af0f27ce3c5263d99d70a57fd3b0cb62aa99df786205029e68563e41e1ee'
'6a01fb17af86f03707c8ae60f98a2dc2' '06ebe161af3e761f2e2e35a67c6c0af27bf61aea7cd4ba8b28372ced5e3b3175'
'2cb502dbda335be4ebd5fed0b3182bae' 'd2499d94d82d4e4eac8425d799e52883131ae86a956524040ff2fd230ef9f859'
'16c5dbad002ae88eadb66aa1a13389c2' '81698fb0c1ec9f906ce308c055d5d248085caf390f4b92516c1ec93f87c886d4'
'e1dd79f0ec82415bbf8a1cb938988955' 'a3dcbab117a9c103bc1ea5200fc00a7b7d2af97ff7fd525f16f8ac2632e30fbf'
'5ce112f12afe155749e2c504997861f7' 'ea44d9f33115db4737abe611e63e3f734fa18cb11d998354b093a40eb7a8e6be')
'3c50bbc449fd9f1c2fed06687c99ad7f')
_common_flags=( _common_flags=(
--with-compat --with-compat
@ -64,8 +69,6 @@ _common_flags=(
--with-http_stub_status_module --with-http_stub_status_module
--with-http_sub_module --with-http_sub_module
--with-http_v2_module --with-http_v2_module
--with-mail
--with-mail_ssl_module
--with-pcre-jit --with-pcre-jit
--with-stream --with-stream
--with-stream_geoip_module --with-stream_geoip_module
@ -76,18 +79,29 @@ _common_flags=(
) )
_mainline_flags=( _mainline_flags=(
) )
build() { _module_flags=(
mv nginx-dav-ext-module* ngx_davext --add-module=../nginx-dav-ext-module-${_davext_ver}
cd ngx_davext --add-module=../ngx-fancyindex-${_fancyindex_ver}
patch -p1 -i ../../fix-displayName.patch --add-module=../headers-more-nginx-module-${_headers_more_ver}
cd .. --add-module=../nchan-${_nchan_ver}
mv ngx-fancyindex-* ngx_fancyindex )
mv headers-more-nginx-module-* ngx_headers_more
mv nchan-* ngx_nchan
cd $provides-$pkgver 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() {
cd "${_pkgname}-${pkgver}"
./configure \ ./configure \
--prefix=/etc/nginx \ --prefix=/etc/nginx \
--conf-path=/etc/nginx/nginx.conf \ --conf-path=/etc/nginx/nginx.conf \
@ -103,49 +117,48 @@ build() {
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-scgi-temp-path=/var/lib/nginx/scgi \ --http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \ --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--with-cc-opt="$CFLAGS $CPPFLAGS" \ --with-cc-opt="${CFLAGS} ${CPPFLAGS}" \
--with-ld-opt="$LDFLAGS" \ --with-ld-opt="${LDFLAGS}" \
${_common_flags[@]} \ ${_common_flags[@]} \
${_mainline_flags[@]} \ ${_mainline_flags[@]} \
--add-module=../ngx_davext \ ${_module_flags[@]}
--add-module=../ngx_fancyindex \
--add-module=../ngx_headers_more \
--add-module=../ngx_nchan
make make
} }
package() { package() {
cd $provides-$pkgver cd "${_pkgname}-${pkgver}"
make DESTDIR="$pkgdir" install
make DESTDIR="${pkgdir}" install
sed -e 's|\<user\s\+\w\+;|user html;|g' \ sed -e 's|\<user\s\+\w\+;|user html;|g' \
-e '44s|html|/usr/share/nginx/html|' \ -e '44s|html|/usr/share/nginx/html|' \
-e '54s|html|/usr/share/nginx/html|' \ -e '54s|html|/usr/share/nginx/html|' \
-i "$pkgdir"/etc/nginx/nginx.conf -i "${pkgdir}"/etc/nginx/nginx.conf
rm "$pkgdir"/etc/nginx/*.default rm "${pkgdir}"/etc/nginx/*.default
rm "${pkgdir}"/etc/nginx/mime.types # in mailcap
install -d "$pkgdir"/var/lib/nginx install -d "${pkgdir}"/var/lib/nginx
install -dm700 "$pkgdir"/var/lib/nginx/proxy install -dm700 "${pkgdir}"/var/lib/nginx/proxy
chmod 755 "$pkgdir"/var/log/nginx chmod 755 "${pkgdir}"/var/log/nginx
chown root:root "$pkgdir"/var/log/nginx chown root:root "${pkgdir}"/var/log/nginx
install -d "$pkgdir"/usr/share/nginx install -d "${pkgdir}"/usr/share/nginx
mv "$pkgdir"/etc/nginx/html/ "$pkgdir"/usr/share/nginx mv "${pkgdir}"/etc/nginx/html/ "${pkgdir}"/usr/share/nginx
install -Dm644 ../logrotate "$pkgdir"/etc/logrotate.d/nginx install -Dm644 ../logrotate "${pkgdir}"/etc/logrotate.d/nginx
install -Dm644 ../service "$pkgdir"/usr/lib/systemd/system/nginx.service install -Dm644 ../service "${pkgdir}"/usr/lib/systemd/system/nginx.service
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$provides/LICENSE install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${_pkgname}/LICENSE
rmdir "$pkgdir"/run rmdir "${pkgdir}"/run
install -d "$pkgdir"/usr/share/man/man8/ install -d "${pkgdir}"/usr/share/man/man8/
gzip -9c man/nginx.8 > "$pkgdir"/usr/share/man/man8/nginx.8.gz gzip -9c man/nginx.8 > "${pkgdir}"/usr/share/man/man8/nginx.8.gz
for i in ftdetect indent syntax; do for i in ftdetect indent syntax; do
install -Dm644 contrib/vim/$i/nginx.vim \ install -Dm644 contrib/vim/$i/nginx.vim \
"$pkgdir/usr/share/vim/vimfiles/$i/nginx.vim" "${pkgdir}/usr/share/vim/vimfiles/$i/nginx.vim"
done done
} }

View File

@ -1,35 +0,0 @@
From fa4969880916bbc1634576cd9edcefe3d40e521b Mon Sep 17 00:00:00 2001
From: Mattias Wadman <mattias.wadman@gmail.com>
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,
"<D:displayname>"
);
- 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(
"</D:displayname>\n"