# Contributor: Alan Lacerda <alacerda@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=mate-screensaver
pkgver=1.28.0
pkgrel=0
pkgdesc="Screen saver and locker for MATE"
url="https://github.com/mate-desktop/mate-screensaver"
arch="all"
license="GPL-2.0-or-later"
makedepends="
	dbus-glib-dev
	dconf-dev
	elogind-dev
	glib-dev
	gtk+3.0-dev
	intltool
	libmatekbd-dev
	libnotify-dev
	libsm-dev
	libxscrnsaver-dev
	mate-desktop-dev
	mate-menus-dev
	mate-session-manager
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="https://pub.mate-desktop.org/releases/${pkgver%.*}/mate-screensaver-$pkgver.tar.xz"
builddir="$srcdir/$pkgname-$pkgver/"
options="suid"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--sysconfdir=/etc \
		--enable-static=no \
		--enable-locking=yes \
		--prefix=/usr \
		--without-console-kit \
		--with-elogind
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	# https://gitweb.gentoo.org/repo/gentoo.git/tree/mate-extra/mate-screensaver
	chmod u+s "$pkgdir"/usr/libexec/mate-screensaver-dialog
}

sha512sums="
c687317d8cb1e5b3844a560dcefb6e198925f8fb54360e1d8a86185e0e15b0bc90046b28ec0a6dc460a2ace15a58c0e7deeac8a8149e5ae83a3e8af8846e796d  mate-screensaver-1.28.0.tar.xz
"
