summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d833c12da16ef92bd9537100daf4c4d95dd72781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>

pkgname=nginx-mainline-mod-brotli
epoch=1
pkgver=1.0.0rc
pkgrel=5

_modname="ngx_${pkgname#nginx-mainline-mod-}"

pkgdesc="Brotli compression filter module for mainline nginx"
arch=('i686' 'x86_64' 'aarch64')
depends=('nginx-mainline' 'brotli')
makedepends=('nginx-mainline-src')
url="https://github.com/google/ngx_brotli"
license=('CUSTOM')

source=(https://github.com/google/$_modname/archive/v$pkgver/$_modname-$pkgver.tar.gz)
sha256sums=('c85cdcfd76703c95aa4204ee4c2e619aa5b075cac18f428202f65552104add3b')

prepare() {
	mkdir -p build
	cd build
	ln -sf /usr/src/nginx/auto
	ln -sf /usr/src/nginx/src

	cd "$srcdir"/$_modname-$pkgver
	sed 's@/usr/local@/usr@' -i config
}

build() {
	cd build
	/usr/src/nginx/configure --with-compat --add-dynamic-module=../$_modname-$pkgver
	make modules
}

package() {
	install -Dm644 "$srcdir"/$_modname-$pkgver/LICENSE \
	               "$pkgdir"/usr/share/licenses/$pkgname/LICENSE

	cd "$srcdir"/build/objs
	for mod in ngx_*.so; do
		install -Dm755 $mod "$pkgdir"/usr/lib/nginx/modules/$mod
	done
}