#Packager: Tim Beech <tim~dot~beech~AT~gmail~dot~com>
#Former Packager(s): Name <email@address.com>
#Anything commented out is optional and can be deleted.

pkgname=anki
pkgver=2.0.28
pkgrel=1tjb
#arch=noarch
source=("http://ankisrs.net/download/mirror/anki-$pkgver.tgz" "anki-32.png" "anki-48.png" "anki-64.png" "anki-96.png")
sourcetemplate=http://people.salixos.org/mimosa/packages/$pkgname/$pkgver/
docs=("readme" "install" "copying" "changelog" "license" "authors" "news" "todo")
url=http://ankisrs.net
#dotnew=()
#CFLAGS=
#CXXFLAGS=
#options=('noextract')

doinst() {
update-mime-database /usr/share/mime/
update-desktop-database
}

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"anki (friendly,intelligent flashcards)"
"Anyone who needs to remember things in their daily life can benefit"
"from Anki. It is content-agnostic and supports images, audio,"
"videos and scientific markup (via LaTeX). For audio recording support"
"PyAudio and lame are required. "
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	mkdir -p $startdir/pkg/usr/{bin,share/{anki,mime/packages,applications,man/man1}}
	mkdir -p $startdir/pkg/usr/share/icons/hicolor/{32x32,48x48,64x64,96x96}/apps
	cp -av * $startdir/pkg/usr/share/anki/
	cd $startdir/pkg/usr/share/anki && (
	mv runanki ../../bin/anki
	for size in "32" "48" "64" "96"
	do
		cp $startdir/src/anki-$size.png $startdir/pkg/usr/share/icons/hicolor/${size}x${size}/apps/anki.png
	done
#	mv anki.xpm anki.png ../pixmaps/
	mv anki.desktop ../applications/
	mv anki.1 ../man/man1/
	)
	rm -rf $startdir/pkg/usr/share/anki/{tests,thirdparty/[!s]*,tools,anki.bat}
	cp $startdir/src/$pkgname-$pkgver/anki.xml $startdir/pkg/usr/share/mime/packages
}