[tyndur-devel] [PATCH] + which: Neuer lbuild
Arne Hasselbring ·
Signed-off-by: Arne Hasselbring <arne.hasselbring at googlemail.com> --- lbuilds/which/2.20/files/compile.patch | 34 +++++++++++++++++++++ lbuilds/which/2.20/files/run.patch | 23 ++++++++++++++ lbuilds/which/2.20/which-2.20.lbuild | 50 ++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+), 0 deletions(-) create mode 100644 lbuilds/which/2.20/files/compile.patch create mode 100644 lbuilds/which/2.20/files/run.patch create mode 100644 lbuilds/which/2.20/which-2.20.lbuild diff --git a/lbuilds/which/2.20/files/compile.patch b/lbuilds/which/2.20/files/compile.patch new file mode 100644 index 0000000..781cbe4 --- /dev/null +++ b/lbuilds/which/2.20/files/compile.patch @@ -0,0 +1,34 @@ +Index: which-2.20/bash.c +=================================================================== +--- which-2.20.orig/bash.c ++++ which-2.20/bash.c +@@ -34,1 +34,0 @@ */ +-#define HAVE_GETGROUPS +@@ -426,23 +426,4 @@ { +- struct passwd *entry; +- +- /* Don't fetch this more than once. */ +- if (current_user.user_name == 0) +- { +- entry = getpwuid (current_user.uid); +- if (entry) +- { +- current_user.user_name = savestring (entry->pw_name); +- current_user.shell = (entry->pw_shell && entry->pw_shell[0]) +- ? savestring (entry->pw_shell) +- : savestring ("/bin/sh"); +- current_user.home_dir = savestring (entry->pw_dir); +- } +- else +- { +- current_user.user_name = "I have no name!"; +- current_user.user_name = savestring (current_user.user_name); +- current_user.shell = savestring ("/bin/sh"); +- current_user.home_dir = savestring ("/"); +- } +- endpwent (); +- } ++ current_user.user_name = "Tyndur user"; ++ current_user.user_name = savestring (current_user.user_name); ++ current_user.shell = savestring ("file:/apps/sh"); ++ current_user.home_dir = savestring ("file:/"); diff --git a/lbuilds/which/2.20/files/run.patch b/lbuilds/which/2.20/files/run.patch new file mode 100644 index 0000000..c858b38 --- /dev/null +++ b/lbuilds/which/2.20/files/run.patch @@ -0,0 +1,23 @@ +Index: which-2.20/bash.c +=================================================================== +--- which-2.20.orig/bash.c ++++ which-2.20/bash.c +@@ -359,1 +359,1 @@ string is returned in that case. */ +- if (i && string[i] == ':') ++ if (i && string[i] == ';') +@@ -362,1 +362,1 @@ +- for (start = i; string[i] && string[i] != ':'; i++) ++ for (start = i; string[i] && string[i] != ';'; i++) +Index: which-2.20/which.c +=================================================================== +--- which-2.20.orig/which.c ++++ which-2.20/which.c +@@ -174,1 +174,1 @@ { +- const char *pwd = getenv("PWD"); ++ const char *pwd = getenv("CWD"); +@@ -179,1 +179,1 @@ +- if (*cwd != '/') ++ if (*cwd != '/' && strncmp(cwd, "file:/", 6)) +@@ -203,1 +203,1 @@ +- if (*p1 != '/') ++ if (*p1 != '/' && strncmp(p1, "file:/", 6)) diff --git a/lbuilds/which/2.20/which-2.20.lbuild b/lbuilds/which/2.20/which-2.20.lbuild new file mode 100644 index 0000000..6190239 --- /dev/null +++ b/lbuilds/which/2.20/which-2.20.lbuild @@ -0,0 +1,50 @@ +include lutils +include toolchain + +DESCRIPTION="" +HOMEPAGE="http://lowlevel.brainsware.org/wiki/index.php/LOST/Pakete/Bash" +SRC_URI="http://ftp.gnu.org/gnu/which/which-2.20.tar.gz" + +LICENSE="GPL" + +RUN_DEPEND="" +BUILD_DEPEND="" + +MY_S="${S}/${P}" + +src_unpack() { + lunpack ${P}.tar.gz + cd ${MY_S} + + ln -s ${F} patches + [ -f ${F}/series ] && ln -s ${F}/series series + for i in ${F}/*.patch; do + [ -L series ] || echo `basename $i` >> series + (which quilt > /dev/null 2>&1) || (patch -p1 < $i) || die "Fehler beim Anwenden von $i" + done + (which quilt > /dev/null 2>&1) && quilt push -a || die "Fehler beim Anwenden der Patches" +} + +src_configure() { + cd ${MY_S} + + ./configure \ + CC=`tc-cc` \ + --build=`tc-build` \ + --target=`tc-host` \ + --host=`tc-host` \ + --prefix="${R}" \ + --disable-nls \ + || die "configure failed" +} + +src_compile() { + cd ${MY_S} + lmake +} + +src_install() { + cd ${MY_S} + lmake -j1 DESTDIR="${D}" install || die "make install failed" +} + -- 1.7.1