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/misc-functions.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'bin/misc-functions.sh') 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 -- cgit v1.2.3-1-g7c22