aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-02-03 19:51:01 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-02-03 19:51:01 +0000
commitbabd741f7dc661275c71f6ea096f29eabfe283c2 (patch)
tree462c3b444132f163b2292fae7876a9fd561a922f
parent600a2ca4c7138d71f53f40225eea0dcbcd8259ba (diff)
downloadpaludis-babd741f7dc661275c71f6ea096f29eabfe283c2.tar.gz
paludis-babd741f7dc661275c71f6ea096f29eabfe283c2.tar.xz
For exheres, econf is only allowed in src_configure and einstall is only allowed in src_install
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc9
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh21
-rw-r--r--paludis/repositories/e/ebuild/0/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/0/build_functions.bash (renamed from paludis/repositories/e/ebuild/build_functions.bash)0
-rw-r--r--paludis/repositories/e/ebuild/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/build_functions.bash113
7 files changed, 145 insertions, 1 deletions
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index b2fa983..5b213be 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1344,6 +1344,15 @@ namespace test_cases
TEST_CHECK_EQUAL(id->short_description_key()->value(), "The Description");
id->perform_action(action);
}
+
+ {
+ TestMessageSuffix suffix("econf phase", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/econf-phase-0",
+ UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ }
}
} test_e_repository_install_exheres_0;
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index e8cbbd7..859c9e3 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -894,6 +894,27 @@ pkg_setup() {
ever at_least 1.4 1.2 && die "at_least 1.4 1.2"
}
END
+mkdir -p "packages/cat/econf-phase"
+cat <<'END' > packages/cat/econf-phase/econf-phase-0.ebuild || exit 1
+DESCRIPTION="The Description"
+
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENSE="GPL-2"
+PLATFORM="test"
+
+src_unpack() {
+ mkdir ${S}
+ echo "#!/bin/bash" > ${S}/configure
+ chmod +x ${S}/configure
+}
+
+src_compile() {
+ econf
+}
+END
cd ..
mkdir -p repo15/{eclass,distfiles,profiles/profile/subprofile} || exit 1
diff --git a/paludis/repositories/e/ebuild/0/Makefile.am b/paludis/repositories/e/ebuild/0/Makefile.am
index 813c1eb..2af4448 100644
--- a/paludis/repositories/e/ebuild/0/Makefile.am
+++ b/paludis/repositories/e/ebuild/0/Makefile.am
@@ -5,6 +5,7 @@ SUBDIRS = .
libexecprog0dir = $(libexecdir)/paludis/0/
libexecprog0_SCRIPTS = \
+ build_functions.bash \
builtin_infovars.bash \
builtin_init.bash \
builtin_loadenv.bash \
diff --git a/paludis/repositories/e/ebuild/build_functions.bash b/paludis/repositories/e/ebuild/0/build_functions.bash
index 0a71e89..0a71e89 100644
--- a/paludis/repositories/e/ebuild/build_functions.bash
+++ b/paludis/repositories/e/ebuild/0/build_functions.bash
diff --git a/paludis/repositories/e/ebuild/Makefile.am b/paludis/repositories/e/ebuild/Makefile.am
index 8e54a37..21b6f70 100644
--- a/paludis/repositories/e/ebuild/Makefile.am
+++ b/paludis/repositories/e/ebuild/Makefile.am
@@ -8,7 +8,6 @@ libexecprogdir = $(libexecdir)/paludis/
libexecprog_SCRIPTS = \
binary_functions.bash \
- build_functions.bash \
die_functions.bash \
ebuild.bash \
kernel_functions.bash \
diff --git a/paludis/repositories/e/ebuild/exheres-0/Makefile.am b/paludis/repositories/e/ebuild/exheres-0/Makefile.am
index e917114..9cccca8 100644
--- a/paludis/repositories/e/ebuild/exheres-0/Makefile.am
+++ b/paludis/repositories/e/ebuild/exheres-0/Makefile.am
@@ -5,6 +5,7 @@ SUBDIRS = .
libexecprogexheresdir = $(libexecdir)/paludis/exheres-0
libexecprogexheres_SCRIPTS = \
+ build_functions.bash \
builtin_infovars.bash \
builtin_init.bash \
builtin_loadenv.bash \
diff --git a/paludis/repositories/e/ebuild/exheres-0/build_functions.bash b/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
new file mode 100644
index 0000000..83da971
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
@@ -0,0 +1,113 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License, version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+econf()
+{
+ if [[ "${EBUILD_PHASE}" != "configure" ]] ; then
+ die "econf called in EBUILD_PHASE ${EBUILD_PHASE}"
+ fi
+
+ local LOCAL_EXTRA_ECONF="${EXTRA_ECONF}"
+ local LOCAL_ECONF_WRAPPER="${ECONF_WRAPPER}"
+
+ [[ -z "${ECONF_SOURCE}" ]] && ECONF_SOURCE=.
+
+ if [[ -x "${ECONF_SOURCE}/configure" ]] ; then
+ if [[ -d /usr/share/gnuconfig ]] ; then
+ local f
+ find "${WORKDIR}" -type f -name config.guess -or -name config.sub | while read f; do
+ echo "econf: updating ${f} with /usr/share/gnuconfig/${f##*/}"
+ cp -f "/usr/share/gnuconfig/${f##*/}" "${f}"
+ done
+ fi
+
+ [[ -z "${CBUILD}" ]] || LOCAL_EXTRA_ECONF="--build=${CBUILD} ${LOCAL_EXTRA_ECONF}"
+ [[ -z "${CTARGET}" ]] || LOCAL_EXTRA_ECONF="--target=${CTARGET} ${LOCAL_EXTRA_ECONF}"
+
+ # If the ebuild passed in --prefix, use that to set --libdir. KDE at least needs this.
+
+ ECONF_PREFIX=/usr
+ for i in "$@"; do
+ if [[ ${i} == --prefix=* ]]; then
+ ECONF_PREFIX=${i#--prefix=}
+ elif [[ ${i} == --exec-prefix=* ]]; then
+ ECONF_PREFIX=${i#--exec-prefix=}
+ fi
+ done
+
+ local libcmd=
+ if [[ -n "${ABI}" ]] ; then
+ local v="LIBDIR_${ABI}"
+ if [[ -n "${!v}" ]] ; then
+ libcmd="--libdir=${ECONF_PREFIX}/$(ebuild_get_libdir)"
+ fi
+ fi
+
+ echo ${LOCAL_ECONF_WRAPPER} "${ECONF_SOURCE}"/configure \
+ --prefix=/usr \
+ --host=${CHOST} \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --datadir=/usr/share \
+ --sysconfdir=/etc \
+ --localstatedir=/var/lib \
+ ${libcmd} "$@" ${LOCAL_EXTRA_ECONF} 1>&2
+
+ ${LOCAL_ECONF_WRAPPER} "${ECONF_SOURCE}"/configure \
+ --prefix=/usr \
+ --host=${CHOST} \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --datadir=/usr/share \
+ --sysconfdir=/etc \
+ --localstatedir=/var/lib \
+ ${libcmd} "$@" ${LOCAL_EXTRA_ECONF} || die "econf failed"
+
+ else
+ die "No configure script for econf"
+ fi
+}
+
+einstall()
+{
+ if [[ "${EBUILD_PHASE}" != "einstall" ]] ; then
+ die "einstall called in EBUILD_PHASE ${EBUILD_PHASE}"
+ fi
+
+ if [[ -f Makefile ]] || [[ -f makefile ]] || [[ -f GNUmakefile ]] ; then
+ local makecmd=""
+ type -p gmake &>/dev/null && makecmd="gmake" || makecmd="make"
+ local cmd="${EINSTALL_WRAPPER} ${makecmd} prefix=${D}/usr"
+ cmd="${cmd} mandir=${D}/usr/share/man"
+ cmd="${cmd} infodir=${D}/usr/share/info"
+ cmd="${cmd} datadir=${D}/usr/share"
+ cmd="${cmd} sysconfdir=${D}/etc"
+ cmd="${cmd} localstatedir=${D}/var/lib"
+ cmd="${cmd} libdir=${D}/usr/$(ebuild_get_libdir)"
+ cmd="${cmd} ${EXTRA_EINSTALL} ${@} install"
+ echo "${cmd}" 1>&2
+ ${cmd} || die "einstall failed"
+ else
+ die "No Makefile for einstall"
+ fi
+}
+