updated on Sat Jan 14 00:11:12 UTC 2012
[aur-mirror.git] / nginx-admiral0 / PKGBUILD
blob2fbea67c2bf67cf60647f58ff3f7155396595942
1 # $Id: PKGBUILD 27981 2010-10-01 09:31:35Z spupykin $
2 # Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
3 # Contributor: Miroslaw Szot <mss@czlug.icis.pcz.pl>
5 _doc_root=/srv/http
6 _server_root=/etc/nginx
7 _conf_path=${_server_root}/conf
8 _tmp_path=/var/spool/nginx
9 _log_path=/var/log/nginx
10 _user=http
11 _group=http
13 pkgname=nginx-admiral0
14 pkgver=0.8.53
15 pkgrel=2
16 pkgdesc="lightweight HTTP server and IMAP/POP3 proxy server, with upload and push modules"
17 arch=('i686' 'x86_64')
18 depends=('pcre' 'zlib' 'openssl')
19 provides=('nginx')
20 conflicts=('nginx')
21 url="http://nginx.net/"
22 license=('custom')
23 backup=("${_conf_path#/}/nginx.conf" \
24         "${_conf_path#/}/koi-win" \
25         "${_conf_path#/}/koi-utf" \
26         "${_conf_path#/}/win-utf" \
27         "${_conf_path#/}/mime.types" \
28         "${_conf_path#/}/fastcgi_params" \
29         "etc/logrotate.d/nginx")
30 source=(http://sysoev.ru/nginx/nginx-${pkgver}.tar.gz \
31         nginx
32         http://github.com/masterzen/nginx-upload-progress-module/tarball/v0.8.1
33         http://pushmodule.slact.net/downloads/nginx_http_push_module-0.692.tar.gz)
35 build() {
36         local _src_dir=$srcdir/nginx-${pkgver}
37         local _build_dir=$_src_dir/objs
39         cd $_src_dir
40         ./configure \
41                 --prefix=${_server_root} \
42                 --sbin-path=/usr/sbin/nginx \
43                 --pid-path=/var/run/nginx.pid \
44                 --lock-path=/var/lock/nginx.lock \
45                 --http-client-body-temp-path=${_tmp_path}/client_body_temp \
46                 --http-proxy-temp-path=${_tmp_path}/proxy_temp \
47                 --http-fastcgi-temp-path=${_tmp_path}/fastcgi_temp \
48                 --http-log-path=${_log_path}/access.log \
49                 --error-log-path=${_log_path}/error.log \
50                 --user=${_user} --group=${_group} \
51                 --with-imap --with-imap_ssl_module --with-http_ssl_module \
52                 --with-http_stub_status_module \
53                 --with-http_dav_module \
54                 --with-http_sub_module \
55                 --with-ipv6 \
56                 --add-module=${srcdir}/masterzen-nginx-upload-progress-module-c740674 \
57                 --add-module=${srcdir}/nginx_http_push_module-0.692
59         make || return 1
60         make DESTDIR=$pkgdir install || return 1
62         install -d $pkgdir/etc/logrotate.d/
63         cat <<- EOF > $pkgdir/etc/logrotate.d/nginx
64         $_log_path/*log {
65                 create 640 http log
66                 compress
67                 postrotate
68                         /bin/kill -USR1 \`cat /var/run/nginx.pid 2>/dev/null\` 2> /dev/null || true
69                 endscript
70         }
71         EOF
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=('717eaea1b34e8663849f64b9aa05a9da'
93          '998fe7467e9abfb414cc6ae23475bea9'
94          '7095d7ea2857bc149ddc7008fb9545c4'
95          'a948638005669d159fa331a35c066fae')