summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a4176eecae18cfc8d033106cf8f0522baef66340 (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
45
# Maintainer: Shalygin Konstantin <k0ste@k0ste.ru>
# Contributor: Shalygin Konstantin <k0ste@k0ste.ru>

_modname='ngx_dynamic_etag'
pkgname='nginx-mainline-mod-dynamic-etag-git'
pkgver=r60.186d57b
pkgrel='1'
pkgdesc='Module empowers your dynamic content with automatic ETag header'
arch=('x86_64' 'aarch64')
depends=('nginx-mainline')
makedepends=('git' 'nginx-mainline-src')
url="https://github.com/dvershinin/${_modname}"
source=("git+${url}.git")
license=('BSD')
sha256sums=('SKIP')

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

prepare() {
  mkdir --parents "build"
  cd "build"
  ln --symbolic --force "/usr/src/nginx/auto"
  ln --symbolic --force "/usr/src/nginx/src"
}

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

package() {
  install -Dm0644 "${_modname}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"

  cd "build/objs"
  for mod in *".so"
    do
      install -Dm0755 "${mod}" -t "${pkgdir}/usr/lib/nginx/modules"
  done
}