summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: 82ce1380f47c6216cca17c0288e5d23e6b260c22 (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
#
# Maintainer: isiachi <isiachi@rhyeworld.it>
#

pkgbase="zfs-dkms"
pkgname=("zfs-dkms" "zfs-utils")
pkgver=0.6.5.2
pkgrel=1
license=('CDDL')
makedepends=("git")
arch=("i686" "x86_64")
url="http://zfsonlinux.org/"
source=("git+https://github.com/zfsonlinux/zfs.git"
        "zfs-utils.bash-completion-r1"
        "zfs-utils.initcpio.install"
        "zfs-utils.initcpio.hook")
md5sums=('SKIP'
         '9ddb0c8a94861f929d0fa741fdc49950'
         '9ef4841abb85dee611828cc7e6f5c6fe'
         '62ba32c6853c315ff231c396cf8bfdbb')
#install=zfs.install

_dirver="${pkgver}"
_gittag="zfs-${pkgver}"

prepare() {
    cd "${srcdir}/zfs"
    
    git checkout ${_gittag}
}

build() {
    cd "${srcdir}/zfs"
    ./autogen.sh
    scripts/dkms.mkconf -v ${_dirver} -f dkms.conf -n zfs
    
    ./configure --prefix=/usr \
                --sysconfdir=/etc \
		--bindir=/usr/bin \
                --sbindir=/usr/bin \
                --libdir=/usr/lib \
                --datadir=/usr/share \
                --includedir=/usr/include \
                --with-udevdir=/lib/udev \
                --libexecdir=/usr/lib/zfs \
                --with-config=user
    make
}

package_zfs-dkms() {
    pkgdesc="Kernel modules for the Zettabyte File System."
    depends=("spl-dkms=${pkgver}-${pkgrel}" "zfs-utils=${pkgver}-${pkgrel}" "dkms")
    provides=("zfs")
    conflicts=("zfs-git" "zfs-lts")
    replaces=("zfs-dkms-git")
    install=zfs.install
    
    install -d ${pkgdir}/usr/src
    cp -a ${srcdir}/zfs ${pkgdir}/usr/src/zfs-${_dirver}
    rm -rf ${pkgdir}/usr/src/zfs-${_dirver}/.git
    rm -f ${pkgdir}/usr/src/zfs-${_dirver}/.gitignore
}

package_zfs-utils() {
    pkgdesc="Kernel module support files for the Zettabyte File System."
    depends=("spl-dkms=${pkgver}-${pkgrel}")
    conflicts=("zfs-utils-git" "zfs-utils-lts")
    replaces=("zfs-utils-dkms-git")

    cd "${srcdir}/zfs"
    make DESTDIR="${pkgdir}" install

    # Remove uneeded files
    rm -r "${pkgdir}"/etc/init.d
    rm -r "${pkgdir}"/usr/lib/dracut

    # move module tree /lib -> /usr/lib
    cp -r "${pkgdir}"/{lib,usr}
    rm -r "${pkgdir}"/lib
    mv "${pkgdir}"/sbin/* "${pkgdir}"/usr/bin
    rm -r "${pkgdir}"/sbin

    install -D -m644 "${srcdir}"/zfs-utils.initcpio.hook "${pkgdir}"/usr/lib/initcpio/hooks/zfs
    install -D -m644 "${srcdir}"/zfs-utils.initcpio.install "${pkgdir}"/usr/lib/initcpio/install/zfs
    install -D -m644 "${srcdir}"/zfs-utils.bash-completion-r1 "${pkgdir}"/usr/share/bash-completion/completions/zfs
}