* updated for new zip names

This commit is contained in:
peter 2004-12-19 18:54:19 +00:00
parent c784367dfc
commit eab53234cd
2 changed files with 75 additions and 56 deletions

View File

@ -89,12 +89,21 @@ checkpath ()
# Install files from binary-*.tar
# $1 = cpu-target
# $2 = cross prefix
installbinary ()
{
BINARYTAR=binary.$1.tar
if [ "$2" == "" ]; then
FPCTARGET=$1
CROSSPREFIX=
else
FPCTARGET=`echo $2 | sed 's/-$//'`
CROSSPREFIX=$2
fi
BINARYTAR=${CROSSPREFIX}binary.$1.tar
# conversion from long to short archname for ppc<x>
case $1 in
case $FPCTARGET in
m68k*)
PPCSUFFIX=68k;;
sparc*)
@ -110,31 +119,30 @@ installbinary ()
esac
# Install compiler/RTL. Mandatory.
echo Installing compiler and RTL for $1...
unztarfromtar $BINARYTAR base${OSNAME}.tar.gz $PREFIX
echo "Installing compiler and RTL for $FPCTARGET..."
unztarfromtar $BINARYTAR ${CROSSPREFIX}base.$1.tar.gz $PREFIX
# Install symlink
rm -f $EXECDIR/ppc${PPCSUFFIX}
ln -sf $LIBDIR/ppc${PPCSUFFIX} $EXECDIR/ppc${PPCSUFFIX}
echo Installing utilities...
unztarfromtar $BINARYTAR util${OSNAME}.tar.gz $PREFIX
echo "Installing utilities..."
unztarfromtar $BINARYTAR ${CROSSPREFIX}utils.$1.tar.gz $PREFIX
if yesno "Install FCL"; then
unztarfromtar $BINARYTAR unitsfcl${OSNAME}.tar.gz $PREFIX
unztarfromtar $BINARYTAR ${CROSSPREFIX}units-fcl.$1.tar.gz $PREFIX
fi
if yesno "Install packages"; then
listtarfiles $BINARYTAR packages units
for f in $packages
do
if [ $f != unitsfcl${OSNAME}.tar.gz ]; then
basename $f .tar.gz |\
sed -e s/units// -e s/${OSNAME}// |\
xargs echo Installing
if [ $f != ${CROSSPREFIX}units-fcl.$1.tar.gz ]; then
p=`echo "$f" | sed -e 's+^.*units-\([^\.]*\)\..*+\1+'`
echo "Installing $p"
unztarfromtar $BINARYTAR $f $PREFIX
fi
done
fi
rm -f *${OSNAME}.tar.gz
rm -f *.$1.tar.gz
}
@ -182,10 +190,11 @@ DOCDIR=$PREFIX/share/doc/fpc-$VERSION
DEMODIR=$DOCDIR/examples
# Install all binary releases
for f in binary*.tar
for f in *binary*.tar
do
a=`echo $f | sed "s+binary.\(.*\).tar+\1+"`
installbinary $a
target=`echo $f | sed 's+^.*binary\.\(.*\)\.tar$+\1+'`
cross=`echo $f | sed 's+binary\..*\.tar$++'`
installbinary $target $cross
done
echo Done.
@ -194,33 +203,32 @@ echo
# Install the sources. Optional.
if yesno "Install sources"; then
echo Installing sources in $SRCDIR ...
unztarfromtar sources.tar basesrc.tar.gz $PREFIX
unztarfromtar sources.tar base.source.tar.gz $PREFIX
if yesno "Install compiler source"; then
unztarfromtar sources.tar compilersrc.tar.gz $PREFIX
unztarfromtar sources.tar compiler.source.tar.gz $PREFIX
fi
if yesno "Install RTL source"; then
unztarfromtar sources.tar rtlsrc.tar.gz $PREFIX
unztarfromtar sources.tar rtl.source.tar.gz $PREFIX
fi
if yesno "Install FCL source"; then
unztarfromtar sources.tar fclsrc.tar.gz $PREFIX
unztarfromtar sources.tar fcl.source.tar.gz $PREFIX
fi
if yesno "Install IDE source"; then
unztarfromtar sources.tar idesrc.tar.gz $PREFIX
unztarfromtar sources.tar ide.source.tar.gz $PREFIX
fi
if yesno "Install installer source"; then
unztarfromtar sources.tar installersrc.tar.gz $PREFIX
unztarfromtar sources.tar installer.source.tar.gz $PREFIX
fi
if yesno "Install Packages source"; then
listtarfiles sources.tar packages units
for f in $packages
do
basename $f .tar.gz |\
sed -e s/units// -e s/src// |\
xargs echo Installing sources for
p=`echo "$f" | sed -e 's+^.*units-\([^\.]*\)\..*+\1+'`
echo "Installing sources for $p"
unztarfromtar sources.tar $f $PREFIX
done
fi
# rm -f *src.tar.gz
rm -f *.source.tar.gz
echo Done.
fi
echo

View File

@ -6,6 +6,15 @@
set -e
# Al
unset FPCDIR
# Goto the toplevel if necessary
[ -d install ] || cd ..
# Retrieve version from compiler/Makefile.fpc
VERSION=`grep '^version' compiler/Makefile.fpc | sed 's+[^=]*= *\(.*\)+\1+'`
# Retrieve current system info by calling FPC. We need
# to use the | head -n1 to fix a bug in fpc 1.9.4 and earlier
# that uses exitcode 1 also when printing info resulting in
@ -14,41 +23,41 @@ SOURCECPU=`fpc -iSP | head -n1`
SOURCEOS=`fpc -iSO | head -n1`
if [ $# -ne 0 ]; then
if [ $# -ne 2 ]; then
echo "Usage: makepack [<cpu> <os>]"
if [ $# -ne 1 ]; then
echo "Usage: makepack [<cpu>-<os>]"
exit 1
fi
TARGETCPU=$1
TARGETOS=$2
TARGETCPU=`echo $1 | sed 's+\([^-]*\)-.*+\1+'`
TARGETOS=`echo $1 | sed 's+[^-]*-\(.*\)+\1+'`
else
TARGETCPU=$SOURCECPU
TARGETOS=$SOURCEOS
fi
FULLTARGET=$TARGETCPU-$TARGETOS
FULLSOURCE=$SOURCECPU-$SOURCEOS
if [ "$TARGETCPU" != "$SOURCECPU" ] || [ "$TARGETOS" != "$SOURCEOS" ]; then
echo "FPC Source: $FULLSOURCE"
echo "FPC Target: $FULLTARGET"
if [ "$FULLTARGET" != "$FULLSOURCE" ]; then
CROSS="cross"
CROSSPREFIX=$FULLTARGET-
else
CROSS=
CROSSPREFIX=
fi
unset FPCDIR
# Goto the toplevel if necessary
[ -d install ] || cd ..
# Build everything using the makefiles
make distclean CPU_TARGET=$TARGETCPU OS_TARGET=$TARGETOS
make ${CROSS}zipinstall CPU_TARGET=$TARGETCPU OS_TARGET=$TARGETOS SNAPSHOT=1
make ${CROSS}zipinstall CPU_TARGET=$TARGETCPU OS_TARGET=$TARGETOS
if [ $? != 0 ]; then
echo "Failed to make distribution archive."
exit 1
fi
# Retrieve version info before it gets cleaned below
VERSION=`cd compiler && ./utils/fpc -iV`
if [ "$CROSS" == "" ]; then
make docs
make makepackdocs
if [ $? != 0 ]; then
echo "Failed to make documentation archive."
exit 1
@ -60,44 +69,46 @@ if [ "$CROSS" == "" ]; then
fi
make docsrc
if [ $? != 0 ]; then
echo Failed to make documentation source archive.
echo "Failed to make documentation source archive."
exit 1
fi
make demozip
if [ $? != 0 ]; then
echo Failed to make demo source archive.
echo "Failed to make demo source archive."
exit 1
fi
fi
# Build filename
if [ "$CROSS" == "" ]; then
TARNAME=fpc-$VERSION.$FULLTARGET.tar
else
TARNAME=fpc-$FULLTARGET-$VERSION.$SOURCECPU-$SOURCEOS.tar
fi
BINARYTAR=binary-$FULLTARGET.tar
SOURCES=`/bin/ls *src.tar.gz`
FILES=`/bin/ls *linux.tar.gz`
RELFILES="binary.$FULLTARGET.tar sources.tar demo.tar.gz docs.tar.gz install.sh"
# binary.*.tar
BINARYTAR=${CROSSPREFIX}binary.$FULLTARGET.tar
echo "Creating $BINARYTAR"
tar cf $BINARYTAR $FILES
BINPACKAGES="base ide units utils"
BINFILES=
for p in $BINPACKAGES; do
BINFILES="$BINFILES ${CROSSPREFIX}$p*.$FULLSOURCE.tar.gz"
done
tar cf $BINARYTAR $BINFILES
if [ $? != 0 ]; then
echo "Failed to create $BINARYTAR"
exit 1
fi
# sources.tar
echo "Creating sources.tar"
tar cf sources.tar $SOURCES
tar cf sources.tar *.source.tar.gz
if [ $? != 0 ]; then
echo "Failed to create sources.tar"
exit 1
fi
# install.sh
echo "Copying install.sh"
sed s+%version%+$VERSION+ install/install.sh > install.sh
chmod 755 install.sh
# Files to be added to the .tar
RELFILES="$BINARYTAR sources.tar demo.tar.gz docs.tar.gz install.sh"
TARNAME=${CROSSPREFIX}fpc-$VERSION.$FULLSOURCE.tar
echo "Creating $TARNAME"
tar cf $TARNAME $RELFILES
if [ $? != 0 ]; then