diff options
author | Michael Haubenwallner <haubi@gentoo.org> | 2011-03-30 11:34:45 +0000 |
---|---|---|
committer | Michael Haubenwallner <haubi@gentoo.org> | 2011-03-30 11:34:45 +0000 |
commit | 5a469135aa38fbbc86e84af000580168dd9efaf8 (patch) | |
tree | bcf36a10a2b672228542bb946e8d529a26045ec2 /sys-apps/baselayout-prefix | |
parent | added ~arm (bug 302981) (diff) | |
download | gentoo-2-5a469135aa38fbbc86e84af000580168dd9efaf8.tar.gz gentoo-2-5a469135aa38fbbc86e84af000580168dd9efaf8.tar.bz2 gentoo-2-5a469135aa38fbbc86e84af000580168dd9efaf8.zip |
baselayout-prefix-1.12.5: Split strsep out of solaris patch and use it in r9 only.
In r10, use private gnulib instance, as it might be missing during bootstrap.
Also need to include config.h to redefine 'restrict'.
(Portage version: 2.2.01.18125-prefix/cvs/AIX 00C0078A4C00)
Diffstat (limited to 'sys-apps/baselayout-prefix')
6 files changed, 290 insertions, 44 deletions
diff --git a/sys-apps/baselayout-prefix/ChangeLog b/sys-apps/baselayout-prefix/ChangeLog index 6babe3061204..0aebc5f0cc2d 100644 --- a/sys-apps/baselayout-prefix/ChangeLog +++ b/sys-apps/baselayout-prefix/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for sys-apps/baselayout-prefix # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout-prefix/ChangeLog,v 1.6 2011/03/29 15:34:22 haubi Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout-prefix/ChangeLog,v 1.7 2011/03/30 11:34:45 haubi Exp $ + +*baselayout-prefix-1.12.5-r10 (30 Mar 2011) + + 30 Mar 2011; Salomon tbox <tbox@gentoo.org> + baselayout-prefix-1.12.5-r9.ebuild, +baselayout-prefix-1.12.5-r10.ebuild, + +files/baselayout-1.12.5-libsvar.patch, + files/baselayout-1.12.5-solaris.patch, +files/baselayout-1.12.5-strsep.patch: + Split strsep out of solaris patch and use it in r9 only. + In r10, use private gnulib instance, as it might be missing during bootstrap. + Also need to include config.h to redefine 'restrict'. 29 Mar 2011; Michael Haubenwallner <haubi@gentoo.org> files/baselayout-1.12.5-aix.patch: diff --git a/sys-apps/baselayout-prefix/baselayout-prefix-1.12.5-r10.ebuild b/sys-apps/baselayout-prefix/baselayout-prefix-1.12.5-r10.ebuild new file mode 100644 index 000000000000..e9ada9ae648f --- /dev/null +++ b/sys-apps/baselayout-prefix/baselayout-prefix-1.12.5-r10.ebuild @@ -0,0 +1,216 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout-prefix/baselayout-prefix-1.12.5-r10.ebuild,v 1.1 2011/03/30 11:34:45 haubi Exp $ + +EAPI=3 + +inherit eutils toolchain-funcs multilib prefix flag-o-matic autotools + +# Needed gnulib modules: +# getopt: for AIX +# strsep: for Solaris +# Avoid depending on dev-libs/gnulib, might be missing during bootstrap. +# The gnulib tarball has been created using these commands (basically): +# $ gnulib-tool --create-testdir --dir=gnulib getopt strsep +# $ eautoreconf +# $ econf +# $ make maintainer-clean +GNULIBV=1 + +DESCRIPTION="Minimal baselayout for Gentoo Prefix installs" +HOMEPAGE="http://www.gentoo.org/" +SRC_URI=" + http://dev.gentoo.org/~grobian/distfiles/${P/-prefix/}.tar.bz2 + http://dev.gentoo.org/~haubi/distfiles/${P/-prefix/}-gnulib-${GNULIBV}.tar.bz2 +" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt" +IUSE="prefix-chaining" +DEPEND=">=sys-apps/portage-2.2.01" +RDEPEND=">=sys-libs/readline-5.0-r1 + >=app-shells/bash-3.1_p7 + >=sys-apps/coreutils-5.2.1 + kernel_Darwin? ( sys-process/pidof-bsd ) + kernel_FreeBSD? ( sys-process/pidof-bsd )" + +S=${WORKDIR}/${P/-prefix} + +src_prepare() { + epatch "${FILESDIR}"/${P/-prefix/}-prefix.patch + + if use prefix-chaining; then + epatch "${FILESDIR}"/${P/-prefix/}-prefix-chaining.patch + epatch "${FILESDIR}"/${P/-prefix/}-prefix-chaining-pkgconfig.patch + epatch "${FILESDIR}"/${P/-prefix/}-prefix-chaining-recursion.patch + epatch "${FILESDIR}"/${P/-prefix/}-prefix-chaining-eprefix.patch + epatch "${FILESDIR}"/${P/-prefix/}-prefix-chaining-prompt.patch + epatch "${FILESDIR}"/${P/-prefix/}-prefix-chaining-bash.patch + + # need to set the PKG_CONFIG_PATH globally for this prefix, when + # chaining is enabled, since pkg-config may not be installed locally, + # but still .pc files should be found for all RDEPENDable prefixes in + # the chain. + echo "PKG_CONFIG_PATH=\"${EPREFIX}/usr/lib/pkgconfig:${EPREFIX}/usr/share/pkgconfig\"" >> "${S}"/etc/env.d/00basic + fi + + epatch "${FILESDIR}"/${P/-prefix/}-prefix-src.patch + epatch "${FILESDIR}"/${P/-prefix/}-prefix-sh.patch + # Next patch is to be applied on systems that don't have a pidof. + epatch "${FILESDIR}"/${P/-prefix/}-prefix-pidof.patch + + epatch "${FILESDIR}"/${P/-prefix/}-termios_h.patch # required by aix.patch + epatch "${FILESDIR}"/${P/-prefix/}-aix.patch + epatch "${FILESDIR}"/${P/-prefix/}-darwin-kvm.patch + epatch "${FILESDIR}"/${P/-prefix/}-solaris.patch + epatch "${FILESDIR}"/${P/-prefix/}-libsvar.patch + + # The consoletype application in this form will only work on Linux + [[ ${CHOST} == *-linux-* ]] || epatch "${FILESDIR}"/${P/-prefix/}-prefix-no-consoletype.patch + + cd "${S}" + eprefixify \ + etc/env.d/00basic \ + etc/profile \ + sbin/env-update.sh \ + sbin/functions.sh \ + sbin/runscript.sh \ + src/runscript.c \ + sbin/depscan.sh \ + sbin/rc-daemon.sh \ + sbin/rc-services.sh + # add the host OS MANPATH + echo 'MANPATH="/usr/share/man"' > etc/env.d/99basic || die "can't make file" + + # need to include gnulib's <config.h> first + sed -i -e '1i#include <config.h>' $(find . -name '*.c') || die "Cannot utilize gnulib" + + # prepare gnulib + cd "${WORKDIR}"/gnulib || die + eautoreconf +} + +src_configure() { + cd "${WORKDIR}"/gnulib || die + default +} + +src_compile() { + # build gnulib first + cd "${WORKDIR}"/gnulib || die + emake || die "Cannot build gnulib" + cd "${S}" + + # use gnulib + append-flags -I"${WORKDIR}"/gnulib -I"${WORKDIR}"/gnulib/gllib + append-ldflags -L"${WORKDIR}"/gnulib/gllib + append-libs gnu + + local libdir="lib" + + [[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}") + + make -C "${S}"/src \ + CC="$(tc-getCC)" \ + LD="$(tc-getCC) ${LDFLAGS}" \ + CFLAGS="${CFLAGS}" \ + LIBDIR="${libdir}" || die +} + +src_install() { + local dir libdirs libdirs_env rcscripts_dir + + dodir /etc + dodir /etc/env.d + dodir /etc/init.d # .keep file might mess up init.d stuff + + libdirs=$(get_all_libdirs) + : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass... + + rcscripts_dir="/lib/rcscripts" + + for dir in ${libdirs}; do + libdirs_env=${libdirs_env:+$libdirs_env:}/${dir}:/usr/${dir}:/usr/local/${dir} + [[ ${dir} == "lib" && ${SYMLINK_LIB} == "yes" ]] && continue + dodir /"${dir}" + dodir /usr/"${dir}" + dodir /usr/local/"${dir}" + done + + # Ugly compatibility with stupid ebuilds and old profiles symlinks + if [[ ${SYMLINK_LIB} == "yes" ]] ; then + rm -r "${ED}"/{lib,usr/lib,usr/local/lib} &> /dev/null + dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /lib + dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/lib + dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/local/lib + fi + + # FHS compatibility symlinks stuff + dosym /var/tmp /usr/tmp + + # rc-scripts version for testing of features that *should* be present + echo "Gentoo Prefix Base System version ${PV}" > ${ED}/etc/gentoo-release + + # get the basic stuff in there + doenvd "${S}"/etc/env.d/* || die "doenvd" + + # copy the profile + cp "${S}"/etc/profile "${ED}"/etc/profile + + # Setup files in /sbin + # + cd "${S}"/sbin + into / + # These moved from /etc/init.d/ to /sbin to help newb systems + # from breaking + dosbin runscript.sh functions.sh + + # Compat symlinks between /etc/init.d and /sbin + # (some stuff have hardcoded paths) + dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh + dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh + dosym ../../sbin/functions.sh /etc/init.d/functions.sh + + cd "${S}"/sbin + into / + dosbin depscan.sh + dosbin env-update.sh + insinto ${rcscripts_dir}/awk + doins "${S}"/src/awk/functions.awk + + # + # Install baselayout utilities + # + local libdir="lib" + [[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}") + + cd "${S}"/src + make DESTDIR="${ED}" LIBDIR="${libdir}" install || die + + insinto ${rcscripts_dir}/sh + doins "${S}"/sbin/rc-* +} + +pkg_postinst() { + if [[ ${EUID} == 0 ]] ; then + # setup portage user, such that things that require root privs + # don't fail, bug #321623 + enewgroup portage 250 + enewuser portage 250 -1 "${EPREFIX}"/var/tmp/portage portage + fi + + # This is also written in src_install (so it's in CONTENTS), but + # write it here so that the new version is immediately in the file + # (without waiting for the user to do etc-update) + rm -f "${EROOT}"/etc/._cfg????_gentoo-release + echo "Gentoo Prefix Base System version ${PV}" > "${EROOT}"/etc/gentoo-release + + echo + einfo "Please be sure to update all pending '._cfg*' files in /etc," + einfo "else things might break! You can use 'etc-update'" + einfo "to accomplish this:" + einfo + einfo " # etc-update" + echo +} diff --git a/sys-apps/baselayout-prefix/baselayout-prefix-1.12.5-r9.ebuild b/sys-apps/baselayout-prefix/baselayout-prefix-1.12.5-r9.ebuild index 2b65bac48025..3c7ab0c173d4 100644 --- a/sys-apps/baselayout-prefix/baselayout-prefix-1.12.5-r9.ebuild +++ b/sys-apps/baselayout-prefix/baselayout-prefix-1.12.5-r9.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout-prefix/baselayout-prefix-1.12.5-r9.ebuild,v 1.6 2011/03/28 15:38:17 grobian Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout-prefix/baselayout-prefix-1.12.5-r9.ebuild,v 1.7 2011/03/30 11:34:45 haubi Exp $ EAPI=3 @@ -51,6 +51,7 @@ src_prepare() { epatch "${FILESDIR}"/${P/-prefix/}-aix.patch epatch "${FILESDIR}"/${P/-prefix/}-darwin-kvm.patch epatch "${FILESDIR}"/${P/-prefix/}-solaris.patch + epatch "${FILESDIR}"/${P/-prefix/}-strsep.patch # for solaris # The consoletype application in this form will only work on Linux [[ ${CHOST} == *-linux-* ]] || epatch "${FILESDIR}"/${P/-prefix/}-prefix-no-consoletype.patch diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-libsvar.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-libsvar.patch new file mode 100644 index 000000000000..22a3624ae5f6 --- /dev/null +++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-libsvar.patch @@ -0,0 +1,19 @@ +Need to add libraries after object files, or solaris +linker might not see library's symbols to be needed +when added to LDFLAGS. + +--- src/Makefile.orig 2011-03-30 13:15:56 +0200 ++++ src/Makefile 2011-03-30 13:16:52 +0200 +@@ -30,10 +30,10 @@ + $(CC) $(CFLAGS) -c -o $@ $^ + + runscript: runscript.o rs-misc.o +- $(LD) $(LDFLAGS) -o $@ $^ $(LDFLAGS_RS) ++ $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS_RS) + + start-stop-daemon: start-stop-daemon.c +- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDFLAGS_SSD) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS_SSD) + + install: $(TARGET) + install -m 0755 -d $(DESTDIR)/bin diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-solaris.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-solaris.patch index c3ee513f90be..20e45827acdd 100644 --- a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-solaris.patch +++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-solaris.patch @@ -64,45 +64,3 @@ static void ---- src/core/misc.h -+++ src/core/misc.h -@@ -284,5 +284,9 @@ - void file_unmap(char *buf, size_t bufsize); - size_t buf_get_line(char *buf, size_t buflen, size_t cur); - -+#if defined (__SVR4) && defined (__sun) -+char* strsep(char** str, const char* delims); -+#endif -+ - #endif /* _MISC_H */ - ---- src/core/misc.c -+++ src/core/misc.c -@@ -647,3 +647,27 @@ - return count - cur; - } - -+#if defined (__SVR4) && defined (__sun) -+char* strsep(char** str, const char* delims) -+{ -+ char* token; -+ -+ if (*str == NULL) { -+ /* No more tokens */ -+ return NULL; -+ } -+ -+ token=*str; -+ while (**str != '\0') { -+ if (strchr(delims, **str) != NULL) { -+ **str = '\0'; -+ (*str)++; -+ return token; -+ } -+ (*str)++; -+ } -+ /* There is no other token */ -+ *str = NULL; -+ return token; -+} -+#endif diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-strsep.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-strsep.patch new file mode 100644 index 000000000000..3e67a226c77c --- /dev/null +++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-strsep.patch @@ -0,0 +1,42 @@ +--- src/core/misc.h ++++ src/core/misc.h +@@ -284,5 +284,9 @@ + void file_unmap(char *buf, size_t bufsize); + size_t buf_get_line(char *buf, size_t buflen, size_t cur); + ++#if defined (__SVR4) && defined (__sun) ++char* strsep(char** str, const char* delims); ++#endif ++ + #endif /* _MISC_H */ + +--- src/core/misc.c ++++ src/core/misc.c +@@ -647,3 +647,27 @@ + return count - cur; + } + ++#if defined (__SVR4) && defined (__sun) ++char* strsep(char** str, const char* delims) ++{ ++ char* token; ++ ++ if (*str == NULL) { ++ /* No more tokens */ ++ return NULL; ++ } ++ ++ token=*str; ++ while (**str != '\0') { ++ if (strchr(delims, **str) != NULL) { ++ **str = '\0'; ++ (*str)++; ++ return token; ++ } ++ (*str)++; ++ } ++ /* There is no other token */ ++ *str = NULL; ++ return token; ++} ++#endif |