APKBUILD 1.82 KB
Newer Older
Roland Kammerer's avatar
Roland Kammerer committed
1 2 3
# Contributor: Roland Kammerer <roland.kammerer@linbit.com>
# Maintainer: Roland Kammerer <roland.kammerer@linbit.com>
_usname=drbd
4
_flavor=${FLAVOR:-hardened}
5 6 7
_name=$_usname-$_flavor

_kpkg=linux-$_flavor
8 9
_kver=4.9.25
_kpkgrel=0
10

11
_usver=9.0.6
12 13 14 15 16
# upstream now also has a -rel in the tar-balls
# set it here for "source", but don't mangle it into pkgrel/_mypkgrel
# if there is a new upstream rel (eg. 9.0.1-2), we just increase _mypkgrel
_usrel=1

17
_mypkgrel=0
18 19 20 21 22 23 24

_kernelver=$_kver-r$_kpkgrel
_abi_release=${_kver}-${_kpkgrel}-${_flavor}

pkgname=${_usname}9-$_flavor
pkgver=$_kver
pkgrel=$(($_kpkgrel + $_mypkgrel))
Roland Kammerer's avatar
Roland Kammerer committed
25 26
pkgdesc="Network-based RAID 1 version 9"
url="http://www.drbd.org"
27
arch="x86 x86_64 armhf"
Roland Kammerer's avatar
Roland Kammerer committed
28
license="GPL"
29
depends="linux-${_flavor}=${_kernelver}"
Roland Kammerer's avatar
Roland Kammerer committed
30
depends_dev=""
31
makedepends="linux-${_flavor}-dev bash"
Roland Kammerer's avatar
Roland Kammerer committed
32 33
install=""
subpackages=""
34
provides="${_usname}9-grsec=${pkgver}-r${pkgrel}"
35
source="http://www.drbd.org/download/$_usname/${_usver%.*}/$_usname-$_usver-$_usrel.tar.gz"
Roland Kammerer's avatar
Roland Kammerer committed
36

37
_builddir=$srcdir/$_usname-$_usver-$_usrel
Roland Kammerer's avatar
Roland Kammerer committed
38 39
prepare() {
	local i
40
	# verify the kernel version
41 42
	(cd $startdir
	if [ -f ../../main/linux-${_flavor}/APKBUILD ]; then
43 44 45 46 47
		. ../../main/linux-${_flavor}/APKBUILD
		[ "$_kver" != "$pkgver" ] \
			&& die "please update _kver to $pkgver"
		[ "$_kpkgrel" != "$pkgrel" ] \
			&& die "please update _kpkgrel to $pkgrel"
48 49 50 51
	else
		die "could not determine kernel flavor: linux-${_flavor}"
	fi
	return 0) || return 1
52 53


Roland Kammerer's avatar
Roland Kammerer committed
54 55 56 57 58 59 60 61 62 63
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
64
	make KVER=$_abi_release || return 1
Roland Kammerer's avatar
Roland Kammerer committed
65 66 67 68
}

package() {
	cd "$_builddir"
69
	make DESTDIR="$pkgdir" install || return 1
Roland Kammerer's avatar
Roland Kammerer committed
70 71
}

72
sha512sums="f035d94f6dfe05849a2756e45d1423a097a917c377dff00b55080b81195d299efc0f189fe043784ade610aca07bae23dce4228fb238c21581348fa0eb6a8b54d  drbd-9.0.6-1.tar.gz"