APKBUILD 1.93 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 5 6 7
_flavor=${FLAVOR:-grsec}
_name=$_usname-$_flavor

_kpkg=linux-$_flavor
8
_kver=4.4.34
9
_kpkgrel=1
10

11
_usver=9.0.5
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 29 30 31 32 33
license="GPL"
depends=""
depends_dev=""
makedepends="linux-grsec-dev"
install=""
subpackages=""
34
source="http://www.drbd.org/download/$_usname/${_usver%.*}/$_usname-$_usver-$_usrel.tar.gz"
Roland Kammerer's avatar
Roland Kammerer committed
35

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


Roland Kammerer's avatar
Roland Kammerer committed
53 54 55 56 57 58 59 60 61 62
	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"
63
	make KCFLAGS="-fno-pie" KVER=$_abi_release || return 1
Roland Kammerer's avatar
Roland Kammerer committed
64 65 66 67
}

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

71 72 73
md5sums="a357faf4b64121f636203913d1e2adcf  drbd-9.0.5-1.tar.gz"
sha256sums="4926b17a7b8ed3916671024117f40570efac01fd9f27ea159838fa4d62e03d62  drbd-9.0.5-1.tar.gz"
sha512sums="27ff8a475271ea952bd6d7e1b34eba4e15e13d597636d3589b711a7cd9d0a9827ac79064f731493af18c7854b097cb68c93919c7354797705e1a6b7d94590ecc  drbd-9.0.5-1.tar.gz"