void-packages/srcpkgs/zfs/template
Andrew J. Hesford 07d71233a0 zfs: trigger dracut on install and remove patch artifacts
dracut should be triggered to work around ordering issues in
https://github.com/void-linux/void-packages/issues/22817 that can
otherwise result in missing ZFS modules in initramfs images.
2020-06-17 17:23:16 -04:00

72 lines
2.4 KiB
Bash

# Template file for 'zfs'
pkgname=zfs
version=0.8.4
revision=3
build_style=gnu-configure
configure_args="--with-config=user --with-mounthelperdir=/usr/bin
--with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d
--with-dracutdir=/usr/lib/dracut --with-tirpc"
hostmakedepends="dracut libtool pkg-config python3 automake"
makedepends="zlib-devel libuuid-devel libblkid-devel libtirpc-devel attr-devel"
conf_files="/etc/zfs/zed.d/zed.rc"
short_desc="Z File System -- userland, pyzfs, and kernel modules (using DKMS)"
maintainer="Toyam Cox <Vaelatern@voidlinux.org>"
license="CDDL-1.0"
homepage="https://zfsonlinux.org/"
distfiles="https://github.com/zfsonlinux/zfs/releases/download/zfs-${version}/zfs-${version}.tar.gz"
checksum=2b988f5777976f09d08083f6bebf6e67219c4c4c183c1f33033fb7e5e5eacafb
replaces="spl<=0.7.13_1" # Because SPL was merged into zfs in 0.8.0
dkms_modules="zfs ${version}"
depends="dkms>=2.2.0.3_9 perl python3 bash"
pre_configure() {
export CFLAGS+=" -I${XBPS_CROSS_BASE}/usr/include/tirpc/"
autoreconf -fi
# configure relies on bashism to redirect stdout/stderr when building tests
sed -i '1 s@^#!\s*/bin/sh$@#!/bin/bash@' configure
# Prevent patch artifacts from being installed
rm -f dkms.patch scripts/dkms.mkconf.orig
tar czf ../clean.tar.gz .
}
post_install() {
vlicense COPYRIGHT
vlicense LICENSE
vlicense NOTICE
vmkdir usr/src/${pkgname}-${version}
tar xf ../clean.tar.gz -C ${DESTDIR}/usr/src/${pkgname}-${version}
scripts/dkms.mkconf -v ${version} -f ${DESTDIR}/usr/src/${pkgname}-${version}/dkms.conf -n zfs
sed -i -e 's/test "${PYTHON_VERSION:0:2}" = "3."/test "${PYTHON_VERSION##3.*}" = ""/' \
-e 's/test "${PYTHON_VERSION:0:2}" = "2."/test "${PYTHON_VERSION##2.*}" = ""/' \
${DESTDIR}/usr/src/${pkgname}-${version}/configure # This is necessary because of https://github.com/zfsonlinux/zfs/issues/8827
rm -rf ${DESTDIR}/usr/lib/systemd
rm -rf ${DESTDIR}/usr/share/initramfs-tools
# Contains ELF binaries. Remove it until upstream has a way to move this
# into /usr/libexec or similiar.
rm -rf ${DESTDIR}/usr/share/zfs/zfs-tests
}
zfs-devel_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc="Z File System -- development files"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
vmove usr/share/pkgconfig
}
}
do_clean() {
rm -f ../clean.tar.gz
}
# REMARKS:
# Did not split out pyzfs, because it's distributed with zfs, and no reason to
# send separately.