wok-current rev 18379

Add: nginx-extras (1.9.4)
author Nathan Neulinger <nneul@neulinger.org>
date Thu Sep 17 16:29:50 2015 +0000 (2015-09-17)
parents 0a9084c12c2d
children 9bc008086f63
files nginx-extras/receipt nginx-extras/stuff/etc/init.d/nginx
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/nginx-extras/receipt	Thu Sep 17 16:29:50 2015 +0000
     1.3 @@ -0,0 +1,105 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="nginx-extras"
     1.7 +VERSION="1.9.4"
     1.8 +CATEGORY="network"
     1.9 +SHORT_DESC="Asynchronous HTTP server designed for heavy loads + mail proxy."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +LICENSE="BSD"
    1.12 +SUGGESTED="php perl python"
    1.13 +TARBALL="nginx-$VERSION.tar.gz"
    1.14 +WEB_SITE="http://nginx.org/"
    1.15 +WGET_URL="${WEB_SITE}download//$TARBALL"
    1.16 +PROVIDE="lighttpd"
    1.17 +CONFIG_FILES="/etc/nginx"
    1.18 +CONFLICT="nginx"
    1.19 +
    1.20 +DEPENDS="pcre openssl zlib libgd geoip"
    1.21 +BUILD_DEPENDS="pcre-dev openssl-dev zlib-dev libgd-dev geoip-dev"
    1.22 +
    1.23 +# Rules to configure and make the package.
    1.24 +compile_rules()
    1.25 +{
    1.26 +	cd $src
    1.27 +
    1.28 +	./configure --prefix=/usr \
    1.29 +		--conf-path=/etc/nginx/nginx.conf \
    1.30 +		--pid-path=/var/run/nginx.pid \
    1.31 +		--lock-path=/var/lock/nginx.lock \
    1.32 +		--error-log-path=/var/log/nginx/error.log \
    1.33 +		--http-log-path=/var/log/nginx/access.log \
    1.34 +		--http-client-body-temp-path=/var/spool/nginx/body \
    1.35 +		--http-proxy-temp-path=/var/spool/nginx/proxy \
    1.36 +		--http-fastcgi-temp-path=/var/spool/nginx/fastcgi \
    1.37 +		--with-http_ssl_module \
    1.38 +		--with-http_spdy_module \
    1.39 +		--with-http_realip_module \
    1.40 +		--with-http_addition_module \
    1.41 +		--with-http_xslt_module \
    1.42 +		--with-http_image_filter_module \
    1.43 +		--with-http_geoip_module \
    1.44 +		--with-http_sub_module \
    1.45 +		--with-http_dav_module \
    1.46 +		--with-http_flv_module \
    1.47 +		--with-http_mp4_module \
    1.48 +		--with-http_gunzip_module \
    1.49 +		--with-http_gzip_static_module \
    1.50 +		--with-http_auth_request_module \
    1.51 +		--with-http_random_index_module \
    1.52 +		--with-http_secure_link_module \
    1.53 +		--with-http_degradation_module \
    1.54 +		--with-http_stub_status_module \
    1.55 +		--with-mail \
    1.56 +		--with-mail_ssl_module \
    1.57 +		--with-stream \
    1.58 +		--with-stream_ssl_module \
    1.59 +		--with-pcre \
    1.60 +		--with-pcre-jit \
    1.61 +		--with-http_perl_module \
    1.62 +		--user=80 --group=80 &&
    1.63 +	make &&
    1.64 +	make DESTDIR=$DESTDIR install
    1.65 +
    1.66 +		# not yet available - perftools dep lib
    1.67 +		#--with-google_perftools_module \
    1.68 +}
    1.69 +
    1.70 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.71 +# On SliTaz Lighttpd runs as user/group : www/www or 80/80.
    1.72 +genpkg_rules()
    1.73 +{
    1.74 +        cp -a $install/* $fs/
    1.75 +        rm -rf $fs/usr/html
    1.76 +        cp -a stuff/* $fs
    1.77 +        sed -i 's/#user  nobody;/user  www;/' $fs/etc/nginx/nginx.conf
    1.78 +}
    1.79 +
    1.80 +# Pre and post install commands for Tazpkg.
    1.81 +# We stop the server by default in case of upgarde.
    1.82 +pre_install()
    1.83 +{
    1.84 +        echo "Processing pre-install commands..."
    1.85 +        [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
    1.86 +        # Backup config file.
    1.87 +        if [ -d $1/$CONFIG_FILES ]; then
    1.88 +		cp -a $1/$CONFIG_FILES $1/$CONFIG_FILES.bak
    1.89 +        fi
    1.90 +}
    1.91 +post_install()
    1.92 +{
    1.93 +        echo "Processing post-install commands..."
    1.94 +        mkdir -p /var/spool/nginx
    1.95 +        # Restore original config.
    1.96 +        if [ -d $1/$CONFIG_FILES.bak ]; then
    1.97 +		rm -rf $1/$CONFIG_FILES
    1.98 +		mv $1/$CONFIG_FILES.bak $1/$CONFIG_FILES
    1.99 +        fi
   1.100 +        # Just in case.
   1.101 +        chown www.www $1/var/log/$PACKAGE
   1.102 +        if [ -z "$1" ]; then
   1.103 +		for i in apache lighttpd ; do
   1.104 +			[ -f /etc/init.d/$i ] && /etc/init.d/$i stop
   1.105 +		done
   1.106 +		/etc/init.d/$PACKAGE start
   1.107 +        fi
   1.108 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/nginx-extras/stuff/etc/init.d/nginx	Thu Sep 17 16:29:50 2015 +0000
     2.3 @@ -0,0 +1,55 @@
     2.4 +#!/bin/sh
     2.5 +# /etc/init.d/nginx: Start, stop and restart web server on SliTaz, 
     2.6 +# at boot time or with the command line. Daemons options are configured
     2.7 +# with /etc/daemons.conf
     2.8 +#
     2.9 +. /etc/init.d/rc.functions
    2.10 +. /etc/daemons.conf
    2.11 +
    2.12 +NAME=Nginx
    2.13 +DESC="web server"
    2.14 +DAEMON=/usr/sbin/nginx
    2.15 +OPTIONS=$NGINX_OPTIONS
    2.16 +PIDFILE=/var/run/nginx.pid
    2.17 +
    2.18 +case "$1" in
    2.19 +  start)
    2.20 +    if active_pidfile $PIDFILE nginx ; then
    2.21 +      echo "$NAME already running."
    2.22 +      exit 1
    2.23 +    fi
    2.24 +    echo -n "Starting $DESC: $NAME... "
    2.25 +    $DAEMON $OPTIONS 
    2.26 +    status
    2.27 +    ;;
    2.28 +  stop)
    2.29 +    if ! active_pidfile $PIDFILE nginx ; then
    2.30 +      echo "$NAME is not running."
    2.31 +      exit 1
    2.32 +    fi
    2.33 +    echo -n "Stopping $DESC: $NAME... "
    2.34 +    kill `cat $PIDFILE`
    2.35 +    rm $PIDFILE
    2.36 +    status
    2.37 +    ;;
    2.38 +  restart)
    2.39 +    if ! active_pidfile $PIDFILE nginx ; then
    2.40 +      echo "$NAME is not running."
    2.41 +      exit 1
    2.42 +    fi
    2.43 +    echo -n "Restarting $DESC: $NAME... "
    2.44 +    kill `cat $PIDFILE`
    2.45 +    rm $PIDFILE
    2.46 +    sleep 2
    2.47 +    $DAEMON $OPTIONS
    2.48 +    status
    2.49 +    ;;
    2.50 +  *)
    2.51 +    echo ""
    2.52 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    2.53 +    echo ""
    2.54 +    exit 1
    2.55 +    ;;
    2.56 +esac
    2.57 +
    2.58 +exit 0