summaryrefslogtreecommitdiff
path: root/network/nginx
diff options
context:
space:
mode:
Diffstat (limited to 'network/nginx')
-rw-r--r--network/nginx/README8
-rw-r--r--network/nginx/nginx.SlackBuild79
-rw-r--r--network/nginx/nginx.info8
-rw-r--r--network/nginx/rc.nginx62
4 files changed, 94 insertions, 63 deletions
diff --git a/network/nginx/README b/network/nginx/README
index 5b1c8f1e45..e148206644 100644
--- a/network/nginx/README
+++ b/network/nginx/README
@@ -1,2 +1,10 @@
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:
+
+ 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.
diff --git a/network/nginx/nginx.SlackBuild b/network/nginx/nginx.SlackBuild
index 5cbca65656..086458fd17 100644
--- a/network/nginx/nginx.SlackBuild
+++ b/network/nginx/nginx.SlackBuild
@@ -1,16 +1,33 @@
#!/bin/sh
#
-# Building nginx in the Slackware way.
-#
+# Slackware build script for nginx
+#
+# Copyright 2008 Cherife Li <cherife@dotimes.com>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
# Notes:
-# + Don't forget to check the VERSION number.
+# + This SlackBuild is for v0.7.0 and newer.
# + You may want to customize the configure options.
-#
-# Written by Cherife Li <cherife@dotimes.com>.
-#
PRGNAM=nginx
-VERSION=0.6.28
+VERSION=0.7.5
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -24,9 +41,11 @@ NGINXUSER=${NGINXUSER:-nobody}
NGINXGROUP=${NGINXGROUP:-nobody}
if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
fi
set -e
@@ -35,10 +54,14 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
cd $PRGNAM-$VERSION
chown -R root:root .
-chmod -R u+w,go+r-w,a-s .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
@@ -49,14 +72,16 @@ CXXFLAGS="$SLKCFLAGS" \
--error-log-path=/var/log/nginx_error.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/lock/nginx \
- --user=$NGINXUSER \
- --group=$NGINXGROUP \
+ --user=${NGINXUSER} \
+ --group=${NGINXGROUP} \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
+ --with-http_dav_module \
+ --with-http_flv_module \
+ --with-http_gzip_static_module \
--with-http_stub_status_module \
- --without-http_proxy_module \
--http-log-path=/var/log/nginx_access.log \
--http-client-body-temp-path=/var/spool/nginx_client_body_temp \
--http-proxy-temp-path=/var/spool/nginx_proxy_temp \
@@ -66,18 +91,14 @@ CXXFLAGS="$SLKCFLAGS" \
--without-mail_smtp_module \
--with-debug
-make
-make install DESTDIR=$PKG
+make || exit 1
+make install DESTDIR=$PKG || exit 1
-mkdir -p $PKG/etc/{nginx,rc.d} $PKG/usr/sbin \
- $PKG/var/spool/{nginx_client_body_temp,nginx_proxy_temp}
-cp $CWD/rc.nginx $PKG/etc/rc.d/rc.nginx.new
-cp -a conf/* $PKG/etc/nginx
-cp -a objs/nginx $PKG/usr/sbin/nginx
-
-mkdir -p $PKG/usr/doc/nginx-$VERSION
+mkdir -p $PKG/{etc/rc.d,usr/doc/nginx-$VERSION}
cp -a CHANGES CHANGES.ru LICENSE README $PKG/usr/doc/nginx-$VERSION
cat $CWD/nginx.SlackBuild > $PKG/usr/doc/nginx-$VERSION/nginx.SlackBuild
+cat $CWD/rc.nginx > $PKG/etc/rc.d/rc.nginx.new
+mv $PKG/usr/html $PKG/usr/doc/nginx-$VERSION
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
@@ -89,12 +110,12 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
# Let's not clobber config files on upgrade
-cd $PKG/etc/nginx
- for i in fastcgi_params koi-utf koi-win mime.types nginx.conf win-utf ; do
- mv $i $i.new ;
- echo "config etc/nginx/$i.new" >> $PKG/install/doinst.sh ;
+( cd $PKG/etc/nginx
+ for i in fastcgi_params mime.types nginx.conf koi-utf koi-win win-utf; do
+ mv $i $i.new;
+ echo "config etc/nginx/$i.new" >> $PKG/install/doinst.sh;
done
-cd -
+)
cd $PKG
-makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
diff --git a/network/nginx/nginx.info b/network/nginx/nginx.info
index 1f353271e6..c704848e4f 100644
--- a/network/nginx/nginx.info
+++ b/network/nginx/nginx.info
@@ -1,8 +1,8 @@
PRGNAM="nginx"
-VERSION="0.6.28"
+VERSION="0.7.5"
HOMEPAGE="http://nginx.net/"
-DOWNLOAD="http://sysoev.ru/nginx/nginx-0.6.28.tar.gz"
-MD5SUM="b99301acf8da1fd8036343accdbefb7d"
+DOWNLOAD="http://sysoev.ru/nginx/nginx-0.7.5.tar.gz"
+MD5SUM="881e2069181adecdfae9b58ab811a17b"
MAINTAINER="Cherife Li"
EMAIL="cherife@dotimes.com"
-APPROVED="rworkman"
+APPROVED="David Somero"
diff --git a/network/nginx/rc.nginx b/network/nginx/rc.nginx
index 5483458425..88b917d360 100644
--- a/network/nginx/rc.nginx
+++ b/network/nginx/rc.nginx
@@ -6,7 +6,6 @@
# To use nginx, you must first set up the config file(s).
#
# Written for Slackware Linux by Cherife Li <cherife@dotimes.com>.
-#
DAEMON=/usr/sbin/nginx
CONF=/etc/nginx/nginx.conf
@@ -15,12 +14,12 @@ PID=/var/run/nginx.pid
nginx_start() {
# Sanity checks.
if [ ! -r $CONF ]; then # no config file, exit:
- echo "Please check the nginx config file, exiting..."
+ echo "$CONF does not appear to exist; exiting..."
exit 1
fi
- if [ -f $PID ]; then
- echo "Nging is already running?"
+ if [ -s $PID ]; then
+ echo "Nginx appears to already be running..."
exit 1
fi
@@ -31,7 +30,8 @@ nginx_start() {
}
nginx_test_conf() {
- echo -e "Checking configuration for correct syntax and\nthen trying to open files referenced in configuration..."
+ echo "Checking configuration for correct syntax and"
+ echo "then trying to open files referenced in configuration..."
$DAEMON -t -c $CONF
}
@@ -40,7 +40,7 @@ nginx_term() {
kill -TERM $(cat $PID)
}
-nginx_quit() {
+nginx_stop() {
echo "Shutdown Nginx gracefully..."
kill -QUIT $(cat $PID)
}
@@ -51,7 +51,9 @@ nginx_reload() {
}
nginx_upgrade() {
- echo -e "Upgrading to the new Nginx binary.\nMake sure the Nginx binary has been replaced with new one\nor Nginx server modules were added/removed."
+ echo "Upgrading to the new Nginx binary."
+ echo "Make sure the Nginx binary has been replaced with new one"
+ echo "or Nginx server modules were added/removed."
kill -USR2 $(cat $PID)
sleep 3
kill -QUIT $(cat $PID.oldbin)
@@ -64,27 +66,27 @@ nginx_restart() {
}
case "$1" in
-'start')
- nginx_start
- ;;
-'term')
- nginx_term
- ;;
-'quit')
- nginx_quit
- ;;
-'stop')
- nginx_quit
- ;;
-'reload')
- nginx_reload
- ;;
-'restart')
- nginx_restart
- ;;
-'upgrade')
- nginx_upgrade
- ;;
-*)
- echo "usage $0 start|term|quit(stop)|reload|restart|upgrade"
+ check)
+ nginx_test_conf
+ ;;
+ start)
+ nginx_start
+ ;;
+ term)
+ nginx_term
+ ;;
+ stop)
+ nginx_stop
+ ;;
+ reload)
+ nginx_reload
+ ;;
+ restart)
+ nginx_restart
+ ;;
+ upgrade)
+ nginx_upgrade
+ ;;
+ *)
+ echo "usage: $0 {check|start|term|stop|reload|restart|upgrade}"
esac