# SliTaz package receipt.

PACKED_SIZE="44.0K"
UNPACKED_SIZE="128.0K"
PACKAGE="module-hfsplus"
VERSION="2.6.20"
CATEGORY="base-system"
GROUP="filesystem"
SHORT_DESC="Kernel module for the hfsplus (MacOS) filesystem"
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="GPL2"
WEB_SITE="http://tiny.slitaz.org/"
WANTED="linux"
CONFIG_FILES="/etc/filesystems"

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	local path
	export src=$WOK/$WANTED/source/linux-$VERSION
	export _pkg=$WOK/$WANTED/install
	path=lib/modules/$(ls $_pkg/lib/modules)/kernel
	mkdir -p $fs/$path $fs/etc
	$src/slitaz/list_modules.sh fs/${PACKAGE#*-} | while read module; do
		dir=$path/$(dirname $module)
		[ -d $fs/$dir ] || mkdir -p $fs/$dir
		cp -a $_pkg/$path/$module $fs/$dir
	done
	touch $fs/etc/filesystems
}

# Post install/remove commands for Tazpkg.
post_install()
{
	for i in nls_base hfsplus ; do
		grep -qs ^$i$ $1/modules || echo $i >> $1/modules
	done
	grep -qs ^${PACKAGE#*-}$ $1/etc/filesystems || \
		echo "${PACKAGE#*-}" >> $1/etc/filesystems
}