summaryrefslogtreecommitdiffstats
path: root/recipes/fush
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/fush
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
downloadopenembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/fush')
-rw-r--r--recipes/fush/files/install.patch31
-rw-r--r--recipes/fush/files/openpty.patch172
-rw-r--r--recipes/fush/files/paths.patch96
-rw-r--r--recipes/fush/fush_0.9.0.bb16
4 files changed, 315 insertions, 0 deletions
diff --git a/recipes/fush/files/install.patch b/recipes/fush/files/install.patch
new file mode 100644
index 0000000000..0b054c2ec9
--- /dev/null
+++ b/recipes/fush/files/install.patch
@@ -0,0 +1,31 @@
+Index: fush-0-9-0/Makefile.in
+===================================================================
+--- fush-0-9-0.orig/Makefile.in 2004-01-25 18:52:01.000000000 -0600
++++ fush-0-9-0/Makefile.in 2005-01-18 15:39:24.000000000 -0600
+@@ -1,6 +1,7 @@
+ CC = @CC@
+ CFLAGS = -Wall @CFLAGS@ @CPPFLAGS@ @DEFS@
+ LDFLAGS = @LDFLAGS@ @LIBS@
++DESTDIR=
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+@@ -31,12 +32,12 @@
+ cd src && $(MAKE) fuadmin
+
+ install : fush fuadmin
+- $(INSTALL) -c -m 0755 src/fush $(bindir)/fush
+- $(INSTALL) -c -m 0755 src/fuadmin $(sbindir)/fuadmin
+- chown $(user) $(bindir)/fush
+- chmod 4755 $(bindir)/fush
+- $(INSTALL) -c -m 0755 man/fush.1.gz $(mandir)/man1/fush.1.gz
+- $(INSTALL) -c -m 0755 man/fuadmin.1.gz $(mandir)/man1/fuadmin.1.gz
++ $(INSTALL) -c -m 0755 src/fush $(DESTDIR)$(bindir)/fush
++ $(INSTALL) -c -m 0755 src/fuadmin $(DESTDIR)$(sbindir)/fuadmin
++ -chown $(user) $(DESTDIR)$(bindir)/fush
++ -chmod 4755 $(DESTDIR)$(bindir)/fush
++ $(INSTALL) -c -m 0755 man/fush.1.gz $(DESTDIR)$(mandir)/man1/fush.1.gz
++ $(INSTALL) -c -m 0755 man/fuadmin.1.gz $(DESTDIR)$(mandir)/man1/fuadmin.1.gz
+
+ config :
+ src/fuadmin -c
diff --git a/recipes/fush/files/openpty.patch b/recipes/fush/files/openpty.patch
new file mode 100644
index 0000000000..688b258cf2
--- /dev/null
+++ b/recipes/fush/files/openpty.patch
@@ -0,0 +1,172 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+Index: fush-0-9-0/configure.in
+===================================================================
+--- fush-0-9-0.orig/configure.in 2004-01-25 18:52:01.000000000 -0600
++++ fush-0-9-0/configure.in 2005-01-18 13:41:06.000000000 -0600
+@@ -27,7 +27,7 @@
+ # Checks for header files.
+ AC_HEADER_STDC
+ AC_HEADER_SYS_WAIT
+-AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/ioctl.h sys/param.h syslog.h unistd.h string.h sys/types.h syslog.h glob.h time.h errno.h libutil.h termios.h])
++AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/ioctl.h sys/param.h syslog.h unistd.h string.h sys/types.h syslog.h glob.h time.h errno.h libutil.h pty.h termios.h])
+
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+@@ -35,6 +35,14 @@
+ AC_STRUCT_TM
+ AC_TYPE_UID_T
+ AC_CHECK_TYPE( mode_t, unsigned short )
++AC_CHECK_DECLS( [user_from_uid], [], [], [
++#if HAVE_LIBUTIL_H
++# include <libutil.h>
++#endif] )
++if test x"$HAVE_DECL_USER_FROM_UID" = "x"; then
++ PWCACHE_OBJS="pwcache.o"
++fi
++AC_SUBST(PWCACHE_OBJS)
+
+ # Checks for library functions.
+ AC_FUNC_FORK
+Index: fush-0-9-0/src/fushtools.c
+===================================================================
+--- fush-0-9-0.orig/src/fushtools.c 2004-01-25 18:52:01.000000000 -0600
++++ fush-0-9-0/src/fushtools.c 2005-01-18 13:41:30.000000000 -0600
+@@ -23,7 +23,13 @@
+ #include "linklist.h"
+ #include "md5.h"
+ #include <pwd.h>
+-#include <libutil.h>
++#if HAVE_LIBUTIL_H
++# include <libutil.h>
++#else
++# include <pty.h>
++# include <utmp.h>
++# include "pwcache.h"
++#endif
+ #include <termios.h>
+
+ extern List g_replace;
+Index: fush-0-9-0/src/pwcache.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ fush-0-9-0/src/pwcache.c 2005-01-18 15:38:02.000000000 -0600
+@@ -0,0 +1,88 @@
++// Copyright (C) 1992-1998 by Michael K. Johnson, johnsonm@redhat.com
++// Note: most likely none of his code remains
++//
++// Copyright 2002, Albert Cahalan
++//
++// This file is placed under the conditions of the GNU Library
++// General Public License, version 2, or any later version.
++// See file COPYING for information on distribution conditions.
++
++#include <stdio.h>
++#include <sys/types.h>
++#include <stdlib.h>
++#include <pwd.h>
++//#include "alloc.h"
++#include "pwcache.h"
++#include <grp.h>
++
++// might as well fill cache lines... else we waste memory anyway
++
++#define HASHSIZE 64 /* power of 2 */
++#define HASH(x) ((x) & (HASHSIZE - 1))
++
++#define NAMESIZE 20
++#define NAMELENGTH "19"
++
++static struct pwbuf {
++ struct pwbuf *next;
++ uid_t uid;
++ char name[NAMESIZE];
++} *pwhash[HASHSIZE];
++
++char *user_from_uid(uid_t uid, int nouser)
++{
++ struct pwbuf **p;
++ struct passwd *pw;
++ char *ret;
++
++ p = &pwhash[HASH(uid)];
++ while (*p) {
++ if ((*p)->uid == uid)
++ return((*p)->name);
++ p = &(*p)->next;
++ }
++ *p = (struct pwbuf *) malloc(sizeof(struct pwbuf));
++ (*p)->uid = uid;
++ ret = (*p)->name;
++ if ((pw = getpwuid(uid)) == NULL)
++ if (nouser)
++ ret = NULL;
++ else
++ sprintf((*p)->name, "#%d", uid);
++ else
++ sprintf((*p)->name, "%-." NAMELENGTH "s", pw->pw_name);
++ (*p)->next = NULL;
++ return ret;
++}
++
++static struct grpbuf {
++ struct grpbuf *next;
++ gid_t gid;
++ char name[NAMESIZE];
++} *grphash[HASHSIZE];
++
++char *group_from_gid(gid_t gid, int nogroup)
++{
++ struct grpbuf **g;
++ struct group *gr;
++ char *ret;
++
++ g = &grphash[HASH(gid)];
++ while (*g) {
++ if ((*g)->gid == gid)
++ return((*g)->name);
++ g = &(*g)->next;
++ }
++ *g = (struct grpbuf *) malloc(sizeof(struct grpbuf));
++ (*g)->gid = gid;
++ ret = (*g)->name;
++ if ((gr = getgrgid(gid)) == NULL)
++ if (nogroup)
++ ret = NULL;
++ else
++ sprintf((*g)->name, "#%d", gid);
++ else
++ sprintf((*g)->name, "%-." NAMELENGTH "s", gr->gr_name);
++ (*g)->next = NULL;
++ return ret;
++}
+Index: fush-0-9-0/src/pwcache.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ fush-0-9-0/src/pwcache.h 2005-01-18 13:45:17.000000000 -0600
+@@ -0,0 +1,9 @@
++#ifndef PROCPS_PROC_PWCACHE_H
++#define PROCPS_PROC_PWCACHE_H
++
++#include <sys/types.h>
++
++extern char *user_from_uid(uid_t uid, int nouser);
++extern char *group_from_gid(gid_t gid, int nogroup);
++
++#endif
+Index: fush-0-9-0/src/Makefile.in
+===================================================================
+--- fush-0-9-0.orig/src/Makefile.in 2004-01-25 18:52:01.000000000 -0600
++++ fush-0-9-0/src/Makefile.in 2005-01-18 13:37:23.000000000 -0600
+@@ -1,7 +1,7 @@
+ CC = @CC@
+ CFLAGS = -Wall @CFLAGS@ @CPPFLAGS@ @DEFS@
+ LDFLAGS = @LDFLAGS@ @LIBS@
+-OBJS = fush.o fushtools.o fuparse.o md5.o linklist.o
++OBJS = fush.o fushtools.o fuparse.o md5.o linklist.o @PWCACHE_OBJS@
+ ADMOBJS = fushadmin.o md5.o
+ HEADERS = fush.h
+
diff --git a/recipes/fush/files/paths.patch b/recipes/fush/files/paths.patch
new file mode 100644
index 0000000000..f652ed7d21
--- /dev/null
+++ b/recipes/fush/files/paths.patch
@@ -0,0 +1,96 @@
+Index: fush-0-9-0/configure.in
+===================================================================
+--- fush-0-9-0.orig/configure.in 2005-01-19 17:52:07.000000000 -0600
++++ fush-0-9-0/configure.in 2005-01-19 17:54:08.000000000 -0600
+@@ -71,21 +71,20 @@
+
+
+ AC_SUBST(USER)
+-AC_OUTPUT([Makefile src/Makefile])
+
+
+ if test -s $USER_HOME; then
+ echo "configuration directory: $USER_HOME";
+- echo "#define _CONFIGDIR_ \"$USER_HOME\"" >> config.h
+ CONFDIR="$USER_HOME"
+ else
+- echo "configuration directory: $prefix/etc/fush";
+- echo "#define _CONFIGDIR_ \"$prefix/etc/fush\"" >> config.h
+- CONFDIR="$prefix/etc/fush"
++ echo "configuration directory: $sysconfdir/fush";
++ CONFDIR="$sysconfdir/fush"
+ fi
++PATH_DEFS="$PATH_DEFS -D_CONFIGDIR_=\\\"$CONFDIR\\\" -D_BINDIR_=\\\"\$(bindir)\\\" -D_PREFIX_=\\\"\$(prefix)\\\" -D_SYSCONFDIR_=\\\"\$(sysconfdir)\\\""
++AC_SUBST(PATH_DEFS)
++
+
+ if test $ac_cv_lib_readline_readline_ != yes; then
+ AC_WARN(readline(3) library not be found. fush was built but will have reduced functionality. Command entry without readline(3) is on the roadmap for version 1.2. Send a message to the support forum on http://sourceforge.net/projects/foosh to increase priority for this support.)
+ fi
+-
+-echo "#define _PREFIX_ \"$prefix\"" >> config.h
++AC_OUTPUT([Makefile src/Makefile])
+Index: fush-0-9-0/src/Makefile.in
+===================================================================
+--- fush-0-9-0.orig/src/Makefile.in 2005-01-19 17:52:07.000000000 -0600
++++ fush-0-9-0/src/Makefile.in 2005-01-19 17:52:08.000000000 -0600
+@@ -1,5 +1,5 @@
+ CC = @CC@
+-CFLAGS = -Wall @CFLAGS@ @CPPFLAGS@ @DEFS@
++CFLAGS = -Wall @CFLAGS@ @CPPFLAGS@ @DEFS@ @PATH_DEFS@
+ LDFLAGS = @LDFLAGS@ @LIBS@
+ OBJS = fush.o fushtools.o fuparse.o md5.o linklist.o @PWCACHE_OBJS@
+ ADMOBJS = fushadmin.o md5.o
+Index: fush-0-9-0/src/fushadmin.c
+===================================================================
+--- fush-0-9-0.orig/src/fushadmin.c 2004-01-25 18:52:01.000000000 -0600
++++ fush-0-9-0/src/fushadmin.c 2005-01-19 17:53:43.000000000 -0600
+@@ -404,7 +404,7 @@
+ # set to the main system wide profile (cshrc, zshenv, bashrc, etc...)\n\
+ # special note: fush will not correctly process if then statements etc...\n\
+ # (set to 'no' to disable)\n\
+-fu_system_rc=/etc/profile\n\
++fu_system_rc=" _SYSCONFDIR_ "/profile\n\
+ \n\
+ # home system profile (the users home dir is auto prepended)\n\
+ # (set to 'no' to disable)\n\
+@@ -413,7 +413,7 @@
+ # enable home .fushrc profile (yes or no)\n\
+ fu_use_homerc=yes\n\
+ \n\
+-# enable system _CONFIGDIR_/fushrc profile (yes or no)\n\
++# enable system " _CONFIGDIR_ "/fushrc profile (yes or no)\n\
+ fu_use_systemrc=yes\n\
+ \n\
+ # maximum number of backgrounded commands\n\
+@@ -448,7 +448,7 @@
+ subst_command emacs=rvim\n\
+ \n\
+ # command substitutions, by fullpath\n\
+-subst_path /bin/sh=/usr/local/bin/fush\n\
++subst_path /bin/sh=" _BINDIR_ "/fush\n\
+ \n\
+ \n\
+ # policy enforced environment variables\n\
+@@ -456,7 +456,7 @@
+ set_env DT_RUN_PATH=\n\
+ set_env DT_RPATH=\n\
+ set_env LD_LIBRARY_PATH=\n\
+-set_env SHELL=/usr/local/bin/fush\n\
++set_env SHELL=" _BINDIR_ "/fush\n\
+ set_env PAGER=more\n\
+ \n\
+ \n\
+Index: fush-0-9-0/src/fushtools.c
+===================================================================
+--- fush-0-9-0.orig/src/fushtools.c 2005-01-19 17:52:07.000000000 -0600
++++ fush-0-9-0/src/fushtools.c 2005-01-19 17:52:08.000000000 -0600
+@@ -658,7 +658,7 @@
+ fu_add_value( &g_seconf, "fu_logical_and", "yes" );
+
+ /* default for system resource script */
+- fu_add_value( &g_seconf, "fu_system_rc", "/etc/profile" );
++ fu_add_value( &g_seconf, "fu_system_rc", _CONFIGDIR_ "/profile" );
+
+ /* default for home resource script */
+ fu_add_value( &g_seconf, "fu_home_rc", ".profile" );
diff --git a/recipes/fush/fush_0.9.0.bb b/recipes/fush/fush_0.9.0.bb
new file mode 100644
index 0000000000..8f5024381c
--- /dev/null
+++ b/recipes/fush/fush_0.9.0.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "Fush is a shell replacement for security conscious admins."
+HOMEPAGE = "http://sourceforge.net/projects/foosh/"
+LICENSE = "GPL"
+DEPENDS = "readline"
+PRIORITY = "optional"
+SECTION = "base/shell"
+PR = "r3"
+
+RV = "${@bb.data.getVar('PV', d, 1).replace('.', '-')}"
+SRC_URI = "${SOURCEFORGE_MIRROR}/foosh/fush-${RV}.tar.gz \
+ file://openpty.patch;patch=1 \
+ file://install.patch;patch=1 \
+ file://paths.patch;patch=1"
+S = "${WORKDIR}/fush-${RV}"
+
+inherit autotools