### this file is sourced not run
PKGVER=0.6
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=alsaequal-0.6.tar.bz2
MD5SUM=d2edc7710c72cbf3ab297c414e35ebda
SRC_URL=http://www.thedigitalmachine.net/tools/$TARBALL
BUNDLE=

SLACKREQ='alsa-lib libcaps-ladspa'
SLACKDESC='alsa-equal: alsa-equal 0.6 (Equaliser for ALSA)  
alsa-equal:  
alsa-equal: Alsaequal is a real-time adjustable equalizer plugin for ALSA. It 
alsa-equal: can be adjusted using an ALSA compatible mixer, like alsamixergui 
alsa-equal: or alsamixer.  
alsa-equal: 
alsa-equal: 
alsa-equal: 
alsa-equal: 
alsa-equal: 
alsa-equal:
'

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cp $CHROOT_DIR/tmp/pkg/ladspa.h usr/include &&
	cd tmp/alsa* &&
	
	# debian patches required to work with caps 0.9.x
	tar -xf $CHROOT_DIR/tmp/pkg/alsaequal_0.6-6.debian.tar.gz &&
	for p in $(cat debian/patches/series); do
		patch -Np1 -i debian/patches/$p;
	done
}

### default pkg_package
### build
pkg_build() {
	cd /tmp/alsa*
	sed -i -e 's|/lib/|/lib64/|' ctl_equal.c Makefile pcm_equal.c Makefile~ &&
	make LIBDIR=lib64 && make install LIBDIR=lib64  &&
	mkdir -p /usr/share/doc/alsaequal-0.6 &&
	cp README COPYING /usr/share/doc/alsaequal-0.6 &&
	rm -f /usr/include/ladspa.h &&
	pkg_build_slackdesc
}
