archrelease: copy trunk to extra-x86_64
[arch-packages.git] / nginx / repos / extra-x86_64 / PKGBUILD
blobca417010108fb0a75b411e5a795aee5b259c8487
1 # Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
2 # Contributor: Sébastien Luttringer
3 # Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
4 # Contributor: Miroslaw Szot <mss@czlug.icis.pcz.pl>
5 # Contributor: Daniel Micay <danielmicay@gmail.com>
7 pkgbase=nginx
8 pkgname=(nginx nginx-src)
9 pkgver=1.22.1
10 pkgrel=2
11 pkgdesc='Lightweight HTTP server and IMAP/POP3 proxy server'
12 arch=(x86_64)
13 url='https://nginx.org'
14 license=(custom)
15 depends=(pcre2 zlib openssl geoip mailcap libxcrypt)
16 makedepends=(mercurial)
17 checkdepends=(perl perl-gd perl-io-socket-ssl perl-fcgi perl-cache-memcached
18               memcached ffmpeg)
19 backup=(etc/nginx/fastcgi.conf
20         etc/nginx/fastcgi_params
21         etc/nginx/koi-win
22         etc/nginx/koi-utf
23         etc/nginx/nginx.conf
24         etc/nginx/scgi_params
25         etc/nginx/uwsgi_params
26         etc/nginx/win-utf
27         etc/logrotate.d/nginx)
28 install=nginx.install
29 source=($url/download/nginx-$pkgver.tar.gz{,.asc}
30         hg+https://hg.nginx.org/nginx-tests#revision=34fc85598287
31         service
32         logrotate)
33 validpgpkeys=('B0F4253373F8F6F510D42178520A9993A1C052F8' # Maxim Dounin <mdounin@mdounin.ru>
34               '13C82A63B603576156E30A4EA0EA981B66B0D967') # Konstantin Pavlov <thresh@nginx.com>
35 sha512sums=('1d468dcfa9bbd348b8a5dc514ac1428a789e73a92384c039b73a51ce376785f74bf942872c5594a9fcda6bbf44758bd727ce15ac2395f1aa989c507014647dcc'
36             'SKIP'
37             'SKIP'
38             'be2858613d9cca85d80e7b894e9d5fa7892cbddd7a677d2d2f68f419d75fdc1f6802de8014f43ce063b116afd4ff17369873a6adea2dd58ac6f94e617de66fec'
39             '9232342c0914575ce438c5a8ee7e1c25b0befb457a2934e9cb77d1fe9a103634ea403b57bc0ef0cd6cf72248aee5e5584282cea611bc79198aeac9a65d8df5d7')
41 _common_flags=(
42   --with-compat
43   --with-debug
44   --with-file-aio
45   --with-http_addition_module
46   --with-http_auth_request_module
47   --with-http_dav_module
48   --with-http_degradation_module
49   --with-http_flv_module
50   --with-http_geoip_module
51   --with-http_gunzip_module
52   --with-http_gzip_static_module
53   --with-http_mp4_module
54   --with-http_realip_module
55   --with-http_secure_link_module
56   --with-http_slice_module
57   --with-http_ssl_module
58   --with-http_stub_status_module
59   --with-http_sub_module
60   --with-http_v2_module
61   --with-mail
62   --with-mail_ssl_module
63   --with-pcre-jit
64   --with-stream
65   --with-stream_geoip_module
66   --with-stream_realip_module
67   --with-stream_ssl_module
68   --with-stream_ssl_preread_module
69   --with-threads
72 _stable_flags=(
75 prepare() {
76   cp -r $pkgbase-$pkgver{,-src}
79 build() {
80   cd $pkgbase-$pkgver
82   ./configure \
83     --prefix=/etc/nginx \
84     --conf-path=/etc/nginx/nginx.conf \
85     --sbin-path=/usr/bin/nginx \
86     --pid-path=/run/nginx.pid \
87     --lock-path=/run/lock/nginx.lock \
88     --user=http \
89     --group=http \
90     --http-log-path=/var/log/nginx/access.log \
91     --error-log-path=stderr \
92     --http-client-body-temp-path=/var/lib/nginx/client-body \
93     --http-proxy-temp-path=/var/lib/nginx/proxy \
94     --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
95     --http-scgi-temp-path=/var/lib/nginx/scgi \
96     --http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
97     --with-cc-opt="$CFLAGS $CPPFLAGS" \
98     --with-ld-opt="$LDFLAGS" \
99     ${_common_flags[@]} \
100     ${_stable_flags[@]}
102   make
105 check() {
106   cd nginx-tests
107   TEST_NGINX_BINARY="$srcdir/$pkgbase-$pkgver/objs/nginx" prove .
110 package_nginx() {
111   cd $pkgbase-$pkgver
112   make DESTDIR="$pkgdir" install
114   sed -e 's|\<user\s\+\w\+;|user http;|g' \
115     -e '44s|html|/usr/share/nginx/html|' \
116     -e '54s|html|/usr/share/nginx/html|' \
117     -i "$pkgdir"/etc/nginx/nginx.conf
119   rm "$pkgdir"/etc/nginx/*.default
120   rm "$pkgdir"/etc/nginx/mime.types  # in mailcap
122   install -d "$pkgdir"/var/lib/nginx
123   install -dm700 "$pkgdir"/var/lib/nginx/proxy
125   chmod 755 "$pkgdir"/var/log/nginx
126   chown root:root "$pkgdir"/var/log/nginx
128   install -d "$pkgdir"/usr/share/nginx
129   mv "$pkgdir"/etc/nginx/html/ "$pkgdir"/usr/share/nginx
131   install -Dm644 ../logrotate "$pkgdir"/etc/logrotate.d/nginx
132   install -Dm644 ../service "$pkgdir"/usr/lib/systemd/system/nginx.service
133   install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
135   rmdir "$pkgdir"/run
137   install -d "$pkgdir"/usr/share/man/man8/
138   gzip -9c man/nginx.8 > "$pkgdir"/usr/share/man/man8/nginx.8.gz
140   for i in ftdetect ftplugin indent syntax; do
141     install -Dm644 contrib/vim/$i/nginx.vim \
142       "$pkgdir/usr/share/vim/vimfiles/$i/nginx.vim"
143   done
146 package_nginx-src() {
147   pkgdesc="Source code of nginx $pkgver, useful for building modules"
148   depends=()
149   install -d "$pkgdir/usr/src"
150   cp -r $pkgbase-$pkgver-src "$pkgdir/usr/src/nginx"