updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / nginx-unstable-passenger / PKGBUILD
blob4fdc6a5b23eab4692b8e33b28d5d131770223eb6
1 pkgname=nginx-unstable-passenger
2 _pkgname="nginx"
3 _doc_root="/srv/http/${_pkgname}"
4 _sysconf_path="etc"
5 _conf_path="${_sysconf_path}/${_pkgname}"
6 _tmp_path="/var/run/${_pkgname}"
7 _log_path="/var/log/${_pkgname}"
8 _user="http"
9 _group="http"
10 _gemname=passenger
11 _nginx_pkgver=1.1.12
12 _passenger_pkgver=3.0.11
13 pkgver=${_nginx_pkgver}_${_passenger_pkgver}
14 pkgrel=1
15 pkgdesc="lightweight HTTP server and IMAP/POP3 proxy server"
16 arch=('i686' 'x86_64')
17 depends=('pcre' 'zlib' 'openssl' 'ruby' 'ruby-rake>=0.8.1' 'ruby-fastthread>=1.0.1' 'ruby-daemon_controller>=0.2.5' 'ruby-file-tail>=0' 'ruby-rack>=0')
18 makedepends=('rubygems')
19 url="http://nginx.net/"
20 license=('custom')
21 conflicts=('nginx')
22 provides=('nginx')
23 noextract=($_gemname-$_passenger_pkgver.gem)
24 backup=("${_conf_path#/}/nginx.conf"
25         "${_conf_path#/}/koi-win"
26         "${_conf_path#/}/koi-utf"
27         "${_conf_path#/}/win-utf"
28         "${_conf_path#/}/mime.types"
29         "${_conf_path#/}/fastcgi_params"
30         "etc/logrotate.d/nginx")
31 source=("http://nginx.org/download/nginx-${_nginx_pkgver}.tar.gz"
32         "nginx.sh"
33         "nginx.conf"
34         "nginx.logrotate"
35         http://gems.rubyforge.org/gems/$_gemname-$_passenger_pkgver.gem)
36 md5sums=('2a98411773c87a98e92c5aa68f322338'
37          '70b39280671d3cee700bea3883852d32'
38          '323a91c795f509d50cff07e526cc127f'
39          'e01e6f679c5c626e909f01687a2d37d4'
40          'c0cafef2c5ba522310602f451ea4c941')
42 build() {
43         local _src_dir="${srcdir}/${_pkgname}-${_nginx_pkgver}"
44         local _build_dir="${_src_dir}/objs"
45         local _gemdir="$(ruby -e'puts Gem.default_dir')"
47         cd $srcdir
48         gem install --ignore-dependencies --no-rdoc --no-ri -i "$pkgdir$_gemdir" $_gemname-$_passenger_pkgver.gem
50         cd "${_src_dir}"
51         ./configure \
52                 --prefix="/${_conf_path}" \
53                 --conf-path="/${_conf_path}/${_pkgname}.conf" \
54                 --sbin-path="/usr/sbin/${_pkgname}" \
55                 --pid-path="${_tmp_path}/${_pkgname}.pid" \
56                 --lock-path="/var/lock/${_pkgname}.lock" \
57                 --http-client-body-temp-path="${_tmp_path}/client_body_temp" \
58                 --http-proxy-temp-path="${_tmp_path}/proxy_temp" \
59                 --add-module=../../pkg/$_gemdir/gems/passenger-$_passenger_pkgver/ext/nginx \
60                 --http-fastcgi-temp-path="${_tmp_path}/fastcgi_temp" \
61                 --http-log-path="${_log_path}/access.log" \
62                 --error-log-path="${_log_path}/error.log" \
63                 --user="${_user}" --group="${_group}" \
64                 --with-mail --with-mail_ssl_module \
65                 --with-http_ssl_module \
66                 --with-http_stub_status_module \
67                 --with-ipv6 \
68                 --with-file-aio \
69                 --with-debug
70                 #--with-http_realip_module \
71                 #--with-http_addition_module \
72                 #--with-http_xslt_module \
73                 #--with-http_image_filter_module \
74                 #--with-http_geoip_module \
75                 #--with-http_sub_module \
76                 #--with-http_dav_module \
77                 #--with-http_flv_module \
78                 #--with-http_gzip_static_module \
79                 #--with-http_random_index_module \
80                 #--with-http_secure_link_module \
81                 #--with-http_degradation_module \
82                 #--with-http_perl_module \
84         make
85         make DESTDIR="${pkgdir}" install
87         sed -i'' -e "s#root\s\+\w\+;#root ${_doc_root};#g" "${pkgdir}/etc/${_pkgname}/${_pkgname}.conf"
89         install -d "${pkgdir}/${_tmp_path}"
91         # move default document root outside server root
92         install -d "${pkgdir}/${_doc_root}"
93         mv "${pkgdir}/${_conf_path}/html/"* "${pkgdir}/${_doc_root}"
94         rm -rf "${pkgdir}/${_conf_path}/html"
96         install -D -m555 "${srcdir}/nginx.sh" "${pkgdir}/etc/rc.d/${_pkgname}"
97         install -D -m644 "${srcdir}/nginx.logrotate" "${pkgdir}/etc/logrotate.d/${_pkgname}"
98         install -D -m644 "${srcdir}/nginx.conf" "${pkgdir}/etc/conf.d/${_pkgname}"
99         install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
100         install -D -m644 "man/nginx.8" "${pkgdir}/usr/share/man/man8/nginx.8"