# Contributor: ScrumpyJack <scrumpyjack@st.ilet.to>
# Maintainer: ScrumpyJack <scrumpyjack@st.ilet.to>
pkgname=stalonetray
pkgver=0.8.5
pkgrel=0
pkgdesc="Stalonetray is a stand-alone freedesktop.org and KDE system tray"
url="https://stalonetray.sourceforge.net/"
arch="all"
license="GPL-2.0-only"
makedepends="
	autoconf
	automake
	docbook-xsl
	libx11-dev
	libxpm-dev
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/kolbusa/stalonetray/archive/refs/tags/v$pkgver.tar.gz"
options="!check" # no tests

prepare() {
	default_prepare

	# needed for it to find xsl to generate manpages
	local _xslpath="$(echo /usr/share/xml/docbook/xsl-stylesheets-*)"
	sed -i \
		-e "s|/usr/share/sgml/docbook/stylesheet/xsl/nwalsh|$_xslpath|g" \
		configure.ac

	autoreconf -fi
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 stalonetrayrc.sample.in "$pkgdir"/etc/stalonetrayrc
}

sha512sums="
7fe1c2fcc5de06b89f4a5c182baeb0a98f0328ae6bf03a79e76c4af7ee4d86cd8f6967ec8b0123a831998cb075ef2b2f6bc6478bde0b73883fe37d2bd6a471d3  stalonetray-0.8.5.tar.gz
"
