Blob Blame History Raw
#!/bin/bash
# Author: Carlos O'Donell <carlos@redhat.com>
#
# Create a temporary directory into which we build the glibc32 source rpm.
# The source rpm is nothing more than the binary rpms for the 32-bit
# packages, along with the source rpm, but repackaged as a 64-bit package.
#
set -e
set -x
# Fail if the user is using local tmp for something else.
# Please delete your local tmp directory and re-runt the script.
mkdir tmp
mv *.rpm tmp
pushd tmp
# Compute the version to use from the filename.
version=`ls *.i686.rpm | head -1 | sed -e 's,^.*[[:alpha:]]-,,g' -e 's,\.i686\.rpm,,g'`
# Move the rpms into the right directories.
mkdir glibc32-${version}
mkdir glibc32-${version}/x86_64
mv glibc-*${version}.i686* glibc32-${version}/x86_64/
mv glibc-${version}.src.rpm glibc32-${version}/
# Package up the new source file.
tar cjvf glibc32-${version}.tar.bz2 glibc32-${version}
popd
mv tmp/glibc32-${version}.tar.bz2 .
rm -rf tmp
echo "New source file is glibc32-${version}.tar.bz2"
echo "Follow README.txt for next steps."
exit 0