From 87347bc5f30adb164cf104037fd433f5367156db Mon Sep 17 00:00:00 2001 From: Lucas Bickel Date: Thu, 15 Nov 2012 22:50:52 +0100 Subject: [PATCH] fix ebuild rpm command for rpm 4.10.0 * changes dyn_spec to use a sources_dir in the sandbox * remove deprecated Buildroot from specfile * call rpmbuild with --target instead of Buildroot * grab machine_name from $CHOST and use as --target in rpmbuild * use dir in sandbox instead of /usr/src/rpm/RPMS --- bin/misc-functions.sh | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index db023e4..5ea4262 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -1199,7 +1199,7 @@ __dyn_package() { } __dyn_spec() { - local sources_dir=/usr/src/rpm/SOURCES + local sources_dir=../homedir/rpmbuild/SOURCES/ mkdir -p "${sources_dir}" declare -a tar_args=("${EBUILD}") [[ -d ${FILESDIR} ]] && tar_args=("${EBUILD}" "${FILESDIR}") @@ -1215,7 +1215,6 @@ Release: ${PR} License: GPL Group: portage/${CATEGORY} Source: ${PF}.tar.gz -Buildroot: ${D} %description ${DESCRIPTION} @@ -1242,12 +1241,11 @@ __dyn_rpm() { fi cd "${T}" || die "cd failed" - local machine_name=$(uname -m) - local dest_dir=${EPREFIX}/usr/src/rpm/RPMS/${machine_name} - addwrite ${EPREFIX}/usr/src/rpm + local machine_name=$(echo $CHOST | cut -d '-' -f 1) + local dest_dir=${EPREFIX}${T}/../homedir/rpmbuild/RPMS/${machine_name} addwrite "${RPMDIR}" __dyn_spec - rpmbuild -bb --clean --rmsource "${PF}.spec" || die "Failed to integrate rpm spec file" + rpmbuild -bb --clean --rmsource "${PF}.spec" --buildroot ${D} --target ${CHOST} || die "Failed to integrate rpm spec file" install -D "${dest_dir}/${PN}-${PV}-${PR}.${machine_name}.rpm" \ "${RPMDIR}/${CATEGORY}/${PN}-${PV}-${PR}.rpm" || \ die "Failed to move rpm" -- 1.7.8.6