Commit dd497c05 authored by Vitaly Lipatov's avatar Vitaly Lipatov

repack: run independently to user's .rpmmacros

parent a6e33bc2
...@@ -142,6 +142,17 @@ __apply_fix_code() ...@@ -142,6 +142,17 @@ __apply_fix_code()
docmd $repackcode "$1" "$2" || warning "There was errors with $repackcode script" docmd $repackcode "$1" "$2" || warning "There was errors with $repackcode script"
} }
__create_rpmmacros()
{
cat <<EOF >$HOME/.rpmmacros
%_topdir $HOME/RPM
%_tmppath $TMPDIR
%packager EPM <support@etersoft.ru>
%_gpg_name support@etersoft.ru
EOF
}
# will fill repacked_rpms var # will fill repacked_rpms var
__epm_repack_rpm() __epm_repack_rpm()
{ {
...@@ -152,8 +163,10 @@ __epm_repack_rpm() ...@@ -152,8 +163,10 @@ __epm_repack_rpm()
assure_exists rpmbuild rpm-build || fatal assure_exists rpmbuild rpm-build || fatal
local pkg local pkg
local tmpbuilddir=$(mktemp -d)/repack export HOME=$(mktemp -d)
local tmpbuilddir=$HOME/repack
mkdir $tmpbuilddir mkdir $tmpbuilddir
__create_rpmmacros
local abspkg local abspkg
repacked_rpms='' repacked_rpms=''
...@@ -176,9 +189,9 @@ __epm_repack_rpm() ...@@ -176,9 +189,9 @@ __epm_repack_rpm()
__apply_fix_code $pkgname $tmpbuilddir/$subdir $spec __apply_fix_code $pkgname $tmpbuilddir/$subdir $spec
showcmd fakeroot rpmbuild --buildroot $tmpbuilddir/$subdir --define='_allow_root_build 1' -bb $spec showcmd fakeroot rpmbuild --buildroot $tmpbuilddir/$subdir --define='_allow_root_build 1' -bb $spec
if [ -n "$verbose" ] ; then if [ -n "$verbose" ] ; then
a='' fakeroot rpmbuild --buildroot $tmpbuilddir/$subdir --define='_allow_root_build 1' -bb $spec || fatal a='' fakeroot rpmbuild --buildroot $tmpbuilddir/$subdir --define='_allow_root_build 1' -bb $spec || fatal
else else
a='' fakeroot rpmbuild --buildroot $tmpbuilddir/$subdir --define='_allow_root_build 1' -bb $spec >/dev/null || fatal a='' fakeroot rpmbuild --buildroot $tmpbuilddir/$subdir --define='_allow_root_build 1' -bb $spec >/dev/null || fatal
fi fi
local repacked_rpm="$(realpath $tmpbuilddir/../*.rpm)" local repacked_rpm="$(realpath $tmpbuilddir/../*.rpm)"
if [ -s "$repacked_rpm" ] ; then if [ -s "$repacked_rpm" ] ; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment