Skip to contentSkip to conversation

gpm: Fix gpm path in unit file

PATCH In review Robert Joslyn 2 participants 9 messages Apr 14, 2019 – Apr 16, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 gpm: Fix gpm path in unit file

The binary is installed to ${sbindir}, but the unit file used ${bindir}.

---
 meta-oe/recipes-support/gpm/gpm_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-support/gpm/gpm_git.bb +1 -1
index dcc9d68ea..fa0307038 100644
@@ -33,7 +33,7 @@ do_configure_prepend() {
 do_install_append () {
     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
         install -d ${D}${systemd_system_unitdir}
-        sed 's:@bindir@:${bindir}:' < ${WORKDIR}/gpm.service.in >${D}${systemd_system_unitdir}/gpm.service
+        sed 's:@bindir@:${sbindir}:' < ${WORKDIR}/gpm.service.in >${D}${systemd_system_unitdir}/gpm.service
     fi
     if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
         install -D -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/gpm
Signature · 1 line
2.21.0
#1 lore raw

PATCH 2/5 gpm: Add PID file to systemd unit file

This helps systemd identify the main process of the service.

---
 meta-oe/recipes-support/gpm/gpm/gpm.service.in | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-support/gpm/gpm/gpm.service.in +1 -0
index ee6c040fa..5a6cadeb4 100644
@@ -4,6 +4,7 @@ Description=Virtual console mouse server
 [Service]
 Type=forking
 ExecStart=@bindir@/gpm -m /dev/input/mice -t imps2
+PIDFile=/run/gpm.pid
 
 [Install]
 WantedBy=multi-user.target
Signature · 1 line
2.21.0
#2 lore raw

PATCH 3/5 gpm: Generate documentation

In reply to Robert Joslyn

Remove patch disabling documentation, since it builds and is packaged properly.

---
 meta-oe/recipes-support/gpm/gpm/no-docs.patch | 18 ------------------
 meta-oe/recipes-support/gpm/gpm_git.bb        |  1 -
 2 files changed, 19 deletions(-)
 delete mode 100644 meta-oe/recipes-support/gpm/gpm/no-docs.patch
meta-oe/recipes-support/gpm/gpm/no-docs.patch deleted +0 -18
deleted file mode 100644
index 3faef84ee..000000000
@@ -1,18 +0,0 @@
-
-#
-# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
-#
-
-Index: gpm-1.99.7/Makefile.in
-===================================================================
---- gpm-1.99.7.orig/Makefile.in	2008-07-24 03:36:35.000000000 -0700
-+++ gpm-1.99.7/Makefile.in	2010-06-22 18:28:45.269507001 -0700
-@@ -19,7 +19,7 @@
- # user-overridable flags, but it's also all the implicit rule looks at.
- # missing ?
- 
--SUBDIRS = src doc contrib
-+SUBDIRS = src
- 
- 
- ### simple, but effective rules
meta-oe/recipes-support/gpm/gpm_git.bb +0 -1
index fa0307038..012dceb23 100644
@@ -13,7 +13,6 @@ DEPENDS = "ncurses bison-native"
 
 SRC_URI = "git://github.com/telmich/gpm;protocol=git \
            file://init \
-           file://no-docs.patch \
            file://processcreds.patch \
            file://gpm.service.in \
            file://0001-Use-sigemptyset-API-instead-of-__sigemptyset.patch \
Signature · 1 line
2.21.0
#3 lore raw

PATCH 4/5 gpm: Remove duplicate definition of _GNU_SOURCE

In reply to Robert Joslyn

The Makefile already sets -D_GNU_SOURCE in CPPFLAGS, no need to patch it in again.

---
 meta-oe/recipes-support/gpm/gpm/processcreds.patch | 12 ------------
 meta-oe/recipes-support/gpm/gpm_git.bb             |  1 -
 2 files changed, 13 deletions(-)
 delete mode 100644 meta-oe/recipes-support/gpm/gpm/processcreds.patch
meta-oe/recipes-support/gpm/gpm/processcreds.patch deleted +0 -12
deleted file mode 100644
index d647eca0a..000000000
@@ -1,12 +0,0 @@
-Index: gpm-1.99.7/src/daemon/processconn.c
-===================================================================
---- gpm-1.99.7.orig/src/daemon/processconn.c	2010-09-29 17:36:18.571782951 +0400
-+++ gpm-1.99.7/src/daemon/processconn.c	2010-09-29 17:42:44.659991758 +0400
-@@ -20,6 +20,7 @@
-  *
-  ********/
- 
-+#define _GNU_SOURCE
- #include <sys/socket.h>         /* accept */
- #include <stdlib.h>             /* malloc */
- #include <unistd.h>             /* close */
meta-oe/recipes-support/gpm/gpm_git.bb +0 -1
index 012dceb23..b64f05c57 100644
@@ -13,7 +13,6 @@ DEPENDS = "ncurses bison-native"
 
 SRC_URI = "git://github.com/telmich/gpm;protocol=git \
            file://init \
-           file://processcreds.patch \
            file://gpm.service.in \
            file://0001-Use-sigemptyset-API-instead-of-__sigemptyset.patch \
            "
Signature · 1 line
2.21.0
#4 lore raw

Re: [meta-oe][PATCH 4/5] gpm: Remove duplicate definition of _GNU_SOURCE

Quoted 2 lines · Robert Joslyn

The Makefile already sets -D_GNU_SOURCE in CPPFLAGS, no need to patch it in again.

Have you build tested it with musl ?

Quoted 53 lines
---
 meta-oe/recipes-support/gpm/gpm/processcreds.patch | 12 ------------
 meta-oe/recipes-support/gpm/gpm_git.bb             |  1 -
 2 files changed, 13 deletions(-)
 delete mode 100644 meta-oe/recipes-support/gpm/gpm/processcreds.patch
meta-oe/recipes-support/gpm/gpm/processcreds.patch deleted +0 -3
deleted file mode 100644
index d647eca0a..000000000
@@ -1,12 +0,0 @@
-Index: gpm-1.99.7/src/daemon/processconn.c
-===================================================================
---- gpm-1.99.7.orig/src/daemon/processconn.c   2010-09-29

17:36:18.571782951 +0400
-+++ gpm-1.99.7/src/daemon/processconn.c 2010-09-29
17:42:44.659991758 +0400
-@@ -20,6 +20,7 @@

meta-oe/recipes-support/gpm/gpm/processcreds.patch deleted +0 -7
-  *
-  ********/
-
-+#define _GNU_SOURCE
- #include <sys/socket.h>         /* accept */
- #include <stdlib.h>             /* malloc */
- #include <unistd.h>             /* close */
meta-oe/recipes-support/gpm/gpm_git.bb +0 -1
index 012dceb23..b64f05c57 100644
@@ -13,7 +13,6 @@ DEPENDS = "ncurses bison-native"
 
 SRC_URI = "git://github.com/telmich/gpm;protocol=git \
            file://init \
-           file://processcreds.patch \
            file://gpm.service.in \
            file://0001-Use-sigemptyset-API-instead-of-__sigemptyset.patch
 \
            "

--
2.21.0

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#5 lore raw

Re: [meta-oe][PATCH 4/5] gpm: Remove duplicate definition of _GNU_SOURCE

Quoted 9 lines · Khem Raj
Quoted 3 lines · Robert Joslyn

The Makefile already sets -D_GNU_SOURCE in CPPFLAGS, no need to patch it
in again.

Have you build tested it with musl ?

Yes, this builds with musl, but I have not run tested. I can throw a musl build on a board tomorrow to make sure it runs on hardware.

Thanks,
Robert

#6 lore raw

Re: [meta-oe][PATCH 4/5] gpm: Remove duplicate definition of _GNU_SOURCE

In reply to Khem Raj
Quoted 9 lines · Khem Raj
Quoted 3 lines · Robert Joslyn

The Makefile already sets -D_GNU_SOURCE in CPPFLAGS, no need to patch it
in again.

Have you build tested it with musl ?

Was able to do a musl build and confirmed it builds and runs on my x86 boards.

Thanks,
Robert

#7 lore raw

Re: [meta-oe][PATCH 4/5] gpm: Remove duplicate definition of _GNU_SOURCE

Quoted 5 lines · Robert Joslyn
Quoted 4 lines · Khem Raj

On Sun, Apr 14, 2019 at 11:09 AM Robert Joslyn <
[email protected]> wrote:

Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

The Makefile already sets -D_GNU_SOURCE in CPPFLAGS, no need to patch it
in again.

Have you build tested it with musl ?

Was able to do a musl build and confirmed it builds and runs on my x86 boards.

Thanks

Quoted 4 lines

Thanks,
Robert

#8 lore raw

PATCH 5/5 gpm: Recipe cleanup

In reply to Robert Joslyn

* Add SUMMARY and HOMEPAGE
* Remove unnecessary FILES line, as the specified directory does not exist
* Remove unnecessary conditional placement of init script and systemd unit file. The update-rc.d and systemd classes handle packaging of these files.

---
 meta-oe/recipes-support/gpm/gpm_git.bb | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
meta-oe/recipes-support/gpm/gpm_git.bb +5 -10
index b64f05c57..7034d3385 100644
@@ -1,6 +1,8 @@
+SUMMARY = "Console mouse driver"
 DESCRIPTION = "GPM (General Purpose Mouse) is a mouse server \
 for the console and xterm, with sample clients included \
 (emacs, etc)."
+HOMEPAGE = "https://www.nico.schottelius.org/software/gpm"
 SECTION = "console/utils"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
@@ -29,17 +31,10 @@ do_configure_prepend() {
 }
 
 do_install_append () {
-    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-        install -d ${D}${systemd_system_unitdir}
-        sed 's:@bindir@:${sbindir}:' < ${WORKDIR}/gpm.service.in >${D}${systemd_system_unitdir}/gpm.service
-    fi
-    if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
-        install -D -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/gpm
-    fi
-    install -D -m 0644 ${S}/src/headers/gpm.h ${D}${includedir}/gpm.h
+    install -d ${D}${systemd_system_unitdir}
+    sed 's:@bindir@:${sbindir}:' < ${WORKDIR}/gpm.service.in >${D}${systemd_system_unitdir}/gpm.service
+    install -D -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/gpm
     ln -s libgpm.so.2 ${D}${libdir}/libgpm.so
 }
 
 SYSTEMD_SERVICE_${PN} = "gpm.service"
-
-FILES_${PN} += "${datadir}/emacs"
Signature · 1 line
2.21.0