# Template file for 'WindowMaker'
pkgname=WindowMaker
version=0.95.5
revision=1
build_style=gnu-configure
configure_args="--enable-xinerama --with-nlsdir=/usr/share/locale
 --enable-usermenu --enable-modelock --enable-xrandr --disable-static"
hostmakedepends="automake libtool pkg-config"
makedepends="libXinerama-devel libXrandr-devel libXmu-devel libXpm-devel
 libXpm-devel libXft-devel libpng-devel>=1.6 tiff-devel giflib-devel
 fontconfig-devel"
conf_files="
	/etc/WindowMaker/WindowMaker
	/etc/WindowMaker/WMRootMenu
	/etc/WindowMaker/WMWindowAttributes
	/etc/WindowMaker/WMState
	/etc/WindowMaker/WMGLOBA"
short_desc="An X11 window manager with a NEXTSTEP look and feel"
maintainer="Juan RP <xtraeme@gmail.com>"
license="GPL-3"
homepage="http://www.windowmaker.org/"
distfiles="http://windowmaker.org/pub/source/release/${pkgname}-${version}.tar.gz"
checksum=4b25f474fde032a060c93fbc50f1ce04729ab17ea963ca3eb8dbb82f49af70d0

pre_configure() {
	autoreconf -fi
}

post_configure() {
	# Remove hardcoded /usr/{include,lib} paths!
	find ${wrksrc} -name Makefile -exec sed 's,-L${libdir},,g;s,-I${includedir},,g' -i {} \;
}

post_install() {
	vinstall COPYING.WTFPL 644 usr/share/licenses/${pkgname}
	vinstall ${FILESDIR}/wmaker.desktop 644 usr/share/xsessions
}

WindowMaker-devel_package() {
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove "usr/lib/*.so"
		vmove usr/lib/pkgconfig
	}
}
