updated on Mon Jan 16 16:00:41 UTC 2012
[aur-mirror.git] / nginx-devel / PKGBUILD
blob72fa58a4d6e458679ea35cf8b29d794500e3256c
1 # Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
2 # Contributor: Miroslaw Szot <mss@czlug.icis.pcz.pl>
3 # Contributor: Piotr Rogoża <rogoza dot piotr at gmail dot com>
5 pkgname=nginx-devel
6 _pkgname=nginx
7 pkgver=1.1.12
8 pkgrel=1
9 pkgdesc="lightweight HTTP server and IMAP/POP3 proxy server - development version"
10 arch=('i686' 'x86_64')
11 depends=(
12     'pcre'
13     'zlib'
14     'openssl'
15     'geoip'
16     'gd'
17     'libxslt'
18 #    'google-perftools'
20 makedepends=(
21     'passenger'
22     'geoip'
23 #    'google-perftools'
25 optdepends=('passenger')
26 url="http://nginx.org"
27 license=('custom')
28 conflicts=('nginx' 'nginx-unstable' 'nginx-svn')
29 provides=('nginx')
30 options=('!emptydirs')
31 backup=("etc/nginx/conf/fastcgi.conf"
32         "etc/nginx/conf/fastcgi_params"
33         "etc/nginx/conf/koi-win"
34         "etc/nginx/conf/koi-utf"
35         "etc/nginx/conf/mime.types"
36         "etc/nginx/conf/nginx.conf"
37         "etc/nginx/conf/scgi_params"
38         "etc/nginx/conf/uwsgi_params"
39         "etc/nginx/conf/win-utf"
40         "etc/logrotate.d/nginx"
41         "etc/conf.d/nginx")
42 source=(http://nginx.org/download/${_pkgname}-$pkgver.tar.gz
43         nginx)
45 _doc_root=/usr/share/nginx/http
46 _server_root=/etc/nginx
47 _conf_path=${_server_root}/conf
48 _tmp_path=/var/spool/nginx
49 _log_path=/var/log/nginx
50 _user=http
51 _group=http
53 build() {
54         cd $srcdir/${_pkgname}-${pkgver}
56         ./configure \
57                 --with-debug \
58                 --prefix=${_server_root} \
59                 --sbin-path=/usr/sbin/nginx \
60                 --pid-path=/var/run/nginx.pid \
61                 --lock-path=/var/lock/nginx.lock \
62                 --http-client-body-temp-path=${_tmp_path}/client_body_temp \
63                 --http-proxy-temp-path=${_tmp_path}/proxy_temp \
64                 --http-fastcgi-temp-path=${_tmp_path}/fastcgi_temp \
65                 --http-log-path=${_log_path}/access.log \
66                 --error-log-path=${_log_path}/error.log \
67                 --user=${_user} --group=${_group} \
68                 --with-imap \
69                 --with-imap_ssl_module \
70                 --with-http_ssl_module \
71                 --with-http_stub_status_module \
72                 --with-http_dav_module \
73                 --with-http_gzip_static_module \
74                 --with-ipv6 \
75                 --add-module=/usr/lib/passenger/ext/nginx \
76                 --http-scgi-temp-path=${_tmp_path} \
77                 --http-uwsgi-temp-path=${_tmp_path} \
78                 --with-rtsig_module \
79                 --with-select_module \
80                 --with-poll_module \
81                 --with-file-aio \
82                 --with-http_realip_module \
83                 --with-http_addition_module \
84                 --with-http_xslt_module \
85                 --with-http_image_filter_module \
86                 --with-http_geoip_module \
87                 --with-http_sub_module \
88                 --with-http_flv_module \
89                 --with-http_mp4_module \
90                 --with-http_random_index_module \
91                 --with-http_secure_link_module \
92                 --with-http_perl_module \
93                 --with-http_degradation_module \
94                 --with-mail \
95                 --with-mail_ssl_module \
96         --with-cpp_test_module 
97    #     --with-google_perftools_module \
99         make
102 package() {
103         cd "$srcdir/nginx-${pkgver}"
104         make DESTDIR="$pkgdir" install
106         install -d "$pkgdir"/etc/logrotate.d/
107         cat <<EOF > $pkgdir/etc/logrotate.d/nginx
108         $_log_path/*log {
109                 create 640 http log
110                 compress
111                 postrotate
112                         /bin/kill -USR1 \`cat /var/run/nginx.pid 2>/dev/null\` 2> /dev/null || true
113                 endscript
114         }
117         sed -i -e "s/\<user\s\+\w\+;/user $_user;/g" $pkgdir/$_conf_path/nginx.conf
119         install -d $pkgdir/$_tmp_path
121         # move default document root outside server root
122         install -d $pkgdir/$_doc_root
123         mv $pkgdir/$_server_root/html/* $pkgdir/$_doc_root/
124         rm -rf $pkgdir/$_server_root/html
125         rm -f $pkgdir/$_doc_root/index.html
127         # let's create links for relative paths in config file
128         ln -s $_log_path $pkgdir/$_server_root/logs
129         ln -s $_doc_root $pkgdir/$_server_root/html
131         install -D -m755 $srcdir/nginx $pkgdir/etc/rc.d/nginx
132         install -D -m644 LICENSE $pkgdir/usr/share/licenses/nginx/LICENSE
133         mkdir -p $pkgdir/etc/conf.d
134         echo "NGINX_CONFIG=/etc/nginx/conf/nginx.conf" >$pkgdir/etc/conf.d/nginx
135         rm -rf $pkgdir/var/run
136         install -d $pkgdir/usr/share/man/man8
137         gzip man/${_pkgname}.8 -c > ${pkgdir}/usr/share/man/man8/${_pkgname}.8.gz
139 md5sums=('2a98411773c87a98e92c5aa68f322338'
140          '0e8032d3ba26c3276e8c7c30588d375f')