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