wok-current diff nginx-extras/receipt @ 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
children 9bc008086f63
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 +}