diff options
author | Joachim Blaabjerg <styx@gentoo.org> | 2002-08-24 22:18:57 +0000 |
---|---|---|
committer | Joachim Blaabjerg <styx@gentoo.org> | 2002-08-24 22:18:57 +0000 |
commit | 22875d8958bf0616fac63cdfee033ce764dfbdb5 (patch) | |
tree | 501f394b83c6ade2dfdc608015b253d4937fe43c /sys-apps/sh-utils | |
parent | Masking sh-utils-2.0.15 (diff) | |
download | historical-22875d8958bf0616fac63cdfee033ce764dfbdb5.tar.gz historical-22875d8958bf0616fac63cdfee033ce764dfbdb5.tar.bz2 historical-22875d8958bf0616fac63cdfee033ce764dfbdb5.zip |
New sh-utils-2.0.15 ebuild, with a new uname.c patch. Looks like it works, masked for testing.
Diffstat (limited to 'sys-apps/sh-utils')
-rw-r--r-- | sys-apps/sh-utils/ChangeLog | 9 | ||||
-rw-r--r-- | sys-apps/sh-utils/files/digest-sh-utils-2.0.15 | 1 | ||||
-rw-r--r-- | sys-apps/sh-utils/files/sh-utils-2.0.15-gentoo.diff | 104 | ||||
-rw-r--r-- | sys-apps/sh-utils/sh-utils-2.0.15.ebuild | 82 |
4 files changed, 195 insertions, 1 deletions
diff --git a/sys-apps/sh-utils/ChangeLog b/sys-apps/sh-utils/ChangeLog index c99e830ac643..d9098ab63d2e 100644 --- a/sys-apps/sh-utils/ChangeLog +++ b/sys-apps/sh-utils/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-apps/sh-utils # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL -# $Header: /var/cvsroot/gentoo-x86/sys-apps/sh-utils/ChangeLog,v 1.9 2002/08/14 14:16:49 seemant Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/sh-utils/ChangeLog,v 1.10 2002/08/24 22:18:57 styx Exp $ + +*sh-utils-2.0.15 (24 Aug 2002) + + 24 Aug 2002; Joachim Blaabjerg <styx@gentoo.org> sh-utils-2.0.15.ebuild : + + Version bump, finally wrote a new uname.c patch. Even looks like it works. + Fixes bug #6579, masked for testing. *sh-utils-2.0.14 (14 Aug 2002) diff --git a/sys-apps/sh-utils/files/digest-sh-utils-2.0.15 b/sys-apps/sh-utils/files/digest-sh-utils-2.0.15 new file mode 100644 index 000000000000..4e6b8baca8eb --- /dev/null +++ b/sys-apps/sh-utils/files/digest-sh-utils-2.0.15 @@ -0,0 +1 @@ +MD5 037d0a329a943d110dcc4028ab6d5667 sh-utils-2.0.15.tar.gz 2136810 diff --git a/sys-apps/sh-utils/files/sh-utils-2.0.15-gentoo.diff b/sys-apps/sh-utils/files/sh-utils-2.0.15-gentoo.diff new file mode 100644 index 000000000000..dfc8cf067342 --- /dev/null +++ b/sys-apps/sh-utils/files/sh-utils-2.0.15-gentoo.diff @@ -0,0 +1,104 @@ +diff -Naurb sh-utils-2.0.15/src/uname.c sh-utils-2.0.15-fixed/src/uname.c +--- sh-utils-2.0.15/src/uname.c Thu Jul 18 20:32:33 2002 ++++ sh-utils-2.0.15-fixed/src/uname.c Sat Aug 24 18:47:00 2002 +@@ -81,6 +81,9 @@ + /* The name this program was run with, for error messages. */ + char *program_name; + ++/* Prototype for __sysinfo_processor_type */ ++void __sysinfo_processor_type (char *proc_info); ++ + static struct option const long_options[] = + { + {"all", no_argument, NULL, 'a'}, +@@ -120,7 +123,6 @@ + -v, --kernel-version print the kernel version\n\ + -m, --machine print the machine hardware name\n\ + -p, --processor print the processor type\n\ +- -i, --hardware-platform print the hardware platform\n\ + -o, --operating-system print the operating system\n\ + "), stdout); + fputs (HELP_OPTION_DESCRIPTION, stdout); +@@ -193,10 +195,6 @@ + toprint |= PRINT_PROCESSOR; + break; + +- case 'i': +- toprint |= PRINT_HARDWARE_PLATFORM; +- break; +- + case 'o': + toprint |= PRINT_OPERATING_SYSTEM; + break; +@@ -240,15 +238,13 @@ + if (toprint & PRINT_PROCESSOR) + { + char const *element = unknown; +-#if HAVE_SYSINFO && defined SI_ARCHITECTURE + { +- static char processor[257]; +- if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor)) ++ static char processor[BUFSIZ]; ++ __sysinfo_processor_type(processor); + element = processor; + } +-#endif + #ifdef UNAME_PROCESSOR +- if (element == unknown) ++ if (element == "unknown") + { + static char processor[257]; + size_t s = sizeof processor; +@@ -260,30 +256,6 @@ + print_element (element); + } + +- if (toprint & PRINT_HARDWARE_PLATFORM) +- { +- char const *element = unknown; +-#if HAVE_SYSINFO && defined SI_PLATFORM +- { +- static char hardware_platform[257]; +- if (0 <= sysinfo (SI_PLATFORM, +- hardware_platform, sizeof hardware_platform)) +- element = hardware_platform; +- } +-#endif +-#ifdef UNAME_HARDWARE_PLATFORM +- if (element == unknown) +- { +- static char hardware_platform[257]; +- size_t s = sizeof hardware_platform; +- static int mib[] = { CTL_HW, UNAME_HARDWARE_PLATFORM }; +- if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0) +- element = hardware_platform; +- } +-#endif +- print_element (element); +- } +- + if (toprint & PRINT_OPERATING_SYSTEM) + print_element (HOST_OPERATING_SYSTEM); + +@@ -291,3 +263,21 @@ + + exit (0); + } ++ ++/* Originally written by Carlos Gorges, ported to 2.0.15 by <styx@gentoo.org> ++ * Return return vendor_id from proc cpuinfo */ ++void __sysinfo_processor_type (char *proc_info) { ++ FILE *ffd; ++ char temp_string[BUFSIZ], final_string[BUFSIZ] = "unknown"; ++ ++ if((ffd=fopen("/proc/cpuinfo", "r")) != NULL) { ++ while(fscanf(ffd, "%s :", temp_string) != EOF) ++ if((!(strcmp(temp_string, "vendor_id"))) || ++ (!(strcmp(temp_string, "machine" )))) { ++ fscanf(ffd, "%s", final_string); ++ break; ++ } ++ fclose(ffd); ++ } ++ strncpy(proc_info, final_string, BUFSIZ); ++} diff --git a/sys-apps/sh-utils/sh-utils-2.0.15.ebuild b/sys-apps/sh-utils/sh-utils-2.0.15.ebuild new file mode 100644 index 000000000000..8b8d20969518 --- /dev/null +++ b/sys-apps/sh-utils/sh-utils-2.0.15.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/sys-apps/sh-utils/sh-utils-2.0.15.ebuild,v 1.1 2002/08/24 22:18:57 styx Exp $ + +S=${WORKDIR}/${P} +DESCRIPTION="Your standard GNU shell utilities" +SRC_URI="ftp://alpha.gnu.org/gnu/fetish/${P}.tar.gz" +HOMEPAGE="http://www.gnu.org/software/shellutils/shellutils.html" + +DEPEND="nls? ( sys-devel/gettext )" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="x86 ppc sparc sparc64" + +src_unpack() { + unpack ${P}.tar.gz + cd ${S} + + # patch to remove Stallman's su/wheel group rant and to add processor + # information in uname output + patch -p1 < ${FILESDIR}/${P}-gentoo.diff || die + #rm doc/coreutils.info + #This next line prevents our patched (and updated-mtime) uname.c from forcing a + #uname.1 man page regeneration, which requires perl (not available when creating + #a new build image... and we don't want this package dependent on perl anyway. + #This problem can be fixed by fixing our patch at a future date. + touch -d "20 Aug 1999" src/uname.c +} + +src_compile() { + local myconf="" + use nls || myconf="--disable-nls" + + CFLAGS="${CFLAGS}" \ + econf \ + --without-included-regex \ + ${myconf} || die + + if [ -z "`use static`" ] + then + emake || die + else + emake LDFLAGS=-static || die + fi +} + +src_install() { + einstall || die + + rm -rf ${D}/usr/lib + dodir /bin + cd ${D}/usr/bin + mv date echo false pwd stty su true uname sleep ${D}/bin + + if [ -z "`use build`" ] + then + cd ${S} + dodoc AUTHORS COPYING ChangeLog ChangeLog.0 NEWS README THANKS TODO + else + rm -rf ${D}/usr/share + fi + #we must use hostname from net-base + #hostname do not work with the -f switch ... this breaks gnome2 among things + rm ${D}/usr/bin/hostname + #we use the /bin/su from the sys-apps/shadow package + rm ${D}/bin/su + rm ${D}/usr/share/man/man1/su.1.gz + #we use the /usr/bin/uptime from the sys-apps/procps package + rm ${D}/usr/bin/uptime + rm ${D}/usr/share/man/man1/uptime.1.gz +} + +pkg_postinst() { + #hostname do not get removed, as it is included with older stage1 + #tarballs, and net-tools installs to /bin + if [ -e ${ROOT}/usr/bin/hostname ] && [ ! -L ${ROOT}/usr/bin/hostname ] + then + rm -f ${ROOT}/usr/bin/hostname + fi +} + |