summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3b9689a70f5d5d1afe536eeff1fa1392cbf26aa2 (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
# Maintainer: Rene Peinthor <peinthor@gmail.com>

pkgname=drbd-utils-git
pkgver=9.3.1
pkgrel=1
arch=('x86_64')
pkgdesc='Userland tools for Distributed Replicated Block Device'
url='https://www.drbd.org'
license=('GPL2')
depends=('perl' 'bash')
makedepends=('git' 'libxslt' 'systemd')
provides=('drbd-utils=${pkgver}')
conflicts=('drbd-utils')
replaces=('drbd-utils')
source=("git+https://github.com/LINBIT/drbd-utils.git")
backup=('etc/drbd.conf' 'etc/drbd.d/global_common.conf')
md5sums=('SKIP')

build() {
  cd $srcdir/drbd-utils
  ./autogen.sh
  ./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-xen
  make
}

package() {
  make -C $srcdir/drbd-utils 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
  rmdir var/lock

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

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