From 80fd322ce11abfed5251a2b2fbedd7844fc57e80 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Thu, 12 Jun 2008 10:50:17 +0200 Subject: Add coreutils and iproute2 cross-compile aware version --- sys-apps/coreutils/Manifest | 4 + sys-apps/coreutils/coreutils-6.10-r2.ebuild | 157 +++++++++++++++++++++ .../files/cross-compile-help2man-fix.diff | 11 ++ sys-apps/iproute2/Manifest | 4 + .../files/iproute2-2.6.16.20060323-build.patch | 41 ++++++ .../iproute2-2.6.22.20070710-netem-hostcc.diff | 10 ++ sys-apps/iproute2/iproute2-2.6.22.20070710.ebuild | 100 +++++++++++++ 7 files changed, 327 insertions(+) create mode 100644 sys-apps/coreutils/Manifest create mode 100644 sys-apps/coreutils/coreutils-6.10-r2.ebuild create mode 100644 sys-apps/coreutils/files/cross-compile-help2man-fix.diff create mode 100644 sys-apps/iproute2/Manifest create mode 100644 sys-apps/iproute2/files/iproute2-2.6.16.20060323-build.patch create mode 100644 sys-apps/iproute2/files/iproute2-2.6.22.20070710-netem-hostcc.diff create mode 100644 sys-apps/iproute2/iproute2-2.6.22.20070710.ebuild (limited to 'sys-apps') diff --git a/sys-apps/coreutils/Manifest b/sys-apps/coreutils/Manifest new file mode 100644 index 00000000..dcbf6180 --- /dev/null +++ b/sys-apps/coreutils/Manifest @@ -0,0 +1,4 @@ +AUX cross-compile-help2man-fix.diff 495 RMD160 1e40c7c62b04dbf31fa02c0d75e04e02279aaae2 SHA1 bc9531705553d87a73e949a27bcdfc601114c643 SHA256 e1d18a856934db6f8b0a149e33e96d54e9e1009613b6c6ca479c2ca05cb9f2b7 +DIST coreutils-6.10-patches-1.3.tar.lzma 33326 RMD160 e3b673359e6003dbe95e3c762cba365011ae78e4 SHA1 4c004b4c2edcf0d6e7d03c404a00af8b4c06d9aa SHA256 e7d70f8e0224ede236078079fcde58e8e3047938bf95d34da1dbabc3c0225421 +DIST coreutils-6.10.tar.lzma 3746908 RMD160 7b3f7ae0f92fa3f04ab0b7fc0bbc22430a392a0b SHA1 783d425aeeb087f46a4d7d24f5a890299a09a487 SHA256 8b05bba1b2726a164e444c314e3f359604b58216be704bed8f2e028449cc6204 +EBUILD coreutils-6.10-r2.ebuild 4863 RMD160 d776282753f005dc0550fbad7c00b88a1375b5e5 SHA1 3027b97cda673487571c34a67af247ef1a8b9211 SHA256 dfc9fd68d1702e8585bde9330517d33b30efbeafe5bd737bd5c4f8ba333faffa diff --git a/sys-apps/coreutils/coreutils-6.10-r2.ebuild b/sys-apps/coreutils/coreutils-6.10-r2.ebuild new file mode 100644 index 00000000..a8d3a4f8 --- /dev/null +++ b/sys-apps/coreutils/coreutils-6.10-r2.ebuild @@ -0,0 +1,157 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/coreutils/coreutils-6.10-r2.ebuild,v 1.10 2008/04/29 16:44:55 ranger Exp $ + +inherit eutils flag-o-matic toolchain-funcs autotools + +PATCH_VER="1.3" +DESCRIPTION="Standard GNU file utilities (chmod, cp, dd, dir, ls...), text utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...)" +HOMEPAGE="http://www.gnu.org/software/coreutils/" +SRC_URI="ftp://alpha.gnu.org/gnu/coreutils/${P}.tar.lzma + mirror://gnu/${PN}/${P}.tar.lzma + mirror://gentoo/${P}.tar.lzma + mirror://gentoo/${P}-patches-${PATCH_VER}.tar.lzma + http://dev.gentoo.org/~vapier/dist/${P}-patches-${PATCH_VER}.tar.lzma" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="alpha amd64 ~arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86" +IUSE="acl nls selinux static xattr vanilla" + +RDEPEND="selinux? ( sys-libs/libselinux ) + acl? ( sys-apps/acl ) + xattr? ( sys-apps/attr ) + nls? ( >=sys-devel/gettext-0.15 ) + !=sys-libs/ncurses-5.3-r5" +DEPEND="${RDEPEND} + app-arch/lzma-utils + >=sys-devel/automake-1.10.1 + >=sys-devel/autoconf-2.61 + >=sys-devel/m4-1.4-r1" + +pkg_setup() { + # fixup expr for #123342 + if [[ $(/bin/expr a : '\(a\)') != "a" ]] ; then + if [[ -x /bin/busybox ]] ; then + ln -sf /bin/busybox /bin/expr + else + eerror "Your expr binary appears to be broken, please fix it." + eerror "For more info, see http://bugs.gentoo.org/123342" + die "your expr is broke" + fi + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + + if ! use vanilla ; then + EPATCH_SUFFIX="patch" \ + PATCHDIR="${WORKDIR}/patch" \ + EPATCH_EXCLUDE="001_all_coreutils-gen-progress-bar.patch" \ + epatch + + hasq noman ${FEATURES} && \ + epatch ${FILESDIR}/cross-compile-help2man-fix.diff + fi + + # Since we've patched many .c files, the make process will try to + # re-build the manpages by running `./bin --help`. When doing a + # cross-compile, we can't do that since 'bin' isn't a native bin. + # Also, it's not like we changed the usage on any of these things, + # so let's just update the timestamps and skip the help2man step. + touch man/*.1 + # There's no reason for this crap to use the private version + sed -i 's:__mempcpy:mempcpy:g' lib/*.c + + use vanilla || AT_M4DIR="m4" eautoreconf +} + +src_compile() { + if ! type -p cvs > /dev/null ; then + # Fix issues with gettext's autopoint if cvs is not installed, + # bug #28920. + export AUTOPOINT="/bin/true" + fi + + local myconf="" + [[ ${USERLAND} == "GNU" ]] || myconf="${myconf} --bindir=/usr/libexec/gnu" + if echo "#include " | $(tc-getCPP) > /dev/null ; then + myconf="${myconf} --without-included-regex" + fi + + # cross-compile workaround #177061 + if [[ ${CHOST} == *-linux* ]] ; then + export fu_cv_sys_stat_statvfs=yes + export gl_cv_func_wcwidth_works=yes + fi + + use static && append-ldflags -static + # kill/uptime - procps + # groups/su - shadow + # hostname - net-tools + econf \ + --enable-install-program="arch" \ + --enable-no-install-program="groups,hostname,kill,su,uptime" \ + --enable-largefile \ + $(use_enable nls) \ + $(use_enable acl) \ + $(use_enable xattr) \ + ${myconf} \ + || die "econf" + emake || die "emake" +} + +src_test() { + # Non-root tests will fail if the full path isnt + # accessible to non-root users + chmod -R go-w "${WORKDIR}" + chmod a+rx "${WORKDIR}" + addwrite /dev/full + export RUN_EXPENSIVE_TESTS="yes" + #export FETISH_GROUPS="portage wheel" + make -k check || die "make check failed" +} + +src_install() { + emake install DESTDIR="${D}" || die + rm -f "${D}"/usr/lib/charset.alias + dodoc AUTHORS ChangeLog* NEWS README* THANKS TODO + + insinto /etc + newins src/dircolors.hin DIR_COLORS || die + + # workaround bug in build system where `group` does not + # work with --enable-no-install-program configure option + hasq noman ${FEATURES} || \ + rm "${D}"/usr/bin/groups "${D}"/usr/share/man/man1/groups.1 || die + + if [[ ${USERLAND} == "GNU" ]] ; then + cd "${D}"/usr/bin + dodir /bin + # move critical binaries into /bin (required by FHS) + local fhs="cat chgrp chmod chown cp date dd df echo false ln ls + mkdir mknod mv pwd rm rmdir stty sync true uname" + mv ${fhs} ../../bin/ || die "could not move fhs bins" + # move critical binaries into /bin (common scripts) + local com="basename chroot cut dir dirname du env expr head mkfifo + mktemp readlink seq sleep sort tail touch tr tty vdir wc yes" + mv ${com} ../../bin/ || die "could not move common bins" + # create a symlink for uname in /usr/bin/ since autotools require it + local x + for x in ${com} uname ; do + dosym /bin/${x} /usr/bin/${x} || die + done + else + # For now, drop the man pages, collides with the ones of the system. + rm -rf "${D}"/usr/share/man + fi +} + +pkg_postinst() { + ewarn "Make sure you run 'hash -r' in your active shells." +} diff --git a/sys-apps/coreutils/files/cross-compile-help2man-fix.diff b/sys-apps/coreutils/files/cross-compile-help2man-fix.diff new file mode 100644 index 00000000..32261699 --- /dev/null +++ b/sys-apps/coreutils/files/cross-compile-help2man-fix.diff @@ -0,0 +1,11 @@ +--- Makefile.am.ori 2008-06-12 00:36:22.000000000 +0200 ++++ Makefile.am 2008-06-12 00:36:38.000000000 +0200 +@@ -15,7 +15,7 @@ + # You should have received a copy of the GNU General Public License + # along with this program. If not, see . + +-SUBDIRS = lib src doc man po tests gnulib-tests ++SUBDIRS = lib src doc po tests gnulib-tests + EXTRA_DIST = Makefile.cfg Makefile.maint GNUmakefile \ + .prev-version THANKS-to-translators THANKStt.in \ + .vg-suppressions \ diff --git a/sys-apps/iproute2/Manifest b/sys-apps/iproute2/Manifest new file mode 100644 index 00000000..c8b71f89 --- /dev/null +++ b/sys-apps/iproute2/Manifest @@ -0,0 +1,4 @@ +AUX iproute2-2.6.16.20060323-build.patch 938 RMD160 13cfc8c208cd07b3db06353b42e77583f1b537dc SHA1 4b29a52e5c26648e1255dc3ad5779a0fd23dfd69 SHA256 d322b077a550ce851d0056738285a50290934bfe3d2a9aaaf6ab5036de99ac63 +AUX iproute2-2.6.22.20070710-netem-hostcc.diff 296 RMD160 27dfaaca8cdd4940112bf7769fcaa8929e4a15e3 SHA1 1520d8373d007cf3c2b0865696eafcdfe5d98062 SHA256 29cdc6e9fc1890d5e94e93fced346c696ae44407a9f41b131dd9b003841cadfd +DIST iproute2-2.6.22-070710.tar.gz 410719 RMD160 b11222506531e446d1c0b2e73440fa1d98031ceb SHA1 0d0b73a36945009fa3597e929bef6e71b91cfbde SHA256 3c6b48af9e655e4f0a34c7718e288960a1dc84a3ac7eb726e855adb45fbd953a +EBUILD iproute2-2.6.22.20070710.ebuild 2759 RMD160 cad1f49b85eadb13e681218b40cfe72134cb82e6 SHA1 82b6418b5bcd9d60e13310a6d84a5abdf061ed2d SHA256 c675b4334d509dd6f85373f7253cf333cd68fc0c1264e9f3ce5d6c36125ff6cb diff --git a/sys-apps/iproute2/files/iproute2-2.6.16.20060323-build.patch b/sys-apps/iproute2/files/iproute2-2.6.16.20060323-build.patch new file mode 100644 index 00000000..7512cfcc --- /dev/null +++ b/sys-apps/iproute2/files/iproute2-2.6.16.20060323-build.patch @@ -0,0 +1,41 @@ +let portage strip the binaries + +http://bugs.gentoo.org/137574 + +--- ip/Makefile ++++ ip/Makefile +@@ -16,7 +16,7 @@ + rtmon: $(RTMONOBJ) $(LIBNETLINK) + + install: all +- install -m 0755 -s $(TARGETS) $(DESTDIR)$(SBINDIR) ++ install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR) + install -m 0755 $(SCRIPTS) $(DESTDIR)$(SBINDIR) + + clean: + +--- misc/Makefile ++++ misc/Makefile +@@ -27,7 +27,7 @@ + lnstat: $(LNSTATOBJ) + + install: all +- install -m 0755 -s $(TARGETS) $(DESTDIR)$(SBINDIR) ++ install -m 0755 $(TARGETS) $(DESTDIR)$(SBINDIR) + ln -sf lnstat $(DESTDIR)$(SBINDIR)/rtstat + ln -sf lnstat $(DESTDIR)$(SBINDIR)/ctstat + +--- tc/Makefile ++++ tc/Makefile +@@ -70,9 +70,9 @@ + + install: all + mkdir -p $(DESTDIR)/usr/lib/tc +- install -m 0755 -s tc $(DESTDIR)$(SBINDIR) ++ install -m 0755 tc $(DESTDIR)$(SBINDIR) + for i in $(TCSO); \ +- do install -m 755 -s $$i $(DESTDIR)/usr/lib/tc; \ ++ do install -m 755 $$i $(DESTDIR)/usr/lib/tc; \ + done + + clean: diff --git a/sys-apps/iproute2/files/iproute2-2.6.22.20070710-netem-hostcc.diff b/sys-apps/iproute2/files/iproute2-2.6.22.20070710-netem-hostcc.diff new file mode 100644 index 00000000..a8eb55ca --- /dev/null +++ b/sys-apps/iproute2/files/iproute2-2.6.22.20070710-netem-hostcc.diff @@ -0,0 +1,10 @@ +--- netem/Makefile.ori 2008-06-12 10:44:19.000000000 +0200 ++++ netem/Makefile 2008-06-12 10:45:07.000000000 +0200 +@@ -2,6 +2,7 @@ + DISTDATA = normal.dist pareto.dist paretonormal.dist experimental.dist + + HOSTCC ?= $(CC) ++CCOPTS = $(CBUILD_CFLAGS) + LDLIBS += -lm + + all: $(DISTGEN) $(DISTDATA) diff --git a/sys-apps/iproute2/iproute2-2.6.22.20070710.ebuild b/sys-apps/iproute2/iproute2-2.6.22.20070710.ebuild new file mode 100644 index 00000000..745daa82 --- /dev/null +++ b/sys-apps/iproute2/iproute2-2.6.22.20070710.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/iproute2-2.6.22.20070710.ebuild,v 1.10 2008/03/11 16:51:00 ricmm Exp $ + +inherit eutils toolchain-funcs + +MY_PV=${PV%.*} +SNAP=${PV##*.} +SNAP=${SNAP:2} +DESCRIPTION="kernel routing and traffic control utilities" +HOMEPAGE="http://linux-net.osdl.org/index.php/Iproute2" +SRC_URI="http://developer.osdl.org/dev/iproute2/download/${PN}-${MY_PV}-${SNAP}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86" +IUSE="atm berkdb minimal" + +RDEPEND="!minimal? ( berkdb? ( sys-libs/db ) ) + atm? ( net-dialup/linux-atm )" +DEPEND="${RDEPEND} + >=virtual/os-headers-2.4.21" + +S=${WORKDIR} + +pkg_setup() { + if use kernel_linux ; then + ewarn + ewarn "${PN} requires kernel support for Netlink (CONFIG_NETLINK)." + ewarn "This is only applies for kernels prior to 2.4.17" + ewarn + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + sed -i "s:-O2:${CFLAGS}:" Makefile || die "sed Makefile failed" + + epatch "${FILESDIR}"/${PN}-2.6.16.20060323-build.patch #137574 + epatch "${FILESDIR}"/${PN}-2.6.22.20070710-netem-hostcc.diff + + local check base=${PORTAGE_CONFIGROOT}/etc/portage/patches + for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do + EPATCH_SOURCE=${base}/${CTARGET}/${check} + [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${CHOST}/${check} + [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${check} + if [[ -d ${EPATCH_SOURCE} ]] ; then + EPATCH_SUFFIX="patch" + EPATCH_FORCE="yes" \ + EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \ + epatch + break + fi + done + + # don't build arpd if USE=-berkdb #81660 + use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile + # Multilib fixes + sed -i 's:/usr/local:/usr:' tc/m_ipt.c include/iptables.h + sed -i "s:/usr/lib:/usr/$(get_libdir):g" \ + netem/Makefile tc/{Makefile,tc.c,q_netem.c,m_ipt.c} include/iptables.h || die + # Use correct iptables dir, #144265. + sed -i "s:/usr/local/lib/iptables:/$(get_libdir)/iptables:g" \ + include/iptables.h +} + +src_compile() { + echo -n 'TC_CONFIG_ATM:=' > Config + use atm \ + && echo 'y' >> Config \ + || echo 'n' >> Config + + use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc:' Makefile + emake \ + CC="$(tc-getCC)" \ + AR="$(tc-getAR)" \ + || die "make" +} + +src_install() { + if use minimal ; then + into / + dosbin tc/tc || die "minimal" + return 0 + fi + + emake \ + DESTDIR="${D}" \ + SBINDIR=/sbin \ + DOCDIR=/usr/share/doc/${PF} \ + install \ + || die "make install failed" + if use berkdb ; then + dodir /var/lib/arpd + # bug 47482, arpd doesn't need to be in /sbin + dodir /usr/sbin + mv "${D}"/sbin/arpd "${D}"/usr/sbin/ + fi +} -- cgit v1.2.3