summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 452442b4a16f9455aa3eaaca6ef0e1e670744c2b (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
104
105
106
# Maintainer: Yurii Kolesnykov <root@yurikoles.com>
# Contributor: Jonathon Fernyhough <jonathon"m2x+dev>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>
# Contributor: Iacopo Isimbaldi <isiachi@rhye.it>
#
# Based on aur/zfs-utils by Kevin Stolp <kevinstolp@gmail.com>
# Based on archzfs/zfs-utils-git by Jan Houben <jan@nexttrex.de>
#
# Pull requests are welcome here: https://github.com/yurikoles-aur/zfs-utils-git
#

pkgname=zfs-utils-git
pkgver=2.4.99.r2.gb6bd3228bb
pkgrel=1
epoch=2
pkgdesc='Userspace utilities for the Zettabyte File System.'
arch=('i686' 'x86_64' 'aarch64')
url='https://zfsonlinux.org/'
license=('LicenseRef-CDDL')
groups=('zfs-git')
makedepends=(
    'git'
    'python'
    'python-cffi'
    'python-setuptools'
)
optdepends=(
    'pam: managing encryption keys'
    'python: pyzfs and extra utilities'
    'python-cffi: pyzfs'
)
provides=("zfs-utils=${pkgver}")
conflicts=('zfs-utils')
backup=(
    'etc/default/zfs'
    'etc/zfs/zed.d/zed.rc'
)
source=(
    "git+https://github.com/openzfs/zfs.git"
    'zfs.initcpio.install'
    'zfs.initcpio.hook'
    'zfs.initcpio.zfsencryptssh.install'
)
sha256sums=('SKIP'
            '2f09c742287f4738c7c09a9669f8055cd63d3b9474cd1f6d9447152d11a1b913'
            '15b5acea44225b4364ec6472a08d3d48666d241fe84c142e1171cd3b78a5584f'
            'ac9ed396465e26fa6896762c52a93eb7aaf8af6d7b2c69bd826d219ff821b2c9')
b2sums=('SKIP'
        'cb774227f157573f960bdb345e5b014c043a573c987d37a1db027b852d77a5eda1ee699612e1d8f4a2770897624889f1a3808116a171cc4c796a95e3caa43012'
        '779c864611249c3f21d1864508d60cfe5e0f5541d74fb3093c6bdfa56be2c76f386ac1690d363beaee491c5132f5f6dbc01553aa408cda579ebca74b0e0fd1d0'
        'fcd871d72c62a7c99d6cf29cb40a4751bfc08238ff39e8c9440d119754e92ded4705414710db86e99d044011f3524e54c778bda94696dde2c06b3289da6628d0')

pkgver() {
    git -C zfs describe --long | sed 's/^zfs-//;s/-rc/rc/;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    cd zfs

    ./autogen.sh
}

build() {
    cd zfs

    ./configure --prefix=/usr \
                --sysconfdir=/etc \
                --sbindir=/usr/bin \
                --with-mounthelperdir=/usr/bin \
                --libdir=/usr/lib \
                --datadir=/usr/share \
                --includedir=/usr/include \
                --with-udevdir=/usr/lib/udev \
                --libexecdir=/usr/lib \
                --localstatedir=/var \
                --enable-pyzfz \
                --enable-systemd \
                --with-zfsexecdir=/usr/lib/zfs \
                --with-config=user
    make
}

package() {
    cd zfs

    make DESTDIR="${pkgdir}" install
    install -Dm644 contrib/bash_completion.d/zfs "${pkgdir}"/usr/share/bash-completion/completions/zfs

    # Remove uneeded files
    rm -r "${pkgdir}"/etc/init.d
    rm -r "${pkgdir}"/usr/lib/modules-load.d
    rm -r "${pkgdir}"/usr/share/initramfs-tools
    rm -r "${pkgdir}"/usr/share/zfs/*.sh
    rm -r "${pkgdir}"/usr/share/zfs/{runfiles,test-runner,zfs-tests}
    # fix permissions
    chmod 750 ${pkgdir}/etc/sudoers.d
    chmod 440 ${pkgdir}/etc/sudoers.d/zfs

    # Install the support files
    install -Dm644 "${srcdir}"/zfs.initcpio.hook "${pkgdir}"/usr/lib/initcpio/hooks/zfs
    install -Dm644 "${srcdir}"/zfs.initcpio.install "${pkgdir}"/usr/lib/initcpio/install/zfs
    install -Dm644 "${srcdir}"/zfs.initcpio.zfsencryptssh.install "${pkgdir}"/usr/lib/initcpio/install/zfsencryptssh

    # Install the license
    install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}