13
0
livetrax/tools/linux_packaging/package

201 lines
4.0 KiB
Plaintext
Raw Normal View History

#!/bin/bash
# package
# This will collect up the x86 and x86_64 bundles created by build
# and package them together with an installer script.
BUILDTYPE=""
SINGLE_ARCH="F"
X86_BUNDLE_OK="F"
X86_64_BUNDLE_OK="F"
GCC5ABI="F"
MAKESELF=""
2015-10-04 11:52:29 -04:00
BUILD_ROOT=../../build
MAKESELFOPTS="--bzip2"
if [ $# -eq 0 ] ; then
echo ""
echo "ERROR - Please specify build type"
echo " --public"
echo " --sae"
echo ""
exit 1
fi
while [ $# -gt 0 ] ; do
echo "arg = $1"
case $1 in
#
# top level build targets
#
--sae)
APPNAME=Ardour ;
shift ;;
--mixbus)
APPNAME=Mixbus ;
shift ;;
2016-05-16 08:42:19 -04:00
--mixbus32c)
APPNAME=Mixbus32C ;
shift ;;
--public)
APPNAME=Ardour ;
shift ;;
--makeself)
MAKESELF=`which makeself`;
shift ;;
--singlearch) SINGLE_ARCH="T" ; shift ;;
--gcc5abi) GCC5ABI="T" ; shift ;;
--xz) MAKESELFOPTS="--xz --complevel 9" ; shift ;;
*)
#catch all for unknown arguments
echo ""
echo "!!! ERROR !!! - Unknown argument $1"
echo ""
exit 1
;;
esac
done
. ../define_versions.sh
if [ x$DEBUG = xT ]; then
BUILDTYPE="dbg"
fi
X86_BUNDLE="${APPNAME}_x86-${release_version}"
X86_64_BUNDLE="${APPNAME}_x86_64-${release_version}"
if [ ! -z ${BUILDTYPE} ]; then
X86_BUNDLE="${X86_BUNDLE}-${BUILDTYPE}"
X86_64_BUNDLE="${X86_64_BUNDLE}-${BUILDTYPE}"
fi
if [ ! -e ${X86_BUNDLE}.tar ] ; then
echo ""
echo "Can't locate x86 bundle file ${X86_BUNDLE}.tar"
echo ""
elif [ ! -e ${X86_BUNDLE}.size ] ; then
echo ""
echo "Can't locate x86 bundle size file ${X86_BUNDLE}.size"
echo ""
else
X86_BUNDLE_OK="T"
fi
if [ ! -e ${X86_64_BUNDLE}.tar ]; then
echo ""
echo "Can't locate x86_64 bundle file ${X86_64_BUNDLE}.tar"
echo ""
elif [ ! -e ${X86_64_BUNDLE}.size ]; then
echo ""
echo "Can't locate x86 bundle size file ${X86_BUNDLE}.size"
echo ""
else
X86_64_BUNDLE_OK="T"
fi
if [ "${X86_BUNDLE_OK}" = "F" ] || [ "${X86_64_BUNDLE_OK}" = "F" ]; then
if [ "${X86_BUNDLE_OK}" = "${X86_64_BUNDLE_OK}" ]; then
echo ""
echo "!!! ERROR !!! - Can't locate bundle files ${X86_BUNDLE} or ${X86_64_BUNDLE}"
echo ""
exit 1
elif [ "${SINGLE_ARCH}" = "T" ]; then
echo ""
echo "!!! Warning !!! - A single architecture package has been selected"
echo ""
else
echo ""
echo "!!! ERROR !!! - Missing bundle files."
echo ""
exit 1
fi
fi
if [ -z ${BUILDTYPE} ]; then
if [ "${SINGLE_ARCH}" = "T" ]; then
if [ "${X86_BUNDLE_OK}" = "T" ]; then
PACKAGE="${APPNAME}_32bit-${release_version}"
else
PACKAGE="${APPNAME}_64bit-${release_version}"
fi
else
PACKAGE="${APPNAME}-${release_version}"
fi
else
if [ "${SINGLE_ARCH}" = "T" ]; then
if [ "${X86_BUNDLE_OK}" = "T" ]; then
PACKAGE="${APPNAME}_32bit-${release_version}-${BUILDTYPE}"
else
PACKAGE="${APPNAME}_64bit-${release_version}-${BUILDTYPE}"
fi
else
PACKAGE="${APPNAME}-${release_version}-${BUILDTYPE}"
fi
fi
if [ "$GCC5ABI" = "T" ]; then
PACKAGE="${PACKAGE}-gcc5"
fi
echo "Cleaning up any old package files for this build"
#Get rid of any old packages of this same name.
rm -f ${PACKAGE}.tar
rm -rf ${PACKAGE}
echo "Creating new package dir..."
mkdir ${PACKAGE}
if [ "${X86_BUNDLE_OK}" = "T" ]; then
mv ${X86_BUNDLE}.tar ${PACKAGE}
mv ${X86_BUNDLE}.size ${PACKAGE}/.${X86_BUNDLE}.size
fi
if [ "${X86_64_BUNDLE_OK}" = "T" ]; then
mv ${X86_64_BUNDLE}.tar ${PACKAGE}
mv ${X86_64_BUNDLE}.size ${PACKAGE}/.${X86_64_BUNDLE}.size
fi
cp install.sh ${PACKAGE}
cp stage2.run ${PACKAGE}/.stage2.run
cp README ${PACKAGE}
2015-10-04 11:52:29 -04:00
# gcc4/5 ABI test tool
if [ -e $BUILD_ROOT/tools/gccabicheck/gcc-glibmm-abi-check ]; then
cp $BUILD_ROOT/tools/gccabicheck/gcc-glibmm-abi-check ${PACKAGE}/.gcc-glibmm-abi-check
else
echo "!!!ERROR !!! gcc-glibmm-abi-check program is missing. packager will exit without being complete"
rm -rf ${PACKAGE}
rm -f stage2.run
exit 1
fi
if test -n "$MAKESELF"; then
2014-09-28 15:22:12 -04:00
echo "Creating self-extracting installer"
$MAKESELF ${MAKESELFOPTS} ${PACKAGE}/ ${PACKAGE}.run ${APPNAME} ./install.sh
else
echo "Creating tarball..."
tar -cf ${PACKAGE}.tar ${PACKAGE}
fi
echo "Clean up"
rm -rf ${PACKAGE}
2015-03-23 08:02:39 -04:00
rm -f stage2.run
echo ""
echo "Done"
echo ""