void-packages/srcpkgs/hfsprogs/template
Đoàn Trần Công Danh 200bed5c06 srcpkgs/h*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

53 lines
1.7 KiB
Bash

# Template file for 'hfsprogs'
pkgname=hfsprogs
_distver=540.1
_patchver=3
_md5sum=0435afc389b919027b69616ad1b05709
version="${_distver}.linux${_patchver}"
revision=8
wrksrc="diskdev_cmds-${version}"
hostmakedepends="clang"
makedepends="openssl-devel libuuid-devel"
short_desc="Apple's mkfs and fsck for HFS and HFS+ file systems"
maintainer="Orphaned <orphan@voidlinux.org>"
license="APSL-2.0"
homepage="https://www.opensource.apple.com/"
distfiles="https://src.fedoraproject.org/repo/pkgs/hfsplus-tools/diskdev_cmds-${version}.tar.gz/${_md5sum}/diskdev_cmds-${version}.tar.gz"
checksum=b01b203a97f9a3bf36a027c13ddfc59292730552e62722d690d33bd5c24f5497
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
makedepends+=" musl-legacy-compat"
fi
pre_build() {
sed -i 's/[F|f]sck_hfs/fsck.hfsplus/g' fsck_hfs.tproj/fsck_hfs.8
sed -i 's/[N|n]ewfs_hfs/mkfs.hfsplus/g' newfs_hfs.tproj/newfs_hfs.8
if [ "$CROSS_BUILD" ]; then
sed -i "s|CFLAGS :=|CFLAGS := --target=${XBPS_CROSS_TRIPLET} --sysroot=${XBPS_CROSS_BASE}|" Makefile
sed -i "s|LDFLAGS :=|LDFLAGS := -L${XBPS_CROSS_BASE}/usr/lib|" Makefile
fi
# Remove errant execute bits.
find . -type f -name '*.[ch]' -exec chmod -c -x {} +
}
do_build() {
make ${makejobs}
}
do_check() {
./fsck_hfs.tproj/fsck_hfs 2>&1 | grep 'usage: fsck_hfs'
./newfs_hfs.tproj/newfs_hfs 2>&1 | grep 'usage: newfs_hfs'
}
do_install() {
vbin fsck_hfs.tproj/fsck_hfs fsck.hfs
vbin newfs_hfs.tproj/newfs_hfs mkfs.hfsplus
ln -s fsck.hfs "${DESTDIR}"/usr/bin/fsck.hfsplus
vman fsck_hfs.tproj/fsck_hfs.8 fsck.hfs.8
vman newfs_hfs.tproj/newfs_hfs.8 mkfs.hfsplus.8
ln -s fsck.hfs.8 "${DESTDIR}"/usr/share/man/man8/fsck.hfsplus.8
vlicense "${FILESDIR}"/APSL-2.0
}