Subject: [alpine-devel] [PATCH] Add gpm console mouse daemon to testing

From: Jeff Pohlmeyer <[email-masked]>
Date: Fri, 29 Nov 2013 16:26:31 -0600

Note that building this thing requires autoconf, automake, and libtool
but I didn't list them in makedepends. I assume they are part of the
"default" build environment?

 - Jeff
diff --git a/testing/gpm/APKBUILD b/testing/gpm/APKBUILD
new file mode 100644
index 0000000..5466914
--- /dev/null
+++ b/testing/gpm/APKBUILD
@@ -0,0 +1,62 @@
+# Contributor: Jeff Pohlmeyer <[email-masked]>
+# Maintainer: Jeff Pohlmeyer <[email-masked]>
+pkgname=gpm
+pkgver=1.20.7
+pkgrel=0
+pkgdesc="A mouse server for the console"
+url="http://www.nico.schottelius.org/software/gpm/"
+arch="all"
+license="GPL"
+depends=""
+depends_dev=""
+makedepends="$depends_dev texinfo"
+install=""
+subpackages="$pkgname-dev $pkgname-doc"
+source="http://www.nico.schottelius.org/software/gpm/archives/gpm-$pkgver.tar.bz2
+	gpm.initd
+	gpm.confd
+	"
+
+_builddir="$srcdir"/gpm-$pkgver
+prepare() {
+	local i
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+}
+
+build() {
+	cd "$_builddir"
+	./autogen.sh
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix=/usr \
+		--sysconfdir=/etc \
+		--mandir=/usr/share/man \
+		--infodir=/usr/share/info \
+		--localstatedir=/var \
+		|| return 1
+	make || return 1
+}
+
+package() {
+	cd "$_builddir"
+	make DESTDIR="$pkgdir" install || return 1
+	rm -f "$pkgdir"/usr/lib/*.la
+
+	install -m755 -D "$srcdir"/$pkgname.initd \
+		"$pkgdir"/etc/init.d/$pkgname || return 1
+	install -m644 -D "$srcdir"/$pkgname.confd \
+		"$pkgdir"/etc/conf.d/$pkgname || return 1
+
+	chmod 755 "$pkgdir"/usr/lib/libgpm.so.*
+}
+
+md5sums="bf84143905a6a903dbd4d4b911a2a2b8  gpm-1.20.7.tar.bz2
+0eeefbbd956ee14cb20161d5a7a5bdc6  gpm.initd
+2243adac99a888b0598d6b9233862788  gpm.confd"
+
diff --git a/testing/gpm/gpm.confd b/testing/gpm/gpm.confd
new file mode 100644
index 0000000..a3c6be6
--- /dev/null
+++ b/testing/gpm/gpm.confd
@@ -0,0 +1,8 @@
+# gpm conf.d file for alpine linux
+
+#
+# Specify gpm mouse daemon options here.
+#
+
+gpm_opts="-m /dev/input/mice -t imps2"
+
diff --git a/testing/gpm/gpm.initd b/testing/gpm/gpm.initd
new file mode 100644
index 0000000..207b4c0
--- /dev/null
+++ b/testing/gpm/gpm.initd
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+
+# gpm init.d file for alpine linux.
+
+name=gpm
+daemon=/usr/sbin/${name}
+
+depend() {
+	after localmount
+	use hotplug logger
+}
+
+start() {
+	ebegin "Starting ${name}"
+		start-stop-daemon --start --quiet \
+			--pidfile /var/run/${name}.pid \
+			--exec ${daemon} -- ${gpm_opts}
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping ${name}"
+		start-stop-daemon --stop --quiet \
+			--pidfile /var/run/${name}.pid \
+			--exec ${daemon}
+	eend $?
+}
+

---

From: Dubiousjim <[email-masked]>
Date: Mon, 2 Dec 2013 08:16:17 -0500

> "default" build environment?

They're not. These are the packages that are (recursively) included when
one installs alpine-sdk:

abuild
acct
apk-tools
binutils
binutils-libs
build-base
busybox
bzip2
ca-certificates
cdrkit
curl
expat
fakeroot
file
g++
gcc
git
gmp5
libattr
libbz2
libc
libc-dev
libc-utils
libc0.9.32
libcap
libcrypto1.0
libgcc
libgomp
libpthread
libssh2
libssl1.0
libstdc++
libthread_db
linux-headers
lzo
make
mkinitfs
mpc1
mpfr3
mtools
openssl
patch
pax-utils
pcre
pkgconf
pkgconfig
run-parts
squashfs-tools
sudo
uclibc-dev
uclibc-utils
xz-libs
zlib

-- 
Dubiousjim
[email-masked]

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Mon, 2 Dec 2013 17:03:05 +0100

On Fri, 29 Nov 2013 16:26:31 -0600

> "default" build environment?

ccache gcc -Os -fomit-frame-pointer -pipe -Wformat -Werror=format-security -I/home/ncopa/aports/testing/gpm/src/gpm-1.20.7/src -DHAVE_CONFIG_H -include headers/config.h -Wall -DSYSCONFDIR="\"/etc\"" -DSBINDIR="\"/usr/sbin\"" -D_GNU_SOURCE -Os -fomit-frame-pointer -pipe -Wformat -Werror=format-security -Os -fomit-frame-pointer -pipe -Wformat -Werror=format-security -Os -fomit-frame-pointer -pipe -Wformat -Werror=format-security -c -o lib/libxtra.o lib/libxtra.c
lib/report-lib.c: In function 'gpm_report':
lib/report-lib.c:50:4: error: format not a string literal and no format arguments [-Werror=format-security]
    syslog(log_level, string);
    ^
cc1: some warnings being treated as errors

C code is ugly...

I fixed that and apply it.

Thanks!

-nc

---