aboutsummaryrefslogtreecommitdiffstats
path: root/main/zfs-vanilla/APKBUILD
blob: e4bfe7c22f17d6354e37b95b59ae01ebd1b70284 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>

_flavor=${FLAVOR:-vanilla}
_realname=zfs
_name=$_realname-$_flavor

_kpkg=linux-$_flavor
_kver=4.9.28
_kpkgrel=1

_realver=0.6.5.9
_mypkgrel=0

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

pkgname=$_name
pkgver=$_kver
pkgrel=$(($_kpkgrel + $_mypkgrel))
pkgdesc="ZFS for Linux"
url="http://zfsonlinux.org"
arch="x86 x86_64 aarch64 s390x"
license="CDDL"
depends="spl-$_flavor linux-${_flavor}=${_kernelver}"
depends_dev="glib-dev e2fsprogs-dev util-linux-dev libtirpc-dev
	linux-$_flavor-dev=$_kernelver spl-$_flavor-dev"
makedepends="$depends_dev automake autoconf libtool linux-headers"
install_if="zfs linux-vanilla-$_kver"
install=""
subpackages="$pkgname-dev"
source="https://github.com/zfsonlinux/zfs/releases/download/zfs-$_realver/zfs-$_realver.tar.gz
        0001-Use-the-correct-macro-to-include-backtrace.patch
        0002-Include-sys-types.h-in-devid.h.patch
        0003-Add-missing-fcntl.h-to-includes-in-mount_zfs.c.patch
        0004-Ensure-correct-return-value-type.patch
        0005-Set-_DATE_FMT-to-if-not-defined-in-libspl-timestamp..patch
        0006-Move-hrtime_t-timestruc_t-and-timespec_t.patch
        0007-Remove-complicated-libspl-assert-wrappers.patch
        0008-Add-support-for-libtirpc.patch
        0009-Add-support-for-alpine-linux.patch
	"


builddir="$srcdir/$_realname-$_realver"

prepare() {
	# source the kernel version
	(
	if [ -f "$startdir"/../../main/linux-$_flavor/APKBUILD ]; then
	        . "$startdir"/../../main/linux-$_flavor/APKBUILD
	        if [ "$_kver" != "$pkgver" ]; then
			die "$_name: Please update _kver to $pkgver"
		fi
	        if [ "$_kpkgrel" != "$pkgrel" ]; then
			die "$_name: Please update _kpkgrel to $pkgrel"
		fi
	fi
	) || return 1

	default_prepare
	autoreconf -vif || return 1
}

build() {
	cd "$builddir"
	export LIBS="$LIBS -lintl"
	EXTRA_KCFLAGS="-Wno-error=unused-but-set-variable" \
	./configure --prefix=/usr \
		--with-tirpc \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--with-config=kernel \
		--with-linux=/usr/src/linux-headers-${_abi_release} \
		--with-spl=/usr/src/spl-${_realver} \
		|| return 1
	make || return 1
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" \
		install || return 1
}

dev() {
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/src "$subpkgdir"/usr || return 1
        default_dev
}

sha512sums="6e175f32421cf0f9e13429f12f0fac0564dc7059ab076831d0ebc4f6a17412160ca3526ebdf894bc7666e82580355b08701dd01c411d3177f82e7330b4529a37  zfs-0.6.5.9.tar.gz
1e9f3c753b5bbe50ea6c953fec4200ae3a2de63abaa0dbcc2fb558a92716c27545ef773b3d0dc7bb1248622073a0db4c194d008bc83af7de7f90111169ffe31a  0001-Use-the-correct-macro-to-include-backtrace.patch
244f143c3cca0102ee98aed122b70d9e255a68645d90f927d67fe19e89c4678839b91fbb560c4e55306510e8aec4762c4afc671317df153940f17e905c17b928  0002-Include-sys-types.h-in-devid.h.patch
413cf13db3d390714fcd20c4150d3b0dbddcff031572117fcd4f015d929fde642381ab98f0b796dc4001472b2ee13dbf69261f4b83e990c2b0a080223667193c  0003-Add-missing-fcntl.h-to-includes-in-mount_zfs.c.patch
c26793c4ada197584d5829a6d31fd826333416a73ac1fa1d8f84277ba99312db72608d6d13171131cdf61b20e1c6c1ada51027361d48cc7b2863fd5b23df8083  0004-Ensure-correct-return-value-type.patch
fbd44839a422925a54710e8425405d24ca2428b78aa54b9a77492e5882a3e21aa4a5e53656466c5af79460fde75ac6aeb6f1f3fe85a1f26333d5acd36c6c9013  0005-Set-_DATE_FMT-to-if-not-defined-in-libspl-timestamp..patch
e20fb3004af9e6454513d7df09292465e5bc4101a558538cf794ef41b56a30713e1868dcda251e6b3ed10c5f0178e86068bcb113bd8228eedb626cb73bb19ecd  0006-Move-hrtime_t-timestruc_t-and-timespec_t.patch
9843aca713021772435cfa68fde5d9aa2de0387de0da6c48045db0348f2a24d2c2e968d3eb1921923170c9e2fd6514e31c5f0a7bacbf8510b53c2c625c4737d1  0007-Remove-complicated-libspl-assert-wrappers.patch
fa752b3ed04f05ec4fac257cbd2c581a57a792e12165d8f135a77b894445cdefb0da1753922e3e59c9fbaed20ca1dc6d19b5436745c8fa588a42304f6561f1a2  0008-Add-support-for-libtirpc.patch
d2efb627f493bab06f8049dc4bcb7c39269ff9dcd66879a0f96fa5040e1c7468f9e684277ec3e54841b3a5f8734d9470f2c6a1af470e3f1a71f759f9155b7ede  0009-Add-support-for-alpine-linux.patch"