# Description: Gestionnaire de fenĂȘtres tres flexible et plein de patch... :)
# URL: http://www.fvwm.org/
# Maintainer: NuTyX packager team
# Packager: Skippythekango at yahoo dot fr
# Depends on: librsgv, xorg, p5-tk, p5-x11-protocol

name=fvwm-patched
version=2.5.28
release=1
_name=fvwm
source=(ftp://ftp.fvwm.org/pub/fvwm/version-2/${_name}-$version.tar.gz \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/01-fvwm-translucent-menus.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/02-fvwm-menu-xlock-xlockmore-compat.diff \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/03-ColourBorders.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/04-ResizeOutlineThin.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/05-Conditionals.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/06-FlatSeparators.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/07-BorderUnderTitle.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/08-InactiveFont.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/09-FluxRoundedCorners.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/10-TopBorder.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/11-ButtonWidth.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/12-MultiBorder.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/13-FvwmButtonsTips.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/14-FvwmIconMan.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/15-Hover.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/16-FirstItemUnderPointer.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/17-TextOffset.patch \
	http://fvwm.tuxfamily.org/pub/wiki/portage/files/18-ThinGeometryProxy.patch \
	http://fvwm.tuxfamily.org/pub/wiki/MenuTranslucency.patch \
	fvwm.desktop)

build()
{
cd ${_name}-$version

patch -p0 < $SRC/01-fvwm-translucent-menus.patch
patch -p0 < $SRC/03-ColourBorders.patch
patch -p0 < $SRC/04-ResizeOutlineThin.patch
patch -p0 < $SRC/05-Conditionals.patch
patch -p0 < $SRC/06-FlatSeparators.patch
patch -p0 < $SRC/07-BorderUnderTitle.patch
patch -p0 < $SRC/08-InactiveFont.patch
patch -p0 < $SRC/09-FluxRoundedCorners.patch
patch -p0 < $SRC/10-TopBorder.patch
patch -p0 < $SRC/11-ButtonWidth.patch
patch -p0 < $SRC/12-MultiBorder.patch
patch -p0 < $SRC/13-FvwmButtonsTips.patch
patch -p0 < $SRC/14-FvwmIconMan.patch
patch -p0 < $SRC/15-Hover.patch
patch -p0 < $SRC/16-FirstItemUnderPointer.patch
patch -p0 < $SRC/17-TextOffset.patch
patch -p0 < $SRC/18-ThinGeometryProxy.patch

./configure --prefix=/usr \
	--sysconfdir=/etc \
	--libexecdir=/usr/lib \
	--with-xft-prefix=/usr \
	--with-fontconfig=/usr \
	--disable-bidi \
	--disable-gtk \
	--disable-iconv \
    --enable-imlib
make
make DESTDIR=$PKG install

install -D -m644 $SRC/fvwm.desktop $PKG/usr/share/xsessions/fvwm.desktop
rm -r $PKG/usr/share/doc
}