# HG changeset patch # User Nathan Neulinger # Date 1442507390 0 # Node ID 4e10d83260c5c8a262c17e0a57f5d9ef899e4f37 # Parent 0a9084c12c2d924696a8173e4a98dbcaf389b4b5 Add: nginx-extras (1.9.4) diff -r 0a9084c12c2d -r 4e10d83260c5 nginx-extras/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nginx-extras/receipt Thu Sep 17 16:29:50 2015 +0000 @@ -0,0 +1,105 @@ +# SliTaz package receipt. + +PACKAGE="nginx-extras" +VERSION="1.9.4" +CATEGORY="network" +SHORT_DESC="Asynchronous HTTP server designed for heavy loads + mail proxy." +MAINTAINER="pascal.bellard@slitaz.org" +LICENSE="BSD" +SUGGESTED="php perl python" +TARBALL="nginx-$VERSION.tar.gz" +WEB_SITE="http://nginx.org/" +WGET_URL="${WEB_SITE}download//$TARBALL" +PROVIDE="lighttpd" +CONFIG_FILES="/etc/nginx" +CONFLICT="nginx" + +DEPENDS="pcre openssl zlib libgd geoip" +BUILD_DEPENDS="pcre-dev openssl-dev zlib-dev libgd-dev geoip-dev" + +# Rules to configure and make the package. +compile_rules() +{ + cd $src + + ./configure --prefix=/usr \ + --conf-path=/etc/nginx/nginx.conf \ + --pid-path=/var/run/nginx.pid \ + --lock-path=/var/lock/nginx.lock \ + --error-log-path=/var/log/nginx/error.log \ + --http-log-path=/var/log/nginx/access.log \ + --http-client-body-temp-path=/var/spool/nginx/body \ + --http-proxy-temp-path=/var/spool/nginx/proxy \ + --http-fastcgi-temp-path=/var/spool/nginx/fastcgi \ + --with-http_ssl_module \ + --with-http_spdy_module \ + --with-http_realip_module \ + --with-http_addition_module \ + --with-http_xslt_module \ + --with-http_image_filter_module \ + --with-http_geoip_module \ + --with-http_sub_module \ + --with-http_dav_module \ + --with-http_flv_module \ + --with-http_mp4_module \ + --with-http_gunzip_module \ + --with-http_gzip_static_module \ + --with-http_auth_request_module \ + --with-http_random_index_module \ + --with-http_secure_link_module \ + --with-http_degradation_module \ + --with-http_stub_status_module \ + --with-mail \ + --with-mail_ssl_module \ + --with-stream \ + --with-stream_ssl_module \ + --with-pcre \ + --with-pcre-jit \ + --with-http_perl_module \ + --user=80 --group=80 && + make && + make DESTDIR=$DESTDIR install + + # not yet available - perftools dep lib + #--with-google_perftools_module \ +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +# On SliTaz Lighttpd runs as user/group : www/www or 80/80. +genpkg_rules() +{ + cp -a $install/* $fs/ + rm -rf $fs/usr/html + cp -a stuff/* $fs + sed -i 's/#user nobody;/user www;/' $fs/etc/nginx/nginx.conf +} + +# Pre and post install commands for Tazpkg. +# We stop the server by default in case of upgarde. +pre_install() +{ + echo "Processing pre-install commands..." + [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop + # Backup config file. + if [ -d $1/$CONFIG_FILES ]; then + cp -a $1/$CONFIG_FILES $1/$CONFIG_FILES.bak + fi +} +post_install() +{ + echo "Processing post-install commands..." + mkdir -p /var/spool/nginx + # Restore original config. + if [ -d $1/$CONFIG_FILES.bak ]; then + rm -rf $1/$CONFIG_FILES + mv $1/$CONFIG_FILES.bak $1/$CONFIG_FILES + fi + # Just in case. + chown www.www $1/var/log/$PACKAGE + if [ -z "$1" ]; then + for i in apache lighttpd ; do + [ -f /etc/init.d/$i ] && /etc/init.d/$i stop + done + /etc/init.d/$PACKAGE start + fi +} diff -r 0a9084c12c2d -r 4e10d83260c5 nginx-extras/stuff/etc/init.d/nginx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nginx-extras/stuff/etc/init.d/nginx Thu Sep 17 16:29:50 2015 +0000 @@ -0,0 +1,55 @@ +#!/bin/sh +# /etc/init.d/nginx: Start, stop and restart web server on SliTaz, +# at boot time or with the command line. Daemons options are configured +# with /etc/daemons.conf +# +. /etc/init.d/rc.functions +. /etc/daemons.conf + +NAME=Nginx +DESC="web server" +DAEMON=/usr/sbin/nginx +OPTIONS=$NGINX_OPTIONS +PIDFILE=/var/run/nginx.pid + +case "$1" in + start) + if active_pidfile $PIDFILE nginx ; then + echo "$NAME already running." + exit 1 + fi + echo -n "Starting $DESC: $NAME... " + $DAEMON $OPTIONS + status + ;; + stop) + if ! active_pidfile $PIDFILE nginx ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $DESC: $NAME... " + kill `cat $PIDFILE` + rm $PIDFILE + status + ;; + restart) + if ! active_pidfile $PIDFILE nginx ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Restarting $DESC: $NAME... " + kill `cat $PIDFILE` + rm $PIDFILE + sleep 2 + $DAEMON $OPTIONS + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0