wok-next annotate nginx/receipt @ rev 21037
Small updates.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue Nov 06 16:35:54 2018 +0200 (2018-11-06) |
parents | 87e24d6b90ad |
children |
rev | line source |
---|---|
al@20716 | 1 # SliTaz package receipt v2. |
pascal@10450 | 2 |
pascal@10450 | 3 PACKAGE="nginx" |
al@20716 | 4 VERSION="1.14.0" |
pascal@10450 | 5 CATEGORY="network" |
al@20716 | 6 SHORT_DESC="Asynchronous HTTP server designed for heavy loads + mail proxy" |
pascal@10450 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@15601 | 8 LICENSE="BSD" |
al@20716 | 9 WEB_SITE="https://nginx.org/" |
al@20716 | 10 |
pascal@10450 | 11 TARBALL="$PACKAGE-$VERSION.tar.gz" |
al@20716 | 12 WGET_URL="https://nginx.org/download/$TARBALL" |
pascal@15182 | 13 |
al@20716 | 14 BUILD_DEPENDS="pcre-dev openssl-dev zlib-dev libgd-dev geoip-dev libxslt-dev \ |
al@20716 | 15 perl-dev" |
al@21020 | 16 SPLIT="$PACKAGE-extras:extras" |
pascal@10450 | 17 |
al@20716 | 18 compile_rules() { |
al@20716 | 19 case $SET in |
al@20716 | 20 '') SET_ARGS="";; |
al@20716 | 21 extras) |
al@20716 | 22 SET_ARGS="\ |
al@20716 | 23 --with-http_ssl_module \ |
al@20716 | 24 --with-http_v2_module \ |
al@20716 | 25 --with-http_realip_module \ |
al@20716 | 26 --with-http_addition_module \ |
al@20716 | 27 --with-http_xslt_module \ |
al@20716 | 28 --with-http_image_filter_module \ |
al@20716 | 29 --with-http_geoip_module \ |
al@20716 | 30 --with-http_sub_module \ |
al@20716 | 31 --with-http_mp4_module \ |
al@20716 | 32 --with-http_gunzip_module \ |
al@20716 | 33 --with-http_gzip_static_module \ |
al@20716 | 34 --with-http_auth_request_module \ |
al@20716 | 35 --with-http_random_index_module \ |
al@20716 | 36 --with-http_secure_link_module \ |
al@20716 | 37 --with-http_degradation_module \ |
al@20716 | 38 --with-http_slice_module \ |
al@20716 | 39 --with-http_stub_status_module \ |
al@20716 | 40 --with-stream \ |
al@20716 | 41 --with-stream_ssl_module \ |
al@20716 | 42 --with-stream_realip_module \ |
al@20716 | 43 --with-stream_geoip_module \ |
al@20716 | 44 --with-stream_ssl_preread_module \ |
al@20716 | 45 --with-pcre \ |
al@20716 | 46 --with-pcre-jit \ |
al@20716 | 47 --with-http_perl_module \ |
al@20716 | 48 " |
al@20716 | 49 ;; |
al@20716 | 50 esac |
pascal@10450 | 51 |
al@20716 | 52 ./configure \ |
al@20716 | 53 --prefix=/usr \ |
pascal@10450 | 54 --conf-path=/etc/nginx/nginx.conf \ |
pascal@10450 | 55 --pid-path=/var/run/nginx.pid \ |
pascal@10450 | 56 --lock-path=/var/lock/nginx.lock \ |
pascal@10450 | 57 --error-log-path=/var/log/nginx/error.log \ |
pascal@10450 | 58 --http-log-path=/var/log/nginx/access.log \ |
pascal@10450 | 59 --http-client-body-temp-path=/var/spool/nginx/body \ |
pascal@10450 | 60 --http-proxy-temp-path=/var/spool/nginx/proxy \ |
pascal@10450 | 61 --http-fastcgi-temp-path=/var/spool/nginx/fastcgi \ |
al@20716 | 62 --user=80 \ |
al@20716 | 63 --group=80 \ |
al@20716 | 64 \ |
pascal@10450 | 65 --with-http_stub_status_module \ |
pascal@10450 | 66 --with-http_flv_module \ |
pascal@10450 | 67 --with-http_ssl_module \ |
pascal@10450 | 68 --with-http_dav_module \ |
al@20716 | 69 --with-mail \ |
al@20716 | 70 --with-mail_ssl_module \ |
al@20716 | 71 $SET_ARGS && |
pascal@10450 | 72 make && |
al@20716 | 73 make install || return 1 |
al@20716 | 74 |
al@20716 | 75 sed -i 's/#user nobody;/user www;/' $install/etc/nginx/nginx.conf |
al@20716 | 76 install -Dm755 $stuff/nginx $install/etc/init.d/nginx |
pascal@10450 | 77 } |
pascal@10450 | 78 |
al@20716 | 79 genpkg_rules() { |
al@20716 | 80 copy @std |
al@20716 | 81 CONFIG_FILES="/etc/nginx/" |
al@20716 | 82 SUGGESTED="php perl python" |
al@20716 | 83 case $PACKAGE in |
al@20716 | 84 nginx) |
al@20716 | 85 DEPENDS="libpcre openssl zlib" |
al@20716 | 86 PROVIDE="lighttpd" |
al@20716 | 87 ;; |
al@20716 | 88 nginx-extras) |
al@20716 | 89 CAT="network|with extra modules" |
al@20716 | 90 DEPENDS="geoip libgd libpcre libxml2 libxslt openssl perl-core zlib" |
al@20716 | 91 PROVIDE="lighttpd nginx" |
al@20716 | 92 ;; |
al@20716 | 93 esac |
pascal@10450 | 94 } |
pascal@10450 | 95 |
al@20716 | 96 # We stop the server by default in case of upgarde |
al@20716 | 97 pre_install() { |
al@20716 | 98 [ -z "$1" -a -f /etc/init.d/nginx ] && /etc/init.d/nginx stop |
al@20716 | 99 # Backup config file |
al@20716 | 100 if [ -d "$1/etc/nginx" ]; then |
al@20716 | 101 cp -a "$1/etc/nginx" "$1/etc/nginx.bak" |
al@18734 | 102 fi |
pascal@10450 | 103 } |
al@18734 | 104 |
al@20716 | 105 post_install() { |
al@20716 | 106 mkdir -p "$1/var/spool/nginx" |
al@20716 | 107 |
al@20716 | 108 # Restore original config |
al@20716 | 109 if [ -d "$1/etc/nginx.bak" ]; then |
al@20716 | 110 rm -rf "$1/etc/nginx" |
al@20716 | 111 mv "$1/etc/nginx.bak" "$1/etc/nginx" |
al@18734 | 112 fi |
al@20716 | 113 |
al@20716 | 114 # Just in case |
al@20716 | 115 chown www.www "$1/var/log/nginx/" |
al@20716 | 116 |
al@18734 | 117 if [ -z "$1" ]; then |
al@20716 | 118 for i in apache lighttpd; do |
pascal@10450 | 119 [ -f /etc/init.d/$i ] && /etc/init.d/$i stop |
pascal@10450 | 120 done |
al@20716 | 121 /etc/init.d/nginx start |
al@18734 | 122 fi |
pascal@10450 | 123 } |