summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-oe/recipes-support/libutempter
diff options
context:
space:
mode:
authorDave Cobbley <david.j.cobbley@linux.intel.com>2018-08-14 20:05:37 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-23 04:26:31 +0300
commiteb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch)
treede291a73dc37168da6370e2cf16c347d1eba9df8 /meta-openembedded/meta-oe/recipes-support/libutempter
parent9c3cf826d853102535ead04cebc2d6023eff3032 (diff)
downloadopenbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-support/libutempter')
-rw-r--r--meta-openembedded/meta-oe/recipes-support/libutempter/libutempter.bb41
-rw-r--r--meta-openembedded/meta-oe/recipes-support/libutempter/libutempter/0001-Fix-macro-error.patch36
-rw-r--r--meta-openembedded/meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch81
3 files changed, 158 insertions, 0 deletions
diff --git a/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter.bb b/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter.bb
new file mode 100644
index 000000000..8c84cb376
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter.bb
@@ -0,0 +1,41 @@
+SUMMARY = "A privileged helper for utmp/wtmp updates"
+DESCRIPTION = "\
+This library provides interface for terminal emulators such as \
+screen and xterm to record user sessions to utmp and wtmp files."
+HOMEPAGE = "ftp://ftp.altlinux.org/pub/people/ldv/utempter"
+SECTION = "System Environment/Libraries"
+LICENSE = "GPLv2 & GPLv2+ & LGPLv2 & MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+SRCREV = "3ef74fff310f09e2601e241b9f042cd39d591018"
+PV = "1.1.6-alt2+git${SRCPV}"
+
+SRC_URI = "git://git.altlinux.org/people/ldv/packages/libutempter.git \
+ file://0001-Fix-macro-error.patch \
+ file://libutempter-remove-glibc-assumption.patch \
+ "
+
+S = "${WORKDIR}/git/${BPN}"
+
+CFLAGS += "-DLIBEXECDIR=${libexecdir}"
+
+do_compile() {
+ oe_runmake \
+ libdir=${libdir} \
+ libexecdir=${libexecdir}
+}
+
+do_install() {
+ oe_runmake install \
+ DESTDIR=${D} \
+ libdir="${libdir}" \
+ libexecdir="${libexecdir}" \
+ includedir=${includedir} \
+ mandir=${mandir}
+
+ rm -f ${D}${libdir}/*.a
+}
+
+FILES_${PN} = "${libdir}/*.so.*"
+FILES_${PN} += "${libexecdir}/utempter/utempter"
+FILES_${PN}-dbg += "${libexecdir}/utempter/.debug/utempter"
diff --git a/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter/0001-Fix-macro-error.patch b/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter/0001-Fix-macro-error.patch
new file mode 100644
index 000000000..8140ea343
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter/0001-Fix-macro-error.patch
@@ -0,0 +1,36 @@
+From fc2bd592ad17d1c2a2a989750e69dfaedc28c633 Mon Sep 17 00:00:00 2001
+From: Qian Lei <qianl.fnst@cn.fujitsu.com>
+Date: Fri, 9 Jan 2015 10:40:29 +0800
+Subject: [PATCH] Fix macro error
+
+compile error when build on almost all architectures.
+
+Upstream-Status: Pending
+Signed-off-by: Qian Lei <qianl.fnst@cn.fujitsu.com>
+---
+ iface.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/iface.c b/iface.c
+index 5951d81..27793f0 100644
+--- a/iface.c
++++ b/iface.c
+@@ -43,7 +43,14 @@
+ __result; }))
+ #endif
+
+-#define UTEMPTER_DEFAULT_PATHNAME LIBEXECDIR "/utempter/utempter"
++#ifdef LIBEXECDIR
++# define CAT_PATH(DIR1,DIR2) DIR1##DIR2
++# define RAW_UTEMPTER_PATH CAT_PATH(LIBEXECDIR,/utempter/utempter)
++#else
++# define RAW_UTEMPTER_PATH /usr/lib/libtempter/utempter/utempter
++#endif
++#define STR_PATH(RAW_STR) #RAW_STR
++#define UTEMPTER_DEFAULT_PATHNAME STR_PATH(RAW_UTEMPTER_PATH)
+
+ static const char *utempter_pathname;
+ static int saved_fd = -1;
+--
+1.8.3.1
+
diff --git a/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch b/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch
new file mode 100644
index 000000000..6ed93355b
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-support/libutempter/libutempter/libutempter-remove-glibc-assumption.patch
@@ -0,0 +1,81 @@
+diff -Naur libutempter-1.1.6.orig/utempter.c libutempter-1.1.6/utempter.c
+--- libutempter-1.1.6.orig/utempter.c 2010-11-04 13:14:53.000000000 -0400
++++ libutempter-1.1.6/utempter.c 2014-06-20 16:37:09.762403323 -0400
+@@ -34,13 +34,7 @@
+ #include <sys/stat.h>
+ #include <utmp.h>
+
+-#ifdef __GLIBC__
+ # include <pty.h>
+-#elif defined(__FreeBSD__)
+-# include <libutil.h>
+-#else
+-# error Unsupported platform
+-#endif /* __GLIBC__ || __FreeBSD__ */
+
+ #define DEV_PREFIX "/dev/"
+ #define DEV_PREFIX_LEN (sizeof(DEV_PREFIX)-1)
+@@ -106,17 +100,12 @@
+
+ static int
+ write_uwtmp_record(const char *user, const char *term, const char *host,
+-#ifdef __GLIBC__
+ pid_t pid,
+-#endif
+ int add)
+ {
+ struct utmp ut;
+ struct timeval tv;
+-
+-#ifdef __GLIBC__
+ size_t offset;
+-#endif
+
+ memset(&ut, 0, sizeof(ut));
+
+@@ -128,8 +117,6 @@
+ if (host)
+ strncpy(ut.ut_host, host, sizeof(ut.ut_host));
+
+-#ifdef __GLIBC__
+-
+ offset = (strlen(term) <= sizeof(ut.ut_id)) ? 0 :
+ strlen(term) - sizeof(ut.ut_id);
+ strncpy(ut.ut_id, term + offset, sizeof(ut.ut_id));
+@@ -156,27 +143,6 @@
+
+ (void) updwtmp(_PATH_WTMP, &ut);
+
+-#elif defined(__FreeBSD__)
+-
+- ut.ut_time = tv.tv_sec;
+-
+- if (add)
+- {
+- login(&ut);
+- } else
+- {
+- if (logout(term) != 1)
+- {
+-#ifdef UTEMPTER_DEBUG
+- fprintf(stderr, "utempter: logout: %s\n",
+- strerror(errno));
+-#endif
+- exit(EXIT_FAILURE);
+- }
+- }
+-
+-#endif /* __GLIBC__ || __FreeBSD__ */
+-
+ #ifdef UTEMPTER_DEBUG
+ fprintf(stderr,
+ "utempter: DEBUG: utmp/wtmp record %s for terminal '%s'\n",
+@@ -255,8 +221,6 @@
+ validate_device(device);
+
+ return write_uwtmp_record(pw->pw_name, device + DEV_PREFIX_LEN, host,
+-#ifdef __GLIBC__
+ pid,
+-#endif
+ add);
+ }