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

# source: james
TARBALL=fontmatrix-0.6.0-Source.tar.gz
MD5SUM=6a00c9448a50d3bab5acb4145f778f2d
SRC_URL=http://fontmatrix.be/archives/$TARBALL
BUNDLE=

SLACKREQ='qt4' # 
SLACKDESC='fontmatrix: fontmatrix 0.6.0 (Font explorer)  
fontmatrix:  
fontmatrix: Fontmatrix is a free/libre font explorer for Linux, Windows and 
fontmatrix: Mac. It’s for you. Enjoy it and, if you like it, get involved.  
fontmatrix: 
fontmatrix: 
fontmatrix: 
fontmatrix: 
fontmatrix: 
fontmatrix: 
fontmatrix: http://fontmatrix.be
'

### default pkg_download
### default pkg_prepare
### package
pkg_package() {
	# add missing en sample
	mkdir -p usr/share/fontmatrix/resources/Samples/en
	rm usr/share/fontmatrix/resources/Samples/ru/*
	cp $CHROOT_DIR/tmp/pkg/fontmatrix-en-sample usr/share/fontmatrix/resources/Samples/en/sample
	cp $CHROOT_DIR/tmp/pkg/fontmatrix-ru-sample usr/share/fontmatrix/resources/Samples/ru/sample
}

### build
pkg_build() {
	export PATH="$PATH:/opt/qt4/bin"
	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/qt4/lib64"
	export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/qt4/lib64/pkgconfig"
	export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/opt/qt4/include"
	export QT4_PATH="/opt/qt4/bin"
	export QT4_LD_LIBRARY_PATH="/opt/qt4/lib64"
	export QT4_PKG_CONFIG_PATH="/opt/qt4/lib64/pkgconfig"
	export QT4_CPLUS_INCLUDE_PATH="/opt/qt4/include" 

	cd /tmp/fontmatrix*
	pkg_build_cmake &&
	pkg_build_slackdesc	&&
	
	# overwrite C sample
	cp ../src/fontitem.cpp /usr/share/fontmatrix/resources/Samples/udm/sample
}
