aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-05-07 20:40:10 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-05-11 14:57:59 +0100
commit244f59e309f2616ff34cb536a646c570ec80232d (patch)
tree113b069c3e883d97bc39277ed8d5e53b16492b89
parent6bfac34b1265041c04d79486c6515fcdc0f8f068 (diff)
downloadpaludis-244f59e309f2616ff34cb536a646c570ec80232d.tar.gz
paludis-244f59e309f2616ff34cb536a646c570ec80232d.tar.xz
EAPI 3 has default src_install
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc10
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh34
-rw-r--r--paludis/repositories/e/eapis/3.conf17
-rw-r--r--paludis/repositories/e/ebuild/3/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/3/src_install.bash74
5 files changed, 136 insertions, 0 deletions
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 52e61ef..6da4ef8 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1637,6 +1637,16 @@ namespace test_cases
id->perform_action(pretend_action);
TEST_CHECK(pretend_action.failed());
}
+
+ {
+ TestMessageSuffix suffix("default_src_install 3", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/default_src_install-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ id->perform_action(action);
+ }
}
} test_e_repository_install_eapi_3;
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index 4107155..e061f00 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -1243,6 +1243,40 @@ pkg_pretend() {
die "This is my pkg_pretend. There are many like it, but this one is mine."
}
END
+mkdir -p "cat/default_src_install" || exit 1
+cat << 'END' > cat/default_src_install/default_src_install-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+src_unpack() {
+ mkdir -p ${WORKDIR}
+ cat <<'EOF' >${WORKDIR}/Makefile
+all :
+ echo spork > README
+ echo monkey > README.txt
+ touch README.foo
+ echo gerbil > GERBIL
+
+install :
+ echo spork > $(DESTDIR)/EATME
+EOF
+}
+
+pkg_preinst() {
+ [[ -e ${D}/usr/share/doc/${PF}/README ]] || die README
+ [[ -e ${D}/usr/share/doc/${PF}/README.txt ]] || die README.txt
+ [[ -e ${D}/usr/share/doc/${PF}/README.foo ]] && die README.foo
+ [[ -e ${D}/usr/share/doc/${PF}/GERBIL ]] && die GERBIL
+ [[ -e ${D}/EATME ]] || die EATME
+}
+END
cd ..
mkdir -p repo14/{profiles/profile,metadata,eclass} || exit 1
diff --git a/paludis/repositories/e/eapis/3.conf b/paludis/repositories/e/eapis/3.conf
index 3106412..29af8ea 100644
--- a/paludis/repositories/e/eapis/3.conf
+++ b/paludis/repositories/e/eapis/3.conf
@@ -7,6 +7,23 @@ can_be_pbin = true
ebuild_functions = ${ebuild_functions} pkg_pretend
+ebuild_install = \
+ skipname=killold : killold ; \
+ skipname=init userpriv sandbox : init saveenv ; \
+ skipname=setup skipifno=setup clearenv : loadenv setup saveenv ; \
+ skipname=unpack skipifno=*sources,unpack sandbox userpriv clearenv : loadenv unpack saveenv ; \
+ skipname=prepare skipifno=*sources,unpack,prepare sandbox userpriv clearenv : loadenv prepare saveenv ; \
+ skipname=configure skipifno=*sources,unpack,prepare,configure sandbox userpriv clearenv : loadenv configure saveenv ; \
+ skipname=compile skipifno=*sources,unpack,prepare,configure,compile sandbox userpriv clearenv : loadenv compile saveenv ; \
+ skipname=test skipifno=*sources,unpack,prepare,configure,compile,test sandbox userpriv clearenv optional_tests : loadenv test saveenv ; \
+ skipname=install skipifno=*sources,unpack,prepare,configure,compile,test,install sandbox clearenv : loadenv install saveenv ; \
+ skipname=strip strip : ; \
+ skipname=preinst skipifno=preinst clearenv prepost : loadenv preinst saveenv ; \
+ skipname=merge merge : ; \
+ skipname=postinst skipifno=postinst clearenv prepost : loadenv postinst saveenv ; \
+ skipname=tidyup : tidyup
+
+
package_dep_spec_parse_options = ${package_dep_spec_parse_options} \
allow_slot_equal_deps allow_slot_star_deps allow_use_dep_defaults
diff --git a/paludis/repositories/e/ebuild/3/Makefile.am b/paludis/repositories/e/ebuild/3/Makefile.am
index b4a51af..696bf97 100644
--- a/paludis/repositories/e/ebuild/3/Makefile.am
+++ b/paludis/repositories/e/ebuild/3/Makefile.am
@@ -6,6 +6,7 @@ libexecprog3dir = $(libexecdir)/paludis/3
libexecprog3_SCRIPTS = \
pkg_pretend.bash \
+ src_install.bash \
output_functions.bash
TESTS_ENVIRONMENT = env \
diff --git a/paludis/repositories/e/ebuild/3/src_install.bash b/paludis/repositories/e/ebuild/3/src_install.bash
new file mode 100644
index 0000000..a7cd493
--- /dev/null
+++ b/paludis/repositories/e/ebuild/3/src_install.bash
@@ -0,0 +1,74 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2009 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
+
+default_src_install()
+{
+ if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]]; then
+ emake DESTDIR="${D}" install
+ fi
+ if ! declare -p DOCS >/dev/null 2>&1 ; then
+ local d
+ for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
+ THANKS BUGS FAQ CREDITS CHANGELOG ; do
+ [[ -s "${d}" ]] && dodoc "${d}"
+ done
+ elif declare -p DOCS | grep -q ’^declare -a ’ ; then
+ dodoc "${DOCS[@]}"
+ else
+ dodoc ${DOCS}
+ fi
+}
+
+src_install()
+{
+ default_src_install
+}
+
+ebuild_f_install()
+{
+ if [[ -d "${S}" ]] ; then
+ cd "${S}" || die "cd to \${S} (\"${S}\") failed"
+ elif [[ -d "${WORKDIR}" ]] ; then
+ cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
+ fi
+
+ if hasq "install" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_install (SKIP_FUNCTIONS)"
+ else
+ if [[ $(type -t pre_src_install ) == "function" ]] ; then
+ ebuild_section "Starting pre_src_install"
+ pre_src_install
+ ebuild_section "Done pre_src_install"
+ fi
+
+ ebuild_section "Starting src_install"
+ src_install
+ ebuild_section "Done src_install"
+
+ if [[ $(type -t post_src_install ) == "function" ]] ; then
+ ebuild_section "Starting post_src_install"
+ post_src_install
+ ebuild_section "Done post_src_install"
+ fi
+ fi
+}
+