network/nginx: Updated for version 0.7.5
This commit is contained in:
parent
5056313667
commit
a465eaef6a
|
@ -1,2 +1,10 @@
|
||||||
nginx [engine x] is a high-performance HTTP server and reverse proxy
|
nginx [engine x] is a high-performance HTTP server and reverse proxy
|
||||||
as well as an IMAP/POP3 proxy server.
|
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.
|
||||||
|
|
|
@ -1,16 +1,33 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Building nginx in the Slackware way.
|
# Slackware build script for nginx
|
||||||
#
|
|
||||||
# Notes:
|
|
||||||
# + Don't forget to check the VERSION number.
|
|
||||||
# + You may want to customize the configure options.
|
|
||||||
#
|
|
||||||
# Written by Cherife Li <cherife@dotimes.com>.
|
|
||||||
#
|
#
|
||||||
|
# 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:
|
||||||
|
# + This SlackBuild is for v0.7.0 and newer.
|
||||||
|
# + You may want to customize the configure options.
|
||||||
|
|
||||||
PRGNAM=nginx
|
PRGNAM=nginx
|
||||||
VERSION=0.6.28
|
VERSION=0.7.5
|
||||||
ARCH=${ARCH:-i486}
|
ARCH=${ARCH:-i486}
|
||||||
BUILD=${BUILD:-1}
|
BUILD=${BUILD:-1}
|
||||||
TAG=${TAG:-_SBo}
|
TAG=${TAG:-_SBo}
|
||||||
|
@ -24,9 +41,11 @@ NGINXUSER=${NGINXUSER:-nobody}
|
||||||
NGINXGROUP=${NGINXGROUP:-nobody}
|
NGINXGROUP=${NGINXGROUP:-nobody}
|
||||||
|
|
||||||
if [ "$ARCH" = "i486" ]; then
|
if [ "$ARCH" = "i486" ]; then
|
||||||
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
||||||
elif [ "$ARCH" = "i686" ]; then
|
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
|
fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
@ -35,10 +54,14 @@ rm -rf $PKG
|
||||||
mkdir -p $TMP $PKG $OUTPUT
|
mkdir -p $TMP $PKG $OUTPUT
|
||||||
cd $TMP
|
cd $TMP
|
||||||
rm -rf $PRGNAM-$VERSION
|
rm -rf $PRGNAM-$VERSION
|
||||||
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
|
||||||
cd $PRGNAM-$VERSION
|
cd $PRGNAM-$VERSION
|
||||||
chown -R root:root .
|
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" \
|
CFLAGS="$SLKCFLAGS" \
|
||||||
CXXFLAGS="$SLKCFLAGS" \
|
CXXFLAGS="$SLKCFLAGS" \
|
||||||
|
@ -49,14 +72,16 @@ CXXFLAGS="$SLKCFLAGS" \
|
||||||
--error-log-path=/var/log/nginx_error.log \
|
--error-log-path=/var/log/nginx_error.log \
|
||||||
--pid-path=/var/run/nginx.pid \
|
--pid-path=/var/run/nginx.pid \
|
||||||
--lock-path=/var/lock/nginx \
|
--lock-path=/var/lock/nginx \
|
||||||
--user=$NGINXUSER \
|
--user=${NGINXUSER} \
|
||||||
--group=$NGINXGROUP \
|
--group=${NGINXGROUP} \
|
||||||
--with-http_ssl_module \
|
--with-http_ssl_module \
|
||||||
--with-http_realip_module \
|
--with-http_realip_module \
|
||||||
--with-http_addition_module \
|
--with-http_addition_module \
|
||||||
--with-http_sub_module \
|
--with-http_sub_module \
|
||||||
|
--with-http_dav_module \
|
||||||
|
--with-http_flv_module \
|
||||||
|
--with-http_gzip_static_module \
|
||||||
--with-http_stub_status_module \
|
--with-http_stub_status_module \
|
||||||
--without-http_proxy_module \
|
|
||||||
--http-log-path=/var/log/nginx_access.log \
|
--http-log-path=/var/log/nginx_access.log \
|
||||||
--http-client-body-temp-path=/var/spool/nginx_client_body_temp \
|
--http-client-body-temp-path=/var/spool/nginx_client_body_temp \
|
||||||
--http-proxy-temp-path=/var/spool/nginx_proxy_temp \
|
--http-proxy-temp-path=/var/spool/nginx_proxy_temp \
|
||||||
|
@ -66,18 +91,14 @@ CXXFLAGS="$SLKCFLAGS" \
|
||||||
--without-mail_smtp_module \
|
--without-mail_smtp_module \
|
||||||
--with-debug
|
--with-debug
|
||||||
|
|
||||||
make
|
make || exit 1
|
||||||
make install DESTDIR=$PKG
|
make install DESTDIR=$PKG || exit 1
|
||||||
|
|
||||||
mkdir -p $PKG/etc/{nginx,rc.d} $PKG/usr/sbin \
|
mkdir -p $PKG/{etc/rc.d,usr/doc/nginx-$VERSION}
|
||||||
$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
|
|
||||||
cp -a CHANGES CHANGES.ru LICENSE README $PKG/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/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
|
( cd $PKG
|
||||||
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
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
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
||||||
|
|
||||||
# Let's not clobber config files on upgrade
|
# Let's not clobber config files on upgrade
|
||||||
cd $PKG/etc/nginx
|
( cd $PKG/etc/nginx
|
||||||
for i in fastcgi_params koi-utf koi-win mime.types nginx.conf win-utf ; do
|
for i in fastcgi_params mime.types nginx.conf koi-utf koi-win win-utf; do
|
||||||
mv $i $i.new ;
|
mv $i $i.new;
|
||||||
echo "config etc/nginx/$i.new" >> $PKG/install/doinst.sh ;
|
echo "config etc/nginx/$i.new" >> $PKG/install/doinst.sh;
|
||||||
done
|
done
|
||||||
cd -
|
)
|
||||||
|
|
||||||
cd $PKG
|
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
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
PRGNAM="nginx"
|
PRGNAM="nginx"
|
||||||
VERSION="0.6.28"
|
VERSION="0.7.5"
|
||||||
HOMEPAGE="http://nginx.net/"
|
HOMEPAGE="http://nginx.net/"
|
||||||
DOWNLOAD="http://sysoev.ru/nginx/nginx-0.6.28.tar.gz"
|
DOWNLOAD="http://sysoev.ru/nginx/nginx-0.7.5.tar.gz"
|
||||||
MD5SUM="b99301acf8da1fd8036343accdbefb7d"
|
MD5SUM="881e2069181adecdfae9b58ab811a17b"
|
||||||
MAINTAINER="Cherife Li"
|
MAINTAINER="Cherife Li"
|
||||||
EMAIL="cherife@dotimes.com"
|
EMAIL="cherife@dotimes.com"
|
||||||
APPROVED="rworkman"
|
APPROVED="David Somero"
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
# To use nginx, you must first set up the config file(s).
|
# To use nginx, you must first set up the config file(s).
|
||||||
#
|
#
|
||||||
# Written for Slackware Linux by Cherife Li <cherife@dotimes.com>.
|
# Written for Slackware Linux by Cherife Li <cherife@dotimes.com>.
|
||||||
#
|
|
||||||
|
|
||||||
DAEMON=/usr/sbin/nginx
|
DAEMON=/usr/sbin/nginx
|
||||||
CONF=/etc/nginx/nginx.conf
|
CONF=/etc/nginx/nginx.conf
|
||||||
|
@ -15,12 +14,12 @@ PID=/var/run/nginx.pid
|
||||||
nginx_start() {
|
nginx_start() {
|
||||||
# Sanity checks.
|
# Sanity checks.
|
||||||
if [ ! -r $CONF ]; then # no config file, exit:
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f $PID ]; then
|
if [ -s $PID ]; then
|
||||||
echo "Nging is already running?"
|
echo "Nginx appears to already be running..."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -31,7 +30,8 @@ nginx_start() {
|
||||||
}
|
}
|
||||||
|
|
||||||
nginx_test_conf() {
|
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
|
$DAEMON -t -c $CONF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ nginx_term() {
|
||||||
kill -TERM $(cat $PID)
|
kill -TERM $(cat $PID)
|
||||||
}
|
}
|
||||||
|
|
||||||
nginx_quit() {
|
nginx_stop() {
|
||||||
echo "Shutdown Nginx gracefully..."
|
echo "Shutdown Nginx gracefully..."
|
||||||
kill -QUIT $(cat $PID)
|
kill -QUIT $(cat $PID)
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,9 @@ nginx_reload() {
|
||||||
}
|
}
|
||||||
|
|
||||||
nginx_upgrade() {
|
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)
|
kill -USR2 $(cat $PID)
|
||||||
sleep 3
|
sleep 3
|
||||||
kill -QUIT $(cat $PID.oldbin)
|
kill -QUIT $(cat $PID.oldbin)
|
||||||
|
@ -64,27 +66,27 @@ nginx_restart() {
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
'start')
|
check)
|
||||||
nginx_start
|
nginx_test_conf
|
||||||
;;
|
;;
|
||||||
'term')
|
start)
|
||||||
nginx_term
|
nginx_start
|
||||||
;;
|
;;
|
||||||
'quit')
|
term)
|
||||||
nginx_quit
|
nginx_term
|
||||||
;;
|
;;
|
||||||
'stop')
|
stop)
|
||||||
nginx_quit
|
nginx_stop
|
||||||
;;
|
;;
|
||||||
'reload')
|
reload)
|
||||||
nginx_reload
|
nginx_reload
|
||||||
;;
|
;;
|
||||||
'restart')
|
restart)
|
||||||
nginx_restart
|
nginx_restart
|
||||||
;;
|
;;
|
||||||
'upgrade')
|
upgrade)
|
||||||
nginx_upgrade
|
nginx_upgrade
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "usage $0 start|term|quit(stop)|reload|restart|upgrade"
|
echo "usage: $0 {check|start|term|stop|reload|restart|upgrade}"
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue