summaryrefslogtreecommitdiff
path: root/community/drbd
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-07-19 01:10:32 -0700
committerroot <root@rshg054.dnsready.net>2013-07-19 01:10:32 -0700
commit8fbc0076a4827ddc6af92e0b9daa4c4c31450808 (patch)
tree03fd0e2921ebd53228d9a93e32ed3976b636cbea /community/drbd
parente445a313723389ba9ee1fded025c567dae5b21ea (diff)
Fri Jul 19 01:09:18 PDT 2013
Diffstat (limited to 'community/drbd')
-rw-r--r--community/drbd/01-remove-old-sanity-check.diff24
-rw-r--r--community/drbd/PKGBUILD67
-rw-r--r--community/drbd/drbd.service19
3 files changed, 110 insertions, 0 deletions
diff --git a/community/drbd/01-remove-old-sanity-check.diff b/community/drbd/01-remove-old-sanity-check.diff
new file mode 100644
index 000000000..04edb7571
--- /dev/null
+++ b/community/drbd/01-remove-old-sanity-check.diff
@@ -0,0 +1,24 @@
+From: Lars Ellenberg <lars.ellenberg@linbit.com>
+Date: Thu, 3 Nov 2011 09:40:43 +0000 (+0100)
+Subject: build: remove old sanity check to allow build against linux 3.1
+X-Git-Url: http://git.drbd.org/gitweb.cgi?p=drbd-8.3.git;a=commitdiff_plain;h=790c26b09519b9e02b3a7cf7897fb17c2ae339bf
+
+build: remove old sanity check to allow build against linux 3.1
+---
+
+diff --git a/drbd/Makefile b/drbd/Makefile
+index 0985340..7a09603 100644
+--- a/drbd/Makefile
++++ b/drbd/Makefile
+@@ -90,11 +90,6 @@ else
+ endif
+ endif
+
+- KDIR_Makefile_PATCHLEVEL = $(shell test -e $(KDIR)/Makefile && grep "^PATCHLEVEL = " $(KDIR)/Makefile | cut -d " " -f 3)
+- ifneq ($(findstring $(KDIR_Makefile_PATCHLEVEL),12345),)
+- $(error "won't compile with this kernel version")
+- endif
+-
+ .PHONY: drbd.o default all greeting clean kbuild install dep tags
+
+ drbd.o: greeting kbuild
diff --git a/community/drbd/PKGBUILD b/community/drbd/PKGBUILD
new file mode 100644
index 000000000..62e027320
--- /dev/null
+++ b/community/drbd/PKGBUILD
@@ -0,0 +1,67 @@
+# $Id: PKGBUILD 90502 2013-05-12 23:31:07Z seblu $
+# Maintainer: Sébastien Luttringer
+
+pkgname=drbd
+pkgver=8.4.2
+pkgrel=2
+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=('b081f1046adda1d51ba351c40a8b1107'
+ '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:
diff --git a/community/drbd/drbd.service b/community/drbd/drbd.service
new file mode 100644
index 000000000..a8053fb05
--- /dev/null
+++ b/community/drbd/drbd.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Distributed Replicated Block Device
+After=systemd-modules-load.service network.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+
+# load config
+ExecStart=/usr/bin/drbdadm adjust all
+# user interruptible version of wait-connect all
+ExecStart=/usr/bin/drbdadm wait-con-int
+# become primary if configured
+ExecStart=/usr/bin/drbdadm sh-b-pri all
+# disconnect and detach all resources
+ExecStop=/usr/bin/drbdadm down all
+
+[Install]
+WantedBy=multi-user.target