summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0a822692b06f646a9f1b1e3a8dcaf07c48f6046f (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
# $Id$
# Maintainer: Martchus <martchus@gmx.net>

pkgname=nginx-mod-upstream-fair
pkgver=0.1.3
pkgrel=6
_dirname="nginx-upstream-fair-$pkgver"
_nginxver=1.18.0

pkgdesc='Fair load balancer module for nginx'
arch=('x86_64')
depends=("nginx=$_nginxver" "libutil-linux")
makedepends=("nginx-src")
url='https://github.com/itoffshore/nginx-upstream-fair'
license=('unknown')

source=("$pkgname-$pkgver::https://github.com/itoffshore/nginx-upstream-fair/archive/$pkgver.tar.gz")
sha256sums=('5545e2f2a27d008690a2c60b90c0bf8a997310930d93fca80ebd33dc308ac2fc')

prepare() {
  cd "$srcdir/$_dirname"
  echo '
  if [ "$ngx_module_link" = DYNAMIC ] ; then
      ngx_module_type=HTTP
      ngx_module_name=ngx_http_upstream_fair_module
      ngx_module_srcs="$ngx_addon_dir/ngx_http_upstream_fair_module.c"
      . auto/module
  fi' >> config
}

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

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