From 3a601a4759f98ef301faa63e4bb4b98c9787b5d3 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 10 Mar 2006 08:17:02 +0000 Subject: Move dyn_rpm and dyn_spec from ebuild.sh to misc-functions.sh. svn path=/main/trunk/; revision=2838 --- bin/ebuild.sh | 48 ------------------------------------------------ bin/misc-functions.sh | 40 ++++++++++++++++++++++++++++++++++++++++ pym/portage.py | 2 +- 3 files changed, 41 insertions(+), 49 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 070b118c9..810aa1d89 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -1061,44 +1061,6 @@ dyn_preinst() { [ "$(type -t post_pkg_preinst)" == "function" ] && post_pkg_preinst } -dyn_spec() { - tar czf "/usr/src/redhat/SOURCES/${PF}.tar.gz" "${O}/${PF}.ebuild" "${O}/files" || die "Failed to create base rpm tarball." - - cat <<__END1__ > ${PF}.spec -Summary: ${DESCRIPTION} -Name: ${PN} -Version: ${PV} -Release: ${PR} -Copyright: GPL -Group: portage/${CATEGORY} -Source: ${PF}.tar.gz -Buildroot: ${D} -%description -${DESCRIPTION} - -${HOMEPAGE} - -%prep -%setup -c - -%build - -%install - -%clean - -%files -/ -__END1__ - -} - -dyn_rpm() { - dyn_spec - rpmbuild -bb "${PF}.spec" || die "Failed to integrate rpm spec file" - install -D "/usr/src/redhat/RPMS/i386/${PN}-${PV}-${PR}.i386.rpm" "${RPMDIR}/${CATEGORY}/${PN}-${PV}-${PR}.rpm" || die "Failed to move rpm" -} - dyn_help() { echo echo "Portage" @@ -1617,16 +1579,6 @@ for myarg in $*; do set +x fi ;; - rpm) - export SANDBOX_ON="0" - if [ "$PORTAGE_DEBUG" != "1" ]; then - dyn_${myarg} - else - set -x - dyn_${myarg} - set +x - fi - ;; depend) export SANDBOX_ON="0" set -f diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 88ae29f87..8ae5149fe 100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -422,6 +422,46 @@ dyn_package() { touch .packaged || die "Failed to 'touch .packaged' in ${PORTAGE_BUILDDIR}" } +dyn_spec() { + tar czf "/usr/src/redhat/SOURCES/${PF}.tar.gz" "${O}/${PF}.ebuild" "${O}/files" || die "Failed to create base rpm tarball." + + cat <<__END1__ > ${PF}.spec +Summary: ${DESCRIPTION} +Name: ${PN} +Version: ${PV} +Release: ${PR} +Copyright: GPL +Group: portage/${CATEGORY} +Source: ${PF}.tar.gz +Buildroot: ${D} +%description +${DESCRIPTION} + +${HOMEPAGE} + +%prep +%setup -c + +%build + +%install + +%clean + +%files +/ +__END1__ + +} + +dyn_rpm() { + addwrite /usr/src/redhat/ + addwrite ${RPMDIR} + dyn_spec + rpmbuild -bb "${PF}.spec" || die "Failed to integrate rpm spec file" + install -D "/usr/src/redhat/RPMS/i386/${PN}-${PV}-${PR}.i386.rpm" "${RPMDIR}/${CATEGORY}/${PN}-${PV}-${PR}.rpm" || die "Failed to move rpm" +} + if [ -n "${MISC_FUNCTIONS_ARGS}" ]; then [ "$PORTAGE_DEBUG" == "1" ] && set -x for x in ${MISC_FUNCTIONS_ARGS}; do diff --git a/pym/portage.py b/pym/portage.py index 5fc70a7de..1e318623b 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -2369,7 +2369,7 @@ def spawnebuild(mydo,actionmap,mysettings,debug,alwaysdep=0,logfile=None): if retval: return retval # spawn ebuild.sh or misc-functions.sh as appropriate - if mydo in ["package"]: + if mydo in ["package","rpm"]: mycommand = MISC_SH_BINARY + " dyn_" + mydo else: mycommand = EBUILD_SH_BINARY + " " + mydo -- cgit v1.2.3-1-g7c22