#Packager: George Vlahavas <vlahavas~at~gmail~dot~com>
#Included in Slint by Didier Spaier didieratslintdotfr
pkgname=lightdm-gtk-greeter
pkgver=2.0.8
pkgrel=3slint
source=("https://github.com/Xubuntu/lightdm-gtk-greeter/releases/download/lightdm-gtk-greeter-$pkgver/lightdm-gtk-greeter-$pkgver.tar.gz"
	"lightdm-gtk-greeter.conf"
	"lightdm-gg-icon_size.patch")
docs=("readme.md" "install" "copying" "changelog" "authors" "news" "todo")
url=https://github.com/Xubuntu/lightdm-gtk-greeter

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"lightdm-gtk-greeter (a greeter that has moderate requirements)"
"LightDM is a cross-desktop display manager. lightdm-gtk-greeter is one"
"of many greeters for it."
)

doinst() {
# Update desktop database:
if [ -x /usr/bin/update-desktop-database ]; then
	/usr/bin/update-desktop-database /usr/share/applications 1> /dev/null 2> /dev/null
fi

# Update any existing icon cache files:
if find /usr/share/icons -maxdepth 2 2> /dev/null | grep -q icon-theme.cache ; then
  for theme_dir in /usr/share/icons/* ; do
    if [ -r ${theme_dir}/icon-theme.cache ]; then
      /usr/bin/gtk-update-icon-cache -t -f ${theme_dir} 1> /dev/null 2> /dev/null &
    fi
  done
  # This would be a large file and probably shouldn't be there.
if [ -r /usr/share/icons/icon-theme.cache ]; then
    rm -f /usr/share/icons/icon-theme.cache
  fi
fi
}

build() {
	cd $startdir/src/$pkgname-$pkgver
    patch -p1 --verbose < $SRC/lightdm-gg-icon_size.patch || exit 1
	./configure --prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--with-libxklavier \
		--enable-kill-on-sigterm \
		--disable-libido \
		--disable-libindicator \
		--disable-static \
		--build=$arch-slackware-linux
	make -j $numjobs || return 1
	make install DESTDIR=$startdir/pkg

	# override configuration
	cp $startdir/src/lightdm-gtk-greeter.conf $startdir/pkg/etc/lightdm/
} 
