summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 89fbb08737948ca565e472f3ba817af5dfa4acb3 (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: Clar Fon <clarfon@pm.me>
pkgname=nginx-mainline-mod-uaparser-git
pkgver=r1.f5a1e52
pkgrel=7
_modname="nginx-uaparser-module"
pkgdesc="User agent parser module for mainline nginx"
arch=('i686' 'x86_64')
makedepends=("nginx-mainline-src")
depends=('nginx-mainline' 'uap-cpp-git')
provides=('nginx-mainline-mod-uaparser' 'nginx-mod-uaparser')
url="https://github.com/clarfon/nginx-uaparser-module"
license=('CC0')
source=("git+https://github.com/clarfonthey/$_modname.git")
sha256sums=('SKIP')

pkgver() {
  cd "$srcdir/$_modname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}


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

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

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

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