description="General Purpose Mouse: mouse server for the console and xterm."
url="http://unix.schottelius.org/gpm"
packager="tnut <tnut@nutyx.org>"
contributors="Pierre B"
name=gpm
version=1.20.7
release=4
nutyx_version=10.1

source=(http://downloads.tuxfamily.org/nutyx/files/nutyx-${nutyx_version}.tar.xz
	gpm-1.20.7-glibc-2.26-1.patch
	http://www.nico.schottelius.org/software/$name/archives/$name-$version.tar.bz2)

build() {
	cd $name-$version

	patch -Np1 -i ../gpm-1.20.7-glibc-2.26-1.patch
	sed -i -e 's:<gpm.h>:"headers/gpm.h":' src/prog/{display-buttons,display-coords,get-versions}.c

	./autogen.sh
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
	make ROOT=$PKG install
	ln -sv libgpm.so.2.1.0 $PKG/usr/lib/libgpm.so.1
	ln -sv libgpm.so.2.1.0 $PKG/usr/lib/libgpm.so
	install -v -m644 conf/gpm-root.conf $PKG/etc

	cd ../nutyx-${nutyx_version}
	make DESTDIR=$PKG install-gpm
}
