Commit 1bfc0d2a authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmbph, repl: fix for add 32bit requires for x86_64 Fedora/Ubuntu

parent 3838cb2c
......@@ -24,6 +24,7 @@ SPECNAME=$1
BASERELEASE=$(get_numrelease $SPECNAME)
RELEASE=$(get_release $SPECNAME)
BUILDNAME=$(get_name $SPECNAME)
ADDFIXCOMMAND=""
......@@ -51,9 +52,6 @@ if [ "$PKGVENDOR" = "alt" ] ; then
%undefine __libtoolize"
fi
else
# Hack for allow repack on x86_64 packages with ExclusiveArch: %{ix586}
[ "$SYSARCH" = "x86_64" ] && subst "s|^ExclusiveArch:.*||g" $SPECNAME
BUILDREQ="BuildRequires:"
if [ $(basename $SPECNAME) != "eepm.spec" ] ; then
# Need our compat package and disable strong patch checking
......@@ -64,6 +62,14 @@ else
FIXPATCHFUZZ="%define _default_patch_fuzz 3"
BUILDREQ="$BUILDREQ make gcc\n$FIXPATCHFUZZ"
if [ "$BUILDARCH" = "x86_64" ] && echo $BUILDNAME | grep -q wine ; then
[ "$DISTRNAME" = "Debian" ] && BUILDREQ="$BUILDREQ ia32-libs"
[ "$DISTRNAME" = "Ubuntu" ] && ! version_more_version $DISTRVERSION 12.04 ] && BUILDREQ="$BUILDREQ ia32-libs"
fi
# Hack for allow repack on x86_64 packages with ExclusiveArch: %{ix586}
[ "$SYSARCH" = "x86_64" ] && subst "s|^ExclusiveArch:.*||g" $SPECNAME
[ -z "$BUILDCOMMAND" ] && BUILDCOMMAND=$ETERBUILDBIN/rpmbb
TXTRELEASE=$(get_txtrelease $SPECNAME)
# HACK: Override release with KORINFTARGETRELEASE if set
......
......@@ -9,11 +9,48 @@ filter_deb_pkgnames()
sed -e "s|^ *\(.*\)-devel *\$|\1-dev|g" | tr "[A-Z]" "[a-z]"
}
# Hack for improve requires for 32-bit build on 64-bit system
# See rpmbph also
add_32bit_requires()
{
assert_var DISTRNAME BUILDARCH BUILDNAME DISTRVERSION
[ -z "$1" ] && return
# Only for build wine on x86_64
if [ "$BUILDARCH" = "x86_64" ] && echo $BUILDNAME | grep -q wine ; then
if [ "$DISTRNAME" = "Fedora" ] ; then
# http://www.rpm.org/wiki/PackagerDocs/ArchDependencies
# add (x86-32) to all -devel packages
for i in $* ; do
echo $i | grep -q -- "-devel$" && echo "$i(x86-32)" && continue
echo "$i"
done | xargs -n 1000 echo
elif [ "$DISTRNAME" = "Ubuntu" ] && version_more_version $DISTRVERSION 12.04 ; then
# i386 on Ubuntu
# add :i386 to all -dev packages
for i in $* ; do
echo $i | grep -q -- "-dev$" && echo "$i:i386" && continue
echo "$i"
done | xargs -n 1000 echo
elif [ "$DISTRNAME" = "Ubuntu" ] && ! version_more_version $DISTRVERSION 12.04 ; then
echo "$@ ia32-libs"
elif [ "$DISTRNAME" = "Debian" ] ; then
echo "$@ ia32-libs"
else
echo "$@"
fi
else
echo "$@"
fi
}
# Get replacement rule for ALT package to local in $1 (scan for files in $@)
# sets ALTPKGNAME, TARGETPKGNAME variable
# used for hack: PKGFORMAT, DISTRNAME, BUILDARCH
tolocal_anyrepl()
{
assert_var PKGFORMAT DISTRNAME BUILDNAME
local i REPLRULE WARULES
local GREP=$1
shift
......@@ -30,7 +67,7 @@ tolocal_anyrepl()
#REPLRULE=`echo $REPLRULE | sed -r -e 's,|,!,g'`
ALTPKGNAME=`echo $REPLRULE | cut -d"|" -f1 | sed -e "s|\+|\\\\\+|g"`
TARGETPKGNAME=`echo $REPLRULE | cut -d"|" -f2 | sed -e "s|\+|\\\\\+|g"`
test -n "$REPLRULE" && return 0
test -n "$REPLRULE" && TARGETPKGNAME=$(add_32bit_requires $TARGETPKGNAME) && return 0
done
# Part of local hack
......@@ -53,6 +90,8 @@ tolocal_anyrepl()
local NEWRESULT=`echo $GREP | sed -e "s|^ *\(.*\)-devel *\$|\1|g" `
fi
NEWRESULT=$(add_32bit_requires $NEWRESULT)
ALTPKGNAME=$GREP
TARGETPKGNAME="$NEWRESULT"
[ "$NEWRESULT" = "$GREP" ] && return 1
......
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