diff options
author | Larry Hajali <larryhaja@gmail.com> | 2017-01-21 07:46:09 -0800 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-01-24 07:23:32 +0700 |
commit | 133f25becbbb2f7615662139884fc3c6498319f0 (patch) | |
tree | 10cac4633bb242fe39f5232a25830ac91bc1360f | |
parent | 3ae8d27d60b77eb31f33e3ae888ca6677b14b04b (diff) |
network/nginx: Updated for version 1.10.2
Signed-off-by: Larry Hajali <larryhaja[at]gmail[dot]com>
-rw-r--r-- | network/nginx/README | 35 | ||||
-rw-r--r-- | network/nginx/nginx.SlackBuild | 92 | ||||
-rw-r--r-- | network/nginx/nginx.info | 6 | ||||
-rw-r--r-- | network/nginx/slack-desc | 2 |
4 files changed, 83 insertions, 52 deletions
diff --git a/network/nginx/README b/network/nginx/README index bee2a1650b36a..b67e58fc118c9 100644 --- a/network/nginx/README +++ b/network/nginx/README @@ -1,30 +1,27 @@ -nginx (http/imap/pop3 server and proxy) +nginx [engine x] is a high-performance HTTP server and reverse proxy +as well as an IMAP/POP3 proxy server. -nginx [engine x] is a high-performance HTTP server and reverse proxy as -well as an IMAP/POP3 proxy server. - -By default, nginx will use the "nobody" user and group accounts. You -may specify alternate values on the command line if desired; for example: +By default, nginx will use the "nobody" user and group accounts. You may +specify alternate values on the command line if desired; for example: NGINXUSER=backup NGINXGROUP=backup ./nginx.SlackBuild -Regardless of which user and group you decide to use, you will need to -make sure they exist on both the build system and the target system. +Regardless of which user and group you decide to use, you will need to make +sure they exist on both the build system and the target system. -Geoip support is now available as an option using the GeopIP package. If -you wish to enable GeoIP the pass GEOIP variable to the slackbuild: +Geoip support is now available as an option using the GeopIP package. If you wish +to enable GeoIP the pass GEOIP variable to the slackbuild: GEOIP=yes ./nginx.SlackBuild -libatomic support is now available as an option using the libatomic_ops -package. If you wish to enable libatomic then pass LIBATOMIC variable -to the slackbuild: +Extra modules not included with stock nginx can be added by passing them as a +variable to the slackbuild as a space separated list of full paths to modules. +List of extra 3rd party modules available at http://wiki.nginx.org/3rdPartyModules. - LIBATOMIC=yes ./nginx.SlackBuild + ADDMODULE="/tmp/passenger-release-5.0.13/ext/nginx" ./nginx.SlackBuild -Extra modules not included with stock nginx can be added by passing -them as a variable to the slackbuild as a space separated list of -full paths to modules. List of extra 3rd party modules available at -http://wiki.nginx.org/3rdPartyModules. +Using the optional dynamic loadable module support in nginx >= 1.10.0. Understand +that dynamic modules are a new feature in nginx and issues may arise until further +testing is done. - ADDMODULE="/tmp/passenger-release-5.0.13/ext/nginx" ./nginx.SlackBuild + DYNAMIC=yes ./nginx.SlackBuild diff --git a/network/nginx/nginx.SlackBuild b/network/nginx/nginx.SlackBuild index de05bf525b8fc..962e06391c457 100644 --- a/network/nginx/nginx.SlackBuild +++ b/network/nginx/nginx.SlackBuild @@ -5,7 +5,7 @@ # Copyright 2008 Cherife Li <cherife-#-dotimes.com> # Copyright 2011 Diogo Leal <diogo@diogoleal.com> # Copyright 2012-13 Francisco Ambrozio <sbo@franciscoambrozio.com> -# Copyright 2014-2015 Larry Hajali <larryhaja[at]gmail[dot]com> +# Copyright 2014-2017 Larry Hajali <larryhaja[at]gmail[dot]com> # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -28,13 +28,13 @@ # Special thanks to Thomas Morper for some configuration adjustments tips PRGNAM=nginx -VERSION=${VERSION:-1.8.0} +VERSION=${VERSION:-1.10.2} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) ARCH=i486 ;; + i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac @@ -45,8 +45,8 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" @@ -79,22 +79,29 @@ sed -i \ -e '/root[ ]*html/s|html;|/var/www/&|' \ -e '$s|.*| include /etc/nginx/conf.d/\*.conf;\n&|' conf/$PRGNAM.conf -# Enable GeoIP support. -if [ "${GEOIP:-no}" == "yes" ]; then - GEOIP_MOD="--with-http_geoip_module" +# Add if dynamic modules are used. +if [ "${DYNAMIC:-no}" == "yes" ]; then + DYNAMIC_MODULE=${DYNAMIC_MODULE:-=dynamic} + sed -i 's|^events.*|include /etc/nginx/modules/\*.conf;\n\n&|' conf/$PRGNAM.conf else - GEOIP_MOD="" + DYNAMIC_MODULE="" fi -# Endable libatomic_ops support. -if [ "${LIBATOMIC:-no}" == "yes" ]; then - LIBATOMIC_MOD="--with-libatomic" +# Enable GeoIP support. +if [ "${GEOIP:-no}" == "yes" ]; then + GEOIP_MOD="--with-http_geoip_module${DYNAMIC_MODULE}" else - LIBATOMIC_MOD="" + GEOIP_MOD="" fi # Add extra modules not included in nginx. ADDMODULE=${ADDMODULE:-} +if [ "$DYNAMIC" == "yes" ]; then + ADD_MODULE="--add-dynamic-module=$ADDMODULE + --modules-path=/usr/lib${LIBDIRSUFFIX}/$PRGNAM/modules" +else + ADD_MODULE="--add-module=$ADDMODULE" +fi CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ @@ -115,14 +122,14 @@ CXXFLAGS="$SLKCFLAGS" \ --http-scgi-temp-path=/var/lib/nginx/scgi \ --with-file-aio \ --with-ipv6 \ - --with-rtsig_module \ --with-select_module \ --with-poll_module \ --with-http_ssl_module \ + --with-http_v2_module \ --with-http_realip_module \ --with-http_addition_module \ - --with-http_xslt_module \ - --with-http_image_filter_module \ + --with-http_xslt_module${DYNAMIC_MODULE} \ + --with-http_image_filter_module${DYNAMIC_MODULE} \ --with-http_sub_module \ --with-http_dav_module \ --with-http_flv_module \ @@ -132,15 +139,19 @@ CXXFLAGS="$SLKCFLAGS" \ --with-http_random_index_module \ --with-http_secure_link_module \ --with-http_degradation_module \ + --with-http_slice_module \ --with-http_stub_status_module \ - --with-http_perl_module \ + --with-http_perl_module${DYNAMIC_MODULE} \ --with-http_auth_request_module \ - --with-mail \ + --with-mail${DYNAMIC_MODULE} \ --with-mail_ssl_module \ - --with-http_spdy_module \ + --with-stream${DYNAMIC_MODULE} \ + --with-stream_ssl_module \ + --with-pcre \ + --with-pcre-jit \ + --with-libatomic \ $GEOIP_MOD \ - $LIBATOMIC_MOD \ - --add-module="$ADDMODULE" + $ADD_MODULE make make install \ @@ -148,20 +159,25 @@ make install \ INSTALLDIRS=vendor \ INSTALLVENDORMAN3DIR=/usr/man/man3 -find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \ - grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true mkdir -p $PKG/usr/man/man8 install -m 0644 objs/$PRGNAM.8 $PKG/usr/man/man8 find $PKG/usr/man -type f -exec gzip -9 {} \; -find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | xargs rm -f || true +find $PKG -name perllocal.pod \ + -o -name ".packlist" \ + -o -name "*.bs" \ + | xargs rm -f + find $PKG -perm 444 -exec chmod 0644 {} \; find $PKG -perm 555 -exec chmod 0755 {} \; # Make the temp path. mkdir -p $PKG/var/lib/$PRGNAM chmod 0700 $PKG/var/lib/$PRGNAM +chown $NGINXUSER $PKG/var/lib/$PRGNAM # Move html directory mkdir -p $PKG/var/www @@ -175,11 +191,6 @@ mkdir -p $PKG/etc/logrotate.d sed -e "s,@USER@,$NGINXUSER," -e "s,@GROUP@,$NGINXGROUP," $CWD/nginx.logrotate \ > $PKG/etc/logrotate.d/nginx.new -# Don't clobber config files -for i in $(find $PKG/etc/$PRGNAM -type f ! -name "*\.default"); do - mv "$i" "$i".new -done - # Set the permissions for the log directory. chown $NGINXUSER $PKG/var/log/$PRGNAM chmod 750 $PKG/var/log/$PRGNAM @@ -195,5 +206,28 @@ mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh +# Create modules directory and config files. +# Unfortunately, we have to use full paths rather then relative paths +# for nginx dynamic modules, or else we get the following error: +# $ sudo /usr/sbin/nginx -t +# nginx: [emerg] dlopen() "/usr/modules/ngx_stream_module.so" failed (/usr/modules/ngx_stream_module.so: cannot open shared object file: No such file or directory) in /etc/nginx/modules/mod-stream.conf:1 +# nginx: configuration file /etc/nginx/nginx.conf test failed +# Source: https://trac.nginx.org/nginx/ticket/961 +if [ "$DYNAMIC" == "yes" ]; then + mkdir $PKG/etc/$PRGNAM/modules + for module in $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM/modules/*; do + MODULE_NAME=$(basename $module | sed 's|\.so||' | tr _ -) + MODULE_DIR=$(dirname $module | sed "s|$PKG||") + echo "load_module \"${MODULE_DIR}/$(basename $module)\";" > \ + $PKG/etc/$PRGNAM/modules/${MODULE_NAME}.conf + echo "config etc/$PRGNAM/modules/${MODULE_NAME}.conf.new" >> $PKG/install/doinst.sh + done +fi + +# Don't clobber config files +for i in $(find $PKG/etc/$PRGNAM -type f ! -name "*\.default"); do + mv "$i" "$i".new +done + cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/nginx/nginx.info b/network/nginx/nginx.info index b981b76735f88..20ec863a117e7 100644 --- a/network/nginx/nginx.info +++ b/network/nginx/nginx.info @@ -1,8 +1,8 @@ PRGNAM="nginx" -VERSION="1.8.0" +VERSION="1.10.2" HOMEPAGE="http://nginx.org/" -DOWNLOAD="http://nginx.org/download/nginx-1.8.0.tar.gz" -MD5SUM="3ca4a37931e9fa301964b8ce889da8cb" +DOWNLOAD="http://nginx.org/download/nginx-1.10.2.tar.gz" +MD5SUM="e8f5f4beed041e63eb97f9f4f55f3085" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" diff --git a/network/nginx/slack-desc b/network/nginx/slack-desc index fd3cc9ca6cf98..d351d33ee9c19 100644 --- a/network/nginx/slack-desc +++ b/network/nginx/slack-desc @@ -6,7 +6,7 @@ # customary to leave one space after the ':' except on otherwise blank lines. |-----handy-ruler------------------------------------------------------| -nginx: nginx (http/imap/pop3 server and proxy) +nginx: nginx (http/imap/pop3 proxy) nginx: nginx: Nginx [engine x] is a high-performance HTTP server and reverse proxy, nginx: as well as an IMAP/POP3 proxy server. |