#Packager: Andreas Born <futur(dot)andy(at)web(dot)de>

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

doinst() {
        # update the mime desktop database
        if [ -x usr/bin/update-desktop-database ]; then
                usr/bin/update-desktop-database -q
        fi
        # update the mime database
        if [ -x usr/bin/update-mime-database ]; then
                usr/bin/update-mime-database usr/share/mime > /dev/null 2>&1
        fi
}


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-beta

	./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

	install -vd $startdir/pkg/usr/share/icons/hicolor/48x48/apps
	convert $startdir/pkg/usr/share/pixmaps/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
}
