summaryrefslogtreecommitdiff
path: root/community/ucarp/PKGBUILD
blob: 11548155e2666c7a62aab94b3e79029c7bf161e1 (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
51
52
53
54
55
56
# $Id: PKGBUILD 83576 2013-02-03 13:21:29Z seblu $
# Maintainer: Sébastien Luttringer <seblu@archlinux.org>

pkgname=ucarp
pkgver=1.5.2
pkgrel=4
pkgdesc='Userspace 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.service'
        'ucarp.8'
        '01-fix-getopt.patch'
        '02-fix-downscript-on-error.c')
md5sums=('e3caa733316a32c09e5d3817617e9145'
         '40fdef66560e3c98eb7c04adf7c31739'
         '2ccfdc464b88c437b38bd0324cf1fef3'
         '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
  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() {
  pushd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  # install examples files
  install -D -m 644 examples/linux/vip-down.sh \
    "$pkgdir/usr/share/doc/$pkgname/examples/vip-down.sh"
  install -D -m 644 examples/linux/vip-up.sh \
    "$pkgdir/usr/share/doc/$pkgname/examples/vip-up.sh"
  # install README
  install -D -m 644 README "$pkgdir/usr/share/doc/$pkgname/README"
  popd
  # add manpage
  install -D -m 644 $pkgname.8 "${pkgdir}/usr/share/man/man8/$pkgname.8"
  # systemd
  install -D -m 644 $pkgname.service \
    "${pkgdir}/usr/lib/systemd/system/$pkgname.service"

}

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