# SliTaz package receipt.

PACKED_SIZE="132.0K"
UNPACKED_SIZE="556.0K"
PACKAGE="alsaplayer"
VERSION="0.99.81"
CATEGORY="multimedia"
SHORT_DESC="Alsa GTK+ PCM audio player."
MAINTAINER="pankso@slitaz.org"
LICENSE="GPL3"
WEB_SITE="https://alsaplayer.sourceforge.net/"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
TAGS="music audio player mp3 ogg flac"
HOST_ARCH="i486 arm"

SUGGESTED="alsaplayer-scopes libid3tag flac"
DEPENDS="gtk+ alsa-lib libmad libogg libvorbis xorg-libXdamage"
BUILD_DEPENDS="gtk+-dev alsa-lib-dev libmad-dev libogg-dev libvorbis-dev"

# Handle cross compilation.
case "$ARCH" in
	i?86) BUILD_DEPENDS="$BUILD_DEPENDS flac-dev" ;;
esac

# What is the latest version available today?
current_version()
{
	wget -O - $WEB_SITE 2>/dev/null | \
	sed '/Released/!d;s|.*: ||;s|<.*||'
}

# Rules to configure and make the package.
compile_rules()
{
	i="$src/interface/gtk2/pixmaps"
	cp -f	$i/note.xpm	$i/logo.xpm
	sed -i	's/note/logo/'	$i/logo.xpm

	./configure \
		--enable-gtk2 \
		--enable-flac \
		--disable-jack \
		--disable-esd \
		$CONFIGURE_ARGS &&
	make &&
	# Chmod install-sh to avoid install error.
	chmod 755 install-sh &&
	make DESTDIR=$DESTDIR install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/lib

	cp -a $install/usr/bin $fs/usr
	cp -a $install/usr/lib/*.so* $fs/usr/lib
	cp -a $install/usr/lib/alsaplayer $fs/usr/lib

	# Remove devel files and scopes.
	rm $fs/usr/lib/alsaplayer/*/*.*a
	rm -rf $fs/usr/lib/alsaplayer/scopes2
}
