2 # Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
3 # Contributor: Miroslaw Szot <mss@czlug.icis.pcz.pl>
5 _doc_root=/srv/http/nginx
6 _server_root=/etc/nginx
7 _conf_path=${_server_root}/conf
8 _tmp_path=/var/spool/nginx
9 _log_path=/var/log/nginx
13 pkgname=nginx-mod_wsgi
16 pkgdesc="lightweight HTTP server and IMAP/POP3 proxy server with mod_wsgi support"
17 arch=('i686' 'x86_64')
18 depends=('pcre' 'zlib' 'openssl' 'mercurial')
19 url="http://nginx.net/"
23 backup=("etc/nginx/conf/nginx.conf"
24 "etc/nginx/conf/koi-win"
25 "etc/nginx/conf/koi-utf"
26 "etc/nginx/conf/win-utf"
27 "etc/nginx/conf/mime.types"
28 "etc/nginx/conf/fastcgi_params"
29 "etc/logrotate.d/nginx")
30 source=(http://sysoev.ru/nginx/nginx-${pkgver}.tar.gz
32 md5sums=('5751c920c266ea5bb5fc38af77e9c71c'
33 '837b010afcbdfe82d8e65ef00c4e14ba')
36 local _src_dir=$srcdir/nginx-${pkgver}
37 local _build_dir=$_src_dir/objs
40 hg clone http://bitbucket.org/lifeeth/mod_wsgi/
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_gzip_static_module \
60 make DESTDIR=$pkgdir install
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
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
91 rm -rf $pkgdir/var/run