#Packager: Vasile Coman <kerd[at]slackware[dot]eu>
#Former Packager: Markus Muttilainen <stillbornDOTzenwalkATgmailDOTcom>

pkgname=emesene
pkgver=1.6.3
pkgrel=1vc
source=("http://downloads.sourceforge.net/project/emesene/$pkgname-$pkgver/$pkgname-$pkgver.tar.gz" "http://people.salixos.org/kerd/emesene/$pkgver/emesene.png" "http://people.salixos.org/kerd/emesene/$pkgver/emesene.desktop")
sourcetemplate=http://people.salixos.org/kerd/$pkgname/$pkgver/
docs=("COPYING" "GPL" "LGPL" "PSF" "README")
url="http://emesene.org/"

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"emesene (Windows Live Messenger (tm) network multiplatform client)"
"The main idea is to make a client similar to the official MSN"
"Messenger client but keeping it simple and with a nice GUI." 
"Emesene is a python/gtk MSN messenger clone, it uses emesenelib"
"(MSNP13) and try to be a nice looking and simple MSN client."
"http://emesene.org/"
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	python setup.py build_ext -i
    	mkdir -p $startdir/pkg
    	mkdir -p $startdir/pkg/usr/bin
    	mkdir -p $startdir/pkg/usr/share/applications
    	mkdir -p $startdir/pkg/usr/share/icons/hicolor/48x48/apps
    	mkdir -p $startdir/pkg/usr/doc
    	mkdir -p $startdir/pkg/usr/doc/$pkgname
    	mkdir -p $startdir/pkg/usr/share/$pkgname/conversation_themes
        mkdir -p $startdir/pkg/usr/src/$pkgname-$pkgver
        mkdir -p $startdir/pkg/usr/share/$pkgname/libmimic
#
    	cp -av conversation_themes $startdir/pkg/usr/share/$pkgname/
	cp -av emesenelib $startdir/pkg/usr/share/$pkgname/
	cp -av plugins_base $startdir/pkg/usr/share/$pkgname/
	cp -av po $startdir/pkg/usr/share/$pkgname/
	cp -av smilies $startdir/pkg/usr/share/$pkgname/
	cp -av sound_themes $startdir/pkg/usr/share/$pkgname/
	cp -av themes $startdir/pkg/usr/share/$pkgname/
	cp -av abstract $startdir/pkg/usr/share/$pkgname/
	cp -av ./build/temp.linux-i686-2.6/libmimic $startdir/pkg/usr/share/$pkgname/
	cp -v *.so *.py emesene $startdir/pkg/usr/share/$pkgname/
	cp -v $startdir/src/emesene.desktop $startdir/pkg/usr/share/applications/ || exit 1
#
	rm -rf $startdir/pkg/usr/share/doc/emesene
	rm -rf $startdir/pkg/usr/doc/emesene
#
	cp emesene-logo.png $pkgname.png
	cp -v $startdir/src/$pkgname.png $startdir/pkg/usr/share/icons/hicolor/48x48/apps/ || exit 1
#
cat << EOF > $startdir/pkg/usr/bin/emesene
#!/bin/sh
exec /usr/share/emesene/emesene
EOF
	chmod 755 $startdir/pkg/usr/bin/emesene
}