#Maintainer: Thorsten Muehlfelder <thenktor(at)gmx.de>

pkgname=audacity
pkgver=1.3.10
pkgrel=1ab
arch=i486
source=("http://audacity.googlecode.com/files/audacity-minsrc-$pkgver.tar.bz2" "http://manual.audacityteam.org/help.zip")
sourcetemplate="http://gaia.homelinux.org/salix/packages/$pkgname/$pkgver/"
docs=("readme.txt" "license.txt")
url='http://www.audacity.de'

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"$pkgname (cross-platform sound editor)"
"Audacity is a free, easy-to-use audio editor and recorder, which can"
"be used to:"
"    * Record live audio."
"    * Convert tapes and records into digital recordings or CDs."
"    * Edit Ogg Vorbis, MP3, WAV or AIFF sound files."
"    * Cut, copy, splice or mix sounds together."
"    * Change the speed or pitch of a recording."
"    * And more! See the complete list of features"
"      (http://audacity.sourceforge.net/about/features)"
)


build() {
	cd $startdir/src/audacity-src-$pkgver

	./configure \
		--prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--mandir=/usr/man \
		--enable-unicode \
		--enable-nyquist \
		--enable-ladspa \
		--with-libsamplerate \
		--with-libvorbis \
		--with-libmad \
		--with-libflac \
		--with-libid3tag \
		--with-soundtouch \
		--with-libtwolame \
		--with-ffmpeg \
		--with-midi \
		--with-taglib \
		--with-sbsms \
		--with-libvamp \
		--with-portaudio || return 1
	echo -e "\nHit Enter to continue"
	read JUNK
	make -j3 || return 1
	make install DESTDIR=$startdir/pkg || return 1

	rm -r $startdir/pkg/usr/share/doc

	convert $startdir/pkg/usr/share/audacity/audacity.xpm -transparent white $startdir/pkg/usr/share/icons/hicolor/48x48/apps/audacity.png
	rm $startdir/pkg/usr/share/audacity/audacity.xpm

	sed -i "s/Icon=\/usr\/share\/audacity\/audacity.xpm/Icon=audacity/" $startdir/pkg/usr/share/applications/audacity.desktop

	install -vd $startdir/pkg/usr/share/audacity/help/
	mv ../manual $startdir/pkg/usr/share/audacity/help/manual
}