summaryrefslogtreecommitdiff
path: root/community/ucarp/PKGBUILD
blob: fa1879371c0a251731fa0269f9dc9a9522bc1674 (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
46
47
48
49
50
# $Id$ 
# Maintainer: Sebastien Luttringer <seblu+arch@seblu.net>

pkgname=ucarp
pkgver=1.5.2
pkgrel=1
pkgdesc='UCARP is a portable implementation of the CARP protocol'
arch=('i686' 'x86_64')
url='http://www.ucarp.org/project/ucarp'
license=('GPL2')
depends=('libpcap')
optdepends=('iproute2')
source=("http://download.pureftpd.org/pub/ucarp/ucarp-$pkgver.tar.gz"
        'ucarp.rc'
        'ucarp.conf'
        '01-fix-getopt.patch'
        '02-fix-downscript-on-error.c')
md5sums=('e3caa733316a32c09e5d3817617e9145'
         'd941d2978c5b43154a29212115729519'
         '35d1aabe416384e6fd8bd62312dbdb25'
         '3f20699aaf2ef8139dcd337f1e7f06ab'
         '09d26233c37956cf08e629554a91b8cd')

build() {
  cd $pkgname-$pkgver
  patch -N -p1 -i ../01-fix-getopt.patch
  patch -N -p1 -i ../02-fix-downscript-on-error.c

  ./configure --prefix=/usr --mandir=/usr/share/man
  make

  # fix iproute2 path
  sed -i "s|/sbin|/usr/sbin|g" examples/linux/vip-down.sh
  sed -i "s|/sbin|/usr/sbin|g" examples/linux/vip-up.sh
}

package() {
  # add initscripts
  install -D -m 755 $pkgname.rc "${pkgdir}/etc/rc.d/$pkgname"
  install -D -m 644 $pkgname.conf "${pkgdir}/etc/conf.d/$pkgname"

  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install

  install -D -m 755 examples/linux/vip-down.sh "$pkgdir/etc/ucarp/vip-down.sh"
  install -D -m 755 examples/linux/vip-up.sh "$pkgdir/etc/ucarp/vip-up.sh"

}

# vim:set ts=2 sw=2 ft=sh et: