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

pkgname=audacity
pkgver=1.3.13
pkgrel=1ab
source=("http://audacity.googlecode.com/files/audacity-minsrc-1.3.13-beta.tar.bz2"
		"http://manual.audacityteam.org/help.zip")
sourcetemplate="http://gaia.homelinux.org/salix/slkbuilds/$pkgname/"
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() {
	set -e

	cd $startdir/src/audacity-src-$pkgver-beta

	./configure \
		--prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--mandir=/usr/man \
		--docdir=/usr/doc/$pkgname-$pkgver/ \
		--enable-unicode \
		--enable-nyquist \
		--enable-ladspa \
		--with-libsndfile=system \
		--with-expat=system \
		--without-libsamplerate \
		--with-libresample \
		--with-libvorbis=system \
		--with-libmad=system \
		--with-libflac=system \
		--with-libid3tag=system \
		--with-sbsms \
		--with-soundtouch \
		--with-libvamp \
		--with-libtwolame=system \
		--with-ffmpeg=system \
		--with-midi \
		--with-portaudio \
		--with-portmixer \
		--build=$arch-slackware-linux || return 1
	make -j $numjobs || 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

	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

	set +e
}