summaryrefslogtreecommitdiff
path: root/community/drbd/PKGBUILD
blob: 970a0d18026f6c593a8ee53bed135e1d638e28ce (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
57
58
59
60
61
# $Id: PKGBUILD 69076 2012-04-08 23:26:43Z seblu $
# Maintainer: Sébastien Luttringer <seblu@aur.archlinux.org>

pkgname=drbd
pkgver=8.3.11
pkgrel=3
arch=('i686' 'x86_64')
pkgdesc='Userland tools for drbd block devices'
url='http://www.drbd.org'
license=('GPL2')
source=("http://oss.linbit.com/drbd/8.3/$pkgname-$pkgver.tar.gz"
        "$pkgname.rc"
        '01-remove-old-sanity-check.diff')
backup=('etc/drbd.conf' 'etc/drbd.d/global_common.conf')
md5sums=('e47a35a80143b72e9708844efbe2e608'
         '6a91609fcd69b435a2a96599f07ad856'
         '24144d23b31f9ce66929fe989247c779')

build() {
  cd $pkgname-$pkgver
  # patch bad sanity check in makefile
  patch -p1 -i ../01-remove-old-sanity-check.diff
  ./configure \
    --prefix=/usr \
    --localstatedir=/var \
    --sysconfdir=/etc \
    --with-distro=generic \
    --with-utils \
    --with-bashcompletion \
    --with-udev \
    --without-km \
    --without-rgmanager \
    --without-pacemaker \
    --without-heartbeat \
    --without-xen \
    --with-initdir=/etc/rc.d
    #--with-legacy_utils \
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  # move forced /sbin binaries and fix harcoded path
  mv "$pkgdir/sbin"/* "$pkgdir/usr/sbin"
  rmdir "$pkgdir/sbin"
  sed -i 's,/sbin/drbdadm,/usr/sbin/drbdadm,' \
    "$pkgdir/etc/udev/rules.d/65-drbd.rules"
  # move udev files
  mv "$pkgdir/etc/udev" "$pkgdir/usr/lib"
  # move bash completion
  install -d -m 755 "$pkgdir/usr/share/bash-completion"
  mv "$pkgdir/etc/bash_completion.d" \
    "$pkgdir/usr/share/bash-completion/completions"
  # remove /var/lock
  rmdir "$pkgdir/var/lock"
  # setup initscript (replace)
  install -D -m 755 ../$pkgname.rc "$pkgdir/etc/rc.d/$pkgname"
}

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