summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 10083d88f8e39cea19a9704648de02ef729db7ef (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
# Maintainer: Fijxu <fijxu at nadeko dot net>

pkgname=nginx-mainline-mod-zstd
pkgver=0.1.1
pkgrel=1
_modname="zstd-nginx-module"

pkgdesc="Nginx modules for the Zstandard compression"
arch=('x86_64')
url="https://github.com/tokers/zstd-nginx-module"
license=('BSD-2-Clause')
depends=('zstd>=1.4.0' 'glibc')
makedepends=('git' 'nginx-mainline-src')
provides=('nginx-mainline-mod-zstd')
conflicts=('nginx-mainline-mod-zstd')
source=(https://github.com/tokers/zstd-nginx-module/archive/refs/tags/$pkgver.tar.gz)
sha256sums=('707d534f8ca4263ff043066db15eac284632aea875f9fe98c96cea9529e15f41')

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

	cd "$srcdir"/zstd-nginx-module-$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
}