Skip to content

Instantly share code, notes, and snippets.

@thomasfr
Created June 19, 2013 11:33
Show Gist options
  • Save thomasfr/5813612 to your computer and use it in GitHub Desktop.
Save thomasfr/5813612 to your computer and use it in GitHub Desktop.
Arch AUR PKGBUILD file for nginx with google pagespeed
# $Id$
# Maintainer: Sergej Pupykin <[email protected]>
# Maintainer: Bartłomiej Piotrowski <[email protected]>
# Contributor: Miroslaw Szot <[email protected]>
# nginx-pagespeed maintainer: Ludovic Fauvet <[email protected]>
_cfgdir=/etc/nginx
_tmpdir=/var/lib/nginx
pkgname=nginx-pagespeed
_pkgname=nginx
pkgver=1.4.1
pkgrel=3
pkgdesc='Lightweight HTTP server and IMAP/POP3 proxy server with ngx_pagespeed'
arch=('i686' 'x86_64')
depends=('pcre' 'zlib' 'openssl' 'geoip')
#makedepends=('passenger')
provides=('nginx')
conflicts=('nginx')
url="http://nginx.org"
license=('custom')
install=nginx.install
backup=(${_cfgdir:1}/fastcgi.conf
${_cfgdir:1}/fastcgi_params
${_cfgdir:1}/koi-win
${_cfgdir:1}/koi-utf
${_cfgdir:1}/mime.types
${_cfgdir:1}/nginx.conf
${_cfgdir:1}/scgi_params
${_cfgdir:1}/uwsgi_params
${_cfgdir:1}/win-utf
etc/logrotate.d/nginx)
source=(http://nginx.org/download/nginx-$pkgver.tar.gz
service
logrotate
https://github.com/pagespeed/ngx_pagespeed/archive/release-1.5.27.3-beta.zip
https://dl.google.com/dl/page-speed/psol/1.5.27.3.tar.gz)
sha256sums=('bca5d1e89751ba29406185e1736c390412603a7e6b604f5b4575281f6565d119'
'05fdc0c0483410944b988d7f4beabb00bec4a44a41bd13ebc9b78585da7d3f9b'
'9523a1fdd5eb61bf62f3049f6ee088b198e36d5edcce2d9b08bbeb2930aa5a16'
'90fd33e75b726109635c42d314aab98fa85cfcaac655bb2b98d7f58f1642cef3'
'2f93d394e9a1932d1287460563cdde078ac76f8163856d68088d170a38ab6901')
build() {
ln -sf "$srcdir"/psol "$srcdir"/ngx_pagespeed-release*
cd "$srcdir"/$_pkgname-$pkgver
./configure \
--prefix=$_cfgdir \
--conf-path=$_cfgdir/nginx.conf \
--sbin-path=/usr/bin/nginx \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--user=http --group=http \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log \
--http-client-body-temp-path=$_tmpdir/client-body \
--http-proxy-temp-path=$_tmpdir/proxy \
--http-fastcgi-temp-path=$_tmpdir/fastcgi \
--http-scgi-temp-path=$_tmpdir/scgi \
--http-uwsgi-temp-path=$_tmpdir/uwsgi \
--with-ipv6 --with-pcre-jit \
--with-file-aio \
--with-http_gunzip_module \
--add-module=../ngx_pagespeed-release-1.5.27.3-beta \
--without-http_browser_module \
--without-http_empty_gif_module \
--without-http_limit_req_module \
--without-http_limit_conn_module \
--without-http_charset_module \
--without-http_ssi_module \
--without-http_geo_module \
--without-http_map_module \
--without-http_autoindex_module \
--without-http_split_clients_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--with-http_geoip_module \
--without-http_uwsgi_module \
--without-http_scgi_module \
--with-http_ssl_module \
--with-http_spdy_module
make
}
package() {
cd "$srcdir"/$_pkgname-$pkgver
make DESTDIR="$pkgdir" install
sed -e 's|\<user\s\+\w\+;|user html;|g' \
-e '44s|html|/usr/share/nginx/html|' \
-e '54s|html|/usr/share/nginx/html|' \
-i "$pkgdir"/etc/nginx/nginx.conf
rm "$pkgdir"/etc/nginx/*.default
install -d "$pkgdir"/$_tmpdir
install -dm700 "$pkgdir"/$_tmpdir/proxy
chmod 750 "$pkgdir"/var/log/nginx
chown http:log "$pkgdir"/var/log/nginx
install -d "$pkgdir"/usr/share/nginx
mv "$pkgdir"/etc/nginx/html/ "$pkgdir"/usr/share/nginx
install -Dm644 "$srcdir"/logrotate "$pkgdir"/etc/logrotate.d/nginx
install -Dm644 "$srcdir"/service "$pkgdir"/usr/lib/systemd/system/nginx.service
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/nginx/LICENSE
rm -rf "$pkgdir"/var/run
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment