# vim: set syn=sh:
# Packager: George Vlahavas <vlahavas~at~gmail~dot~com>
# Previous packager: Phill Watkins <ubemail~at~ymail~dot~com>

pkgname=hfsprogs
pkgver=332.25.10
pkgrel=1rl
#arch=noarch
source=\
(
"http://www.opensource.apple.com/tarballs/diskdev_cmds/diskdev_cmds-332.25.tar.gz"
"http://ftp.de.debian.org/debian/pool/main/h/hfsprogs/hfsprogs_332.25-10.debian.tar.gz"
)
sourcetemplate=http://people.salixos.org/pwatk/packages/13.2/a/$pkgname
docs=("changelog" "copyright" "README.Debian")
url=http://packages.debian.org/search?keywords=hfsprogs

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"hfsprogs (HFS+ filesystem utilities)"
"The HFS+ file system used by Apple Computer for their Mac OS is"
"supported by the Linux kernel. Apple provides mkfs and fsck for HFS+"
"with the Unix core of their operating system, Darwin."
""
"This package is a port of Apple's tools for HFS+ filesystems."
)

build() {
	set -e

	cd $startdir/src/diskdev_cmds-*/
	for patch in $(cat $startdir/src/debian/patches/series) ;do
	  patch -p1 --verbose < $startdir/src/debian/patches/$patch
	done
	make -j $numjobs -f Makefile.lnx
	install -Dm 0644 newfs_hfs.tproj/hfsbootdata.img $startdir/pkg/usr/share/hfsprogs/hfsbootdata
	install -Dm 0755 newfs_hfs.tproj/newfs_hfs $startdir/pkg/sbin/mkfs.hfsplus
	install -Dm 0755 fsck_hfs.tproj/fsck_hfs $startdir/pkg/sbin/fsck.hfsplus
	install -Dm 0644 newfs_hfs.tproj/newfs_hfs.8 $startdir/pkg/usr/man/man8/mkfs.hfsplus.8
	install -Dm 0644 fsck_hfs.tproj/fsck_hfs.8 $startdir/pkg/usr/man/man8/fsck.hfsplus.8
	( cd $startdir/pkg/sbin
	  ln -sf mkfs.hfsplus mkfs.hfs
	  ln -sf fsck.hfsplus fsck.hfs
	)
	( cd $startdir/pkg/usr/man/man8
	  ln -sf mkfs.hfsplus.8 mkfs.hfs.8
	  ln -sf fsck.hfsplus.8 fsck.hfs.8
	)

	set +e
}