summaryrefslogtreecommitdiff
path: root/community/drbd/PKGBUILD
blob: f8505196c0d495c2d28e7c88dae5f0e338591cc7 (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
62
63
64
65
66
67
# $Id: PKGBUILD 97092 2013-09-12 13:47:56Z seblu $
# Maintainer: Sébastien Luttringer

pkgname=drbd
pkgver=8.4.3
pkgrel=1
arch=('i686' 'x86_64')
pkgdesc='Userland tools for Distributed Replicated Block Device'
url='http://www.drbd.org'
license=('GPL2')
depends=('perl' 'bash')
source=("http://oss.linbit.com/drbd/8.4/$pkgname-$pkgver.tar.gz"
        "$pkgname.service")
backup=('etc/drbd.conf' 'etc/drbd.d/global_common.conf')
md5sums=('0c54a69603fa28b41de5fb33e03fd9e8'
         '7dc909b5895c0b5289d3ee0581d7d333')

prepare() {
  # fix hardcoded path in udev rules
  sed -i 's,/sbin/drbdadm,/usr/bin/drbdadm,' $pkgname-$pkgver/scripts/drbd.rules
}

build() {
  cd $pkgname-$pkgver
  ./configure \
    --prefix=/usr \
    --localstatedir=/var \
    --sysconfdir=/etc \
    --sbindir=/usr/bin \
    --with-distro=generic \
    --with-utils \
    --with-bashcompletion \
    --with-udev \
    --without-km \
    --without-rgmanager \
    --without-pacemaker \
    --without-heartbeat \
    --without-xen \
    --without-legacy_utils
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  # move forced /sbin binaries
  cd "$pkgdir"
  mv sbin/* usr/bin
  rmdir sbin
  # move udev files
  mv etc/udev usr/lib
  # move bash completion
  install -dm 755 usr/share/bash-completion
  mv etc/bash_completion.d usr/share/bash-completion/completions
  # remove /var/lock
  rmdir var/lock
  # remove embeded init stuff
  rm -r etc/init.d
  # autoload module
  install -Dm 644 /dev/null usr/lib/modules-load.d/$pkgname.conf
  echo 'drbd' > usr/lib/modules-load.d/$pkgname.conf
  # systemd
  install -Dm 644 "$srcdir/$pkgname.service" \
    "$pkgdir/usr/lib/systemd/system/$pkgname.service"
}

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