updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / nginx_passenger / PKGBUILD
bloba2df2e376f39a7dd273eca8abbfb0d8c545f142c
1 # Maintainer: Dimytch <dimytch@mail.ru>
2 # partially stolen from
3 # Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
4 # Contributor: Miroslaw Szot <mss@czlug.icis.pcz.pl>
5 # Contributor: Yanchenko Igor <yanchenko.igor@gmail.com>
7 pkgname=nginx_passenger
8 pkgver=3.0.11
9 pkgrel=1
10 _nginxver=1.1.12
12 _doc_root=/srv/http/nginx
13 _conf_path=/var/log/nginx
14 _tmp_path=/var/spool/nginx
15 _log_path=/var/log/nginx
16 _user=nginx
17 _group=nginx
18 _prefix=/opt/nginx
19 _passenger_src=/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-$pkgver/ext/nginx
22 pkgdesc="Nginx with mod_rails module"
23 arch=('i686' 'x86_64')
24 depends=('pcre' 'zlib' 'openssl')
25 url="http://www.modrails.com"
26 license=('GPL')
27 backup=("${_conf_path#/}/nginx.conf" \
28         "${_conf_path#/}/koi-win" \
29         "${_conf_path#/}/koi-utf" \
30         "${_conf_path#/}/win-utf" \
31         "${_conf_path#/}/mime.types" \
32         "${_conf_path#/}/fastcgi_params" \
33         "etc/logrotate.d/nginx")
35 source=(http://nginx.org/download/nginx-${_nginxver}.tar.gz \
36         nginx.logrotate \
37         nginx)
39 md5sums=('2a98411773c87a98e92c5aa68f322338'
40          'c2ebd1a3348944944737baacea07d2b3'
41          '70b39280671d3cee700bea3883852d32')
43 build() {
44         echo "startdir == ${startdir}"
45         echo "srcdir == ${srcdir}"
47         local _src_dir=$startdir/src/nginx-${_nginxver}
48         local _build_dir=$_src_dir/objs
50         cd $_src_dir
51         ./configure \
52                 --prefix=${_prefix} \
53                 --pid-path=/var/run/nginx.pid \
54                 --lock-path=/var/lock/nginx.lock \
55                 --http-client-body-temp-path=${_tmp_path}/client_body_temp \
56                 --http-proxy-temp-path=${_tmp_path}/proxy_temp \
57                 --http-fastcgi-temp-path=${_tmp_path}/fastcgi_temp \
58                 --http-log-path=${_log_path}/access.log \
59                 --error-log-path=${_log_path}/error.log \
60                 --user=${_user} --group=${_group} \
61                 --with-http_ssl_module \
62                 --with-http_stub_status_module \
63                 --add-module=${_passenger_src} \
64                 --with-http_perl_module \
65                 --with-http_gzip_static_module \
66                 --with-cc-opt=-Wno-error
68         make || return 1
69         make DESTDIR="${startdir}/pkg" install || return 1
70         echo "startdir == ${startdir}"
71         install -d "${startdir}/pkg/etc/logrotate.d/"
72         cp -v "${startdir}/src/nginx.logrotate" "${startdir}/pkg/etc/logrotate.d/"
73         #sed -i -e "s/\<user\s\+\w\+;/user $_user;/g" "${startdir}/pkg/${_conf_path}/nginx.conf"
75         install -d "${startdir}/pkg/${_tmp_path}"
77         #echo "# move default document root outside server root"
78         #install -d "${startdir}/pkg/${_doc_root}"
79         #mv -v $startdir/pkg/$_server_root/html/* $startdir/pkg/$_doc_root/
80         #rm -rf $startdir/pkg/$_server_root/html
81         #rm -f $startdir/pkg/$_doc_root/index.html
83         # let's create links for relative paths in config file
84         #ln -s "$_log_path ${startdir}/pkg/${_server_root}/logs" && \
85         #ln -s "$_doc_root ${startdir}/pkg/${_server_root}/html"
87         install -D -m755 "${startdir}/src/nginx" "${startdir}/pkg/etc/rc.d/nginx" && \
88         mkdir -p "${pkgdir}/etc/conf.d"
89         #echo "NGINX_CONFIG=/etc/nginx/conf/nginx.conf" > "${pkgdir}/etc/conf.d/nginx"