# xdm - the original X display manager. Tiny, and it still works.
name=xdm
version=1.1.17
release=1
desc="X display manager"
url="https://x.org/"
license="MIT"
depend="glibc libx11 libxaw libxmu libxft xorg-server"
makedepend="clang lld pkgconf"
source="https://x.org/pub/individual/app/xdm-$version.tar.xz"
sha256="SKIP"

build() {
	cd "xdm-$version"
	./configure --prefix=/usr --sysconfdir=/etc --with-xdmconfigdir=/etc/X11/xdm
	make -j"$JOBS"
}

package() {
	cd "xdm-$version"
	make DESTDIR="$pkgdir" install
	# ScrapLinux colours on the greeter, so it does not look like 1994.
	mkdir -p "$(dirname $pkgdir/etc/X11/xdm/Xresources.scraplinux)"
cat >"$pkgdir/etc/X11/xdm/Xresources.scraplinux" <<-'RES'
		xlogin*greeting: ScrapLinux
		xlogin*background: #1a1b26
		xlogin*foreground: #c8d3f5
		xlogin*greetColor: #03dbbb
		xlogin*promptColor: #7e32ca
		xlogin*borderWidth: 0
RES
chmod 644 "$pkgdir/etc/X11/xdm/Xresources.scraplinux"
}
