summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0df1fe562e79b97a3fa7d761f0ae8b1462d97729 (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: Fabiano Furtado a.k.a. fusca < fusca14 *at* gmail *dot* com >

pkgname=nginx-mod-sticky
pkgver=0.0.2
pkgrel=2

_modname="${pkgname#nginx-mod-}"
_rep_name='nginx_'$_modname'_module_ng'
_mod_dir=$pkgname'_v'$pkgver

pkgdesc='NGINX sticky module - add a sticky cookie to be always forwarded to the same upstream server - tested with NGINX 1.26.0.'
arch=('x86_64')
depends=('nginx')
makedepends=('nginx-src')
url='https://github.com/fabianofurtado/nginx_sticky_module_ng'
license=('GPL3')

source=(
  https://github.com/fabianofurtado/$_rep_name/archive/refs/tags/v$pkgver.tar.gz
)
b2sums=('c07cce500d90f9341c1cfbd16aa4b88e8e60d40f2934450398a10f675e305ee5199865763f7a02f9c7be03c4a38cf96b92fed9cbb38f614b02b0315fab8dab2c')

prepare() {
  mv $_rep_name-$pkgver/ $_mod_dir/
  mkdir -p build
  cd build
  ln -sf /usr/src/nginx/auto
  ln -sf /usr/src/nginx/src
}

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

package() {
  cd build/objs
  for ngx_mod in *.so; { install -Dm640 $ngx_mod $pkgdir'/usr/lib/nginx/modules/'$ngx_mod; }

  install -Dm644 $srcdir'/'$_mod_dir'/README.md' \
                 $pkgdir'/usr/share/licenses/'$pkgname'/README.md'
}