#Maintainer: Thorsten Muehlfelder <thenktor@gmx.de>

pkgname=easytag
pkgver=2.1.6
pkgrel=1tm
arch=i486
source=("http://downloads.sourceforge.net/easytag/easytag-$pkgver.tar.bz2")
sourcetemplate=http://thenktor.dyndns.org/packages/$pkgname/
url="http://easytag.sourceforge.net/"
docs=(ABOUT-NLS COPYING ChangeLog TODO README THANKS)

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"$pkgname (tag editor for mp3, aac, ogg vorbis, flac, mpc, ape...)"
"EasyTAG is a utility for viewing and editing tags for"
"MP3, MP2, FLAC, Ogg Vorbis, MusePack (.mpc), MP4/aac, ogg/speex"
"and Monkey's Audio files (.ape)."
""
"It's simple and nice GTK+ 2 interface makes tagging easy."
)

build() {
	cd $startdir/src/${pkgname}-${pkgver}
	./configure --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} --localstatedir=/var --sysconfdir=/etc --disable-static
	make -j3 || return 1
	make DESTDIR=$startdir/pkg/ install || return 1

	# fix desktop menu
	sed -i "s:MimeType=:MimeType=audio/flac;audio/mp4;audio/musepack;audio/ogg;audio/vorbis;:g" $startdir/pkg/usr/share/applications/$pkgname.desktop
	sed -i "s/EasyTAG_icon/easytag/g" $startdir/pkg/usr/share/applications/$pkgname.desktop

	# make icons from xpm logo
	for size in 16x16 24x24 32x32 48x48; do
		mkdir -p $startdir/pkg/usr/share/icons/hicolor/${size}/apps
		convert -resize $size -depth 8 pixmaps/EasyTAG_icon.xpm \
			$startdir/pkg/usr/share/icons/hicolor/${size}/apps/easytag.png
	done

	# don't needed any more and misplaced
	rm -fr $startdir/pkg/usr/share/pixmaps/ $startdir/pkg/usr/share/$pkgname/ChangeLog
}