APKBUILD 1.79 KB
Newer Older
Carlo Landmeter's avatar
Carlo Landmeter committed
1
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
2
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
Carlo Landmeter's avatar
Carlo Landmeter committed
3

4 5
# when changing _ver we *must* bump _rel
_name=zfs
6
_ver=0.8.2
7
_rel=0
Carlo Landmeter's avatar
Carlo Landmeter committed
8

9
_flavor=${FLAVOR:-vanilla}
Carlo Landmeter's avatar
Carlo Landmeter committed
10
_kpkg=linux-$_flavor
11
_kver=4.19.84
12
_krel=0
Carlo Landmeter's avatar
Carlo Landmeter committed
13

14 15
_kpkgver="$_kver-r$_krel"
_kabi="$_kver-$_krel-$_flavor"
Carlo Landmeter's avatar
Carlo Landmeter committed
16

17
pkgname=$_name-$_flavor
Carlo Landmeter's avatar
Carlo Landmeter committed
18
pkgver=$_kver
19 20
pkgrel=$(( $_krel + $_rel ))

Carlo Landmeter's avatar
Carlo Landmeter committed
21 22
pkgdesc="ZFS for Linux"
url="http://zfsonlinux.org"
23
arch="x86 x86_64 aarch64 ppc64le"
24
license="CDDL-1.0"
TBK's avatar
TBK committed
25 26
provides="spl-vanilla" # Mitigate upgrade conflicts
depends="$_kpkg=$_kpkgver"
Carlo Landmeter's avatar
Carlo Landmeter committed
27
depends_dev="glib-dev e2fsprogs-dev util-linux-dev libtirpc-dev
TBK's avatar
TBK committed
28
	$_kpkg-dev=$_kpkgver"
Carlo Landmeter's avatar
Carlo Landmeter committed
29
makedepends="$depends_dev automake autoconf libtool linux-headers"
30
install_if="zfs $_kpkg=$_kpkgver"
Carlo Landmeter's avatar
Carlo Landmeter committed
31
subpackages="$pkgname-dev"
32 33
source="https://github.com/zfsonlinux/zfs/releases/download/zfs-$_ver/zfs-$_ver.tar.gz"
builddir="$srcdir/$_name-$_ver"
Carlo Landmeter's avatar
Carlo Landmeter committed
34 35 36

prepare() {
	default_prepare
37 38 39 40 41 42 43 44 45 46
	# verify the kernel version
	local _kapkbuild=../../main/linux-$_flavor-/APKBUILD
	if [ -f $_kapkbuild ]; then
		(	. $_kapkbuild
			pkgname=$_name-$_flavor
			[ "$_kver" != "$pkgver" ] && die "please update _kver to $pkgver"
			[ "$_krel" != "$pkgrel" ] && die "please update _krel to $pkgrel"
			return 0
		)
	fi
47
	autoreconf -vif
Carlo Landmeter's avatar
Carlo Landmeter committed
48 49 50 51 52 53 54 55 56 57 58
}

build() {
	cd "$builddir"
	./configure --prefix=/usr \
		--with-tirpc \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--with-config=kernel \
TBK's avatar
TBK committed
59
		--with-linux=/usr/src/linux-headers-${_kabi}
60 61

	make
Carlo Landmeter's avatar
Carlo Landmeter committed
62 63 64 65
}

package() {
	cd "$builddir"
66
	make DESTDIR="$pkgdir" install
Carlo Landmeter's avatar
Carlo Landmeter committed
67 68 69 70
}

dev() {
	mkdir -p "$subpkgdir"/usr
71 72
	mv "$pkgdir"/usr/src "$subpkgdir"/usr
	default_dev
Carlo Landmeter's avatar
Carlo Landmeter committed
73 74
}

75
sha512sums="1424b1a030b814f812b5da422100669db5b8c3ccae14c2fdd62a5e0df28e7255247fe5ca99c95a14f08c92cc1574c22dd132093e4a1dd81e38c95b10cc5e2496  zfs-0.8.2.tar.gz"