updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / nginx-passenger / PKGBUILD
blob6da54ef43b37562505065bb95728b2ec88d13475
1 # $Id: PKGBUILD 48812 2011-06-06 11:51:15Z spupykin $
2 # Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
3 # Contributor: Miroslaw Szot <mss@czlug.icis.pcz.pl>
4 # Contributor: Marcin Kulik <sikkill@gmail.com>
6 _doc_root=/srv/http/nginx
7 _server_root=/etc/nginx
8 _conf_path=${_server_root}/conf
9 _tmp_path=/var/spool/nginx
10 _log_path=/var/log/nginx
11 _user=http
12 _group=http
14 pkgname=nginx-passenger
15 pkgver=1.0.4
16 pkgrel=1
17 pkgdesc="lightweight HTTP server and IMAP/POP3 proxy server with Passenger support"
18 arch=('i686' 'x86_64')
19 depends=('pcre' 'zlib' 'openssl')
20 url="http://nginx.org"
21 license=('custom')
22 conflicts=('nginx')
23 provides=('nginx')
24 backup=("etc/nginx/conf/nginx.conf"
25         "etc/nginx/conf/koi-win"
26         "etc/nginx/conf/koi-utf"
27         "etc/nginx/conf/win-utf"
28         "etc/nginx/conf/mime.types"
29         "etc/nginx/conf/fastcgi_params"
30         "etc/logrotate.d/nginx")
31 source=(http://sysoev.ru/nginx/nginx-${pkgver}.tar.gz
32         nginx)
33 md5sums=('d23f6e6b07b57ac061e790b1ed64bb98'
34          '837b010afcbdfe82d8e65ef00c4e14ba')
36 build() {
37         cd $srcdir/nginx-${pkgver}
38         ./configure \
39                 --prefix=${_server_root} \
40                 --sbin-path=/usr/sbin/nginx \
41                 --pid-path=/var/run/nginx.pid \
42                 --lock-path=/var/lock/nginx.lock \
43                 --http-client-body-temp-path=${_tmp_path}/client_body_temp \
44                 --http-proxy-temp-path=${_tmp_path}/proxy_temp \
45                 --http-fastcgi-temp-path=${_tmp_path}/fastcgi_temp \
46                 --http-log-path=${_log_path}/access.log \
47                 --error-log-path=${_log_path}/error.log \
48                 --user=${_user} --group=${_group} \
49                 --with-imap --with-imap_ssl_module --with-http_ssl_module \
50                 --with-http_stub_status_module \
51                 --with-http_dav_module \
52                 --add-module=`passenger-config --root`/ext/nginx \
53                 --with-http_gzip_static_module \
54                 --with-ipv6
56         make
59 package() {
60         cd $srcdir/nginx-${pkgver}
61         make DESTDIR=$pkgdir install
63         install -d $pkgdir/etc/logrotate.d/
64         cat <<EOF > $pkgdir/etc/logrotate.d/nginx
65         $_log_path/*log {
66                 create 640 http log
67                 compress
68                 postrotate
69                         /bin/kill -USR1 \`cat /var/run/nginx.pid 2>/dev/null\` 2> /dev/null || true
70                 endscript
71         }
72 EOF
74         sed -i -e "s/\<user\s\+\w\+;/user $_user;/g" $pkgdir/$_conf_path/nginx.conf
76         install -d $pkgdir/$_tmp_path
78         # move default document root outside server root
79         install -d $pkgdir/$_doc_root
80         mv $pkgdir/$_server_root/html/* $pkgdir/$_doc_root/
81         rm -rf $pkgdir/$_server_root/html
82         rm -f $pkgdir/$_doc_root/index.html
84         # let's create links for relative paths in config file
85         ln -s $_log_path $pkgdir/$_server_root/logs
86         ln -s $_doc_root $pkgdir/$_server_root/html
88         install -D -m755 $srcdir/nginx $pkgdir/etc/rc.d/nginx
89         install -D -m644 LICENSE $pkgdir/usr/share/licenses/nginx/LICENSE
90         mkdir -p $pkgdir/etc/conf.d
91         echo "NGINX_CONFIG=/etc/nginx/conf/nginx.conf" >$pkgdir/etc/conf.d/nginx
92         rm -rf $pkgdir/var/run