summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4bd67f5ef09f0b0326289cb2af8284c05485ea86 (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
# Maintainer: Jonathan Steel <jsteel at archlinux.org>
# Contributor: S├ębastien Luttringer

pkgname=drbd-utils
pkgver=9.16.0
pkgrel=1
arch=('x86_64')
pkgdesc='Userland tools for Distributed Replicated Block Device'
url='https://www.linbit.com/en/drbd-community/drbd-download/'
license=('GPL2')
depends=('perl' 'bash')
makedepends=('libxslt' 'systemd' 'po4a')
conflicts=('drbd')
replaces=('drbd')
source=(http://www.linbit.com/downloads/drbd/utils/drbd-utils-$pkgver.tar.gz)
backup=('etc/drbd.conf' 'etc/drbd.d/global_common.conf')
md5sums=('b0b7a94b7f3e4127f1e31405ecf01932')

build() {
  cd $pkgname-$pkgver
  ./configure \
    --prefix=/usr \
    --localstatedir=/var \
    --sysconfdir=/etc \
    --sbindir=/usr/bin \
    --libdir=/usr/lib \
    --with-distro=generic \
    --with-bashcompletion \
    --with-initscripttype=systemd \
    --with-udev \
    --without-rgmanager \
    --without-pacemaker \
    --without-heartbeat \
    --without-83support \
    --without-manual \
    --without-xen
  make
}

package() {
  make -C $pkgname-$pkgver DESTDIR="$pkgdir" install

  cd "$pkgdir"

  # move /lib files under /usr/lib
  mv lib/drbd/* usr/lib/drbd
  rmdir lib/drbd lib

  # move bash completion
  install -dm 755 usr/share/bash-completion
  mv etc/bash_completion.d usr/share/bash-completion/completions

  # remove /var/lock and /var/run
  rm -r var/{lock,run}

  # autoload module
  install -Dm 644 /dev/null usr/lib/modules-load.d/drbd.conf
  echo 'drbd' > usr/lib/modules-load.d/drbd.conf
}