1 # Maintainer: Stephen Diehl <stephen.m.diehl@gmail.com>
2 # adapted from nginx-admiral0 by Sergej Pupykin
5 _server_root=/etc/nginx
6 _conf_path=${_server_root}/conf
7 _tmp_path=/var/spool/nginx
8 _log_path=/var/log/nginx
12 pkgname=nginx-tcp_proxy
15 pkgdesc="lightweight HTTP server and IMAP/POP3 proxy server, with tcp proxying for websockets"
16 arch=('i686' 'x86_64')
17 depends=('pcre' 'zlib' 'openssl')
20 url="http://nginx.net/"
22 backup=("${_conf_path#/}/nginx.conf" \
23 "${_conf_path#/}/koi-win" \
24 "${_conf_path#/}/koi-utf" \
25 "${_conf_path#/}/win-utf" \
26 "${_conf_path#/}/mime.types" \
27 "${_conf_path#/}/fastcgi_params" \
28 "etc/logrotate.d/nginx")
29 source=(http://nginx.org/download/nginx-${pkgver}.tar.gz
30 https://github.com/yaoweibin/nginx_tcp_proxy_module/tarball/v0.24
34 local _src_dir=$srcdir/nginx-${pkgver}
35 local _build_dir=$_src_dir/objs
37 local _patch_dir=$srcdir/yaoweibin-nginx_tcp_proxy_module-c541a38
40 patch -p1 < $_patch_dir/tcp.patch
42 --prefix=${_server_root} \
43 --sbin-path=/usr/sbin/nginx \
44 --pid-path=/var/run/nginx.pid \
45 --lock-path=/var/lock/nginx.lock \
46 --http-client-body-temp-path=${_tmp_path}/client_body_temp \
47 --http-proxy-temp-path=${_tmp_path}/proxy_temp \
48 --http-fastcgi-temp-path=${_tmp_path}/fastcgi_temp \
49 --http-log-path=${_log_path}/access.log \
50 --error-log-path=${_log_path}/error.log \
51 --user=${_user} --group=${_group} \
52 --with-imap --with-imap_ssl_module --with-http_ssl_module \
53 --with-http_stub_status_module \
54 --with-http_dav_module \
55 --with-http_sub_module \
57 --add-module=${_patch_dir}
60 make DESTDIR=$pkgdir install || return 1
62 install -d $pkgdir/etc/logrotate.d/
63 cat <<- EOF > $pkgdir/etc/logrotate.d/nginx
68 /bin/kill -USR1 \`cat /var/run/nginx.pid 2>/dev/null\` 2> /dev/null || true
73 sed -i -e "s/\<user\s\+\w\+;/user $_user;/g" $pkgdir/$_conf_path/nginx.conf
75 install -d $pkgdir/$_tmp_path
77 # move default document root outside server root
78 install -d $pkgdir/$_doc_root
79 mv $pkgdir/$_server_root/html/* $pkgdir/$_doc_root/
80 rm -rf $pkgdir/$_server_root/html
81 rm -f $pkgdir/$_doc_root/index.html
83 # let's create links for relative paths in config file
84 ln -s $_log_path $pkgdir/$_server_root/logs && \
85 ln -s $_doc_root $pkgdir/$_server_root/html || return 1
87 install -D -m755 $srcdir/nginx $pkgdir/etc/rc.d/nginx && \
88 install -D -m644 LICENSE $pkgdir/usr/share/licenses/nginx/LICENSE && \
89 mkdir -p $pkgdir/etc/conf.d && \
90 echo "NGINX_CONFIG=/etc/nginx/conf/nginx.conf" >$pkgdir/etc/conf.d/nginx
92 md5sums=('d23f6e6b07b57ac061e790b1ed64bb98'
93 '308d6d2fa37a1b23cd522e13aaf8b7c4')