summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a47bc774847bc89062612fbc6df8ff8082f3140d (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
# Packager: urawotlol <urawotlol@mailfence.com>
# Maintainer: Brian Bidulock <bidulock@openss7.org>
# Contributor: Jonathan Steel <jsteel at archlinux.org>
# Contributor: S├ębastien Luttringer

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

prepare() {
  cd $pkgname-$pkgver
  sed -i -e "s: -Wshadow: -Wshadow $LDFLAGS:" user/drbdmon/Makefile.in
}

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 establish /var/lib/drbd when installed
  rm -r var
  install -Dm 644 /dev/null usr/lib/tmpfiles.d/drbd.conf
  echo "d /var/lib/drbd" >usr/lib/tmpfiles.d/drbd.conf

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