#Maintainer: George Vlahavas (vlahavas~at~gmail~dot~com)

pkgname=e16
pkgver=1.0.1
pkgrel=1gv
arch=i486
source=("http://prdownloads.sourceforge.net/enlightenment/$pkgname-$pkgver.tar.gz" "xinitrc.e16" "http://pnboy.pinguix.com/gapan/sources/e16/FantastuxFour.jpg" "http://pnboy.pinguix.com/gapan/sources/e16/brokenvista.jpg")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo")
url=http://www.enligntenment.org
options=('noautodotnew')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"e16 - The Enlightenment window manager, DR16."
"Enlightenment is a window manager for the X Window System that"
"is designed to be powerful, extensible, configurable and"
"pretty darned good looking! It is one of the more graphically"
"intense window managers."
""
"Enlightenment goes beyond managing windows by providing a useful"
"and appealing graphical shell from which to work. It is open"
"in design and instead of dictating a policy, allows the user to"
"define their own policy, down to every last detail."
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	./configure --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} --localstatedir=/var --sysconfdir=/etc --mandir=/usr/man --enable-pango --enable-modules --enable-dbus --disable-sound
	make || return 1
	make install DESTDIR=$startdir/pkg
	
	install -D -m644 ../xinitrc.e16 $startdir/pkg/etc/X11/xinit/xinitrc.e16
	
	# Change default wallpapers
	cp -a $startdir/src/brokenvista.jpg $startdir/src/FantastuxFour.jpg $startdir/pkg/usr/share/e16/themes/winter/backgrounds/images/
	sed -i -e "s|backgrounds/images/winter_ui_blue.png|backgrounds/images/brokenvista.jpg|" $startdir/pkg/usr/share/e16/themes/winter/backgrounds/backgrounds.cfg
	sed -i -e "s|backgrounds/images/winter_ui_green.png|backgrounds/images/FantastuxFour.jpg|" $startdir/pkg/usr/share/e16/themes/winter/backgrounds/backgrounds.cfg

	# Fix winter themes permissions
	chown -R root:root $startdir/pkg/usr/share/e16/themes/winter
	
	# This is totally useless
	rm -rf $startdir/pkg/usr/share/applications
}