#Maintainer: Dimitris Tzemos <djemos~at~slackel~dot~gr>

pkgname=xorg-gpu-settings
pkgver=15.1
pkgrel=2dj
source=("detect_gpu.sh")
arch=noarch
options=('noautodotnew')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"xorg-gpu-settings (detect gpu Graphics card)"
)

doinst() {
if [ -f etc/X11/xorg.conf.d/20-intel.conf ]; then
	rm etc/X11/xorg.conf.d/20-intel.conf
fi

if [ -f var/log/packages/xorg-intel-settings ]; then
	spkg -d xorg-intel-settings
fi

if [ -f etc/rc.d/rc.local ]; then
	sed -i "/detect_gpu.sh/d" etc/rc.d/rc.local 
	echo "sh /usr/bin/detect_gpu.sh" >> etc/rc.d/rc.local
    sh etc/rc.d/rc.local
fi	
}

build() {
cd $startdir/src/
mkdir -p $startdir/pkg/usr/bin/
cp $startdir/src/detect_gpu.sh $startdir/pkg/usr/bin/

chmod 755 $startdir/pkg/usr/bin/detect_gpu.sh
chown -R root:root $startdir/pkg/
}
