2011-04-02 10:26:17 -04:00
|
|
|
#!/bin/bash
|
2011-01-31 09:48:34 -05:00
|
|
|
|
2011-02-25 17:05:15 -05:00
|
|
|
# package
|
|
|
|
|
|
|
|
# This will collect up the x86 and x86_64 bundles created by build
|
|
|
|
# and package them together with an installer script.
|
|
|
|
|
|
|
|
BUILDTYPE=""
|
2011-03-24 17:13:53 -04:00
|
|
|
SINGLE_ARCH="F"
|
|
|
|
X86_BUNDLE_OK="F"
|
|
|
|
X86_64_BUNDLE_OK="F"
|
|
|
|
|
2011-01-31 09:48:34 -05:00
|
|
|
|
|
|
|
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 ;;
|
|
|
|
--public)
|
|
|
|
APPNAME=Ardour ;
|
|
|
|
shift ;;
|
|
|
|
|
2011-03-24 17:13:53 -04:00
|
|
|
--singlearch) SINGLE_ARCH="T" ; shift ;;
|
2011-02-25 17:05:15 -05:00
|
|
|
|
2011-01-31 09:48:34 -05:00
|
|
|
*)
|
|
|
|
#catch all for unknown arguments
|
|
|
|
echo ""
|
|
|
|
echo "!!! ERROR !!! - Unknown argument $1"
|
|
|
|
echo ""
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
|
2011-02-25 17:05:15 -05:00
|
|
|
# Figure out the Build Type
|
|
|
|
if grep -q "DEBUG = True" ../../build/c4che/default.cache.py; then
|
|
|
|
DEBUG="T"
|
|
|
|
else
|
|
|
|
DEBUG="F"
|
|
|
|
fi
|
|
|
|
|
2011-04-28 17:07:47 -04:00
|
|
|
if [ x$DEBUG = xT ]; then
|
2011-04-28 15:28:22 -04:00
|
|
|
BUILDTYPE="dbg"
|
2011-02-25 17:05:15 -05:00
|
|
|
fi
|
|
|
|
|
2011-04-06 15:02:11 -04:00
|
|
|
release_version=`grep -m 1 '^VERSION' ../../wscript | awk '{print $3}' | sed "s/'//g"`
|
2012-05-04 09:44:27 -04:00
|
|
|
svn_version=`grep -m 1 'svn_revision =' ../../libs/ardour/svn_revision.cc | cut -d"'" -f 2`
|
2011-02-25 17:05:15 -05:00
|
|
|
|
2011-04-06 15:02:11 -04:00
|
|
|
X86_BUNDLE="${APPNAME}_x86-${release_version}_${svn_version}"
|
|
|
|
X86_64_BUNDLE="${APPNAME}_x86_64-${release_version}_${svn_version}"
|
|
|
|
|
|
|
|
if [ ! -z ${BUILDTYPE} ]; then
|
|
|
|
X86_BUNDLE="${X86_BUNDLE}-${BUILDTYPE}"
|
|
|
|
X86_64_BUNDLE="${X86_64_BUNDLE}-${BUILDTYPE}"
|
2011-02-25 17:05:15 -05:00
|
|
|
fi
|
|
|
|
|
2011-01-31 09:48:34 -05:00
|
|
|
|
2011-04-06 15:02:11 -04:00
|
|
|
if [ ! -e ${X86_BUNDLE}.tar.bz2 ] ; then
|
|
|
|
echo ""
|
|
|
|
echo "Can't locate x86 bundle file ${X86_BUNDLE}.tar.bz2"
|
|
|
|
echo ""
|
|
|
|
elif [ ! -e ${X86_BUNDLE}.size ] ; then
|
2011-01-31 09:48:34 -05:00
|
|
|
echo ""
|
2011-04-06 15:02:11 -04:00
|
|
|
echo "Can't locate x86 bundle size file ${X86_BUNDLE}.size"
|
2011-01-31 09:48:34 -05:00
|
|
|
echo ""
|
2011-03-24 17:13:53 -04:00
|
|
|
else
|
|
|
|
X86_BUNDLE_OK="T"
|
2011-01-31 09:48:34 -05:00
|
|
|
fi
|
|
|
|
|
2011-04-06 15:02:11 -04:00
|
|
|
if [ ! -e ${X86_64_BUNDLE}.tar.bz2 ]; then
|
|
|
|
echo ""
|
|
|
|
echo "Can't locate x86_64 bundle file ${X86_64_BUNDLE}.tar.bz2"
|
|
|
|
echo ""
|
|
|
|
elif [ ! -e ${X86_64_BUNDLE}.size ]; then
|
2011-01-31 09:48:34 -05:00
|
|
|
echo ""
|
2011-04-06 15:02:11 -04:00
|
|
|
echo "Can't locate x86 bundle size file ${X86_BUNDLE}.size"
|
2011-01-31 09:48:34 -05:00
|
|
|
echo ""
|
2011-03-24 17:13:53 -04:00
|
|
|
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 ""
|
2011-04-06 15:02:11 -04:00
|
|
|
echo "!!! ERROR !!! - Can't locate bundle files ${X86_BUNDLE} or ${X86_64_BUNDLE}"
|
2011-03-24 17:13:53 -04:00
|
|
|
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
|
2011-01-31 09:48:34 -05:00
|
|
|
fi
|
|
|
|
|
2011-03-24 17:13:53 -04:00
|
|
|
|
|
|
|
|
|
|
|
if [ -z ${BUILDTYPE} ]; then
|
|
|
|
if [ "${SINGLE_ARCH}" = "T" ]; then
|
|
|
|
if [ "${X86_BUNDLE_OK}" = "T" ]; then
|
|
|
|
PACKAGE="${APPNAME}_32bit-${release_version}_${svn_version}"
|
|
|
|
else
|
|
|
|
PACKAGE="${APPNAME}_64bit-${release_version}_${svn_version}"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
PACKAGE="${APPNAME}-${release_version}_${svn_version}"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if [ "${SINGLE_ARCH}" = "T" ]; then
|
|
|
|
if [ "${X86_BUNDLE_OK}" = "T" ]; then
|
|
|
|
PACKAGE="${APPNAME}_32bit-${release_version}_${svn_version}-${BUILDTYPE}"
|
|
|
|
else
|
|
|
|
PACKAGE="${APPNAME}_64bit-${release_version}_${svn_version}-${BUILDTYPE}"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
PACKAGE="${APPNAME}-${release_version}_${svn_version}-${BUILDTYPE}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2011-01-31 09:48:34 -05:00
|
|
|
echo "Cleaning up any old package files for this build"
|
|
|
|
#Get rid of any old packages of this same name.
|
|
|
|
rm -f ${PACKAGE}.tar.bz2
|
|
|
|
rm -rf ${PACKAGE}
|
|
|
|
|
|
|
|
|
|
|
|
echo "Creating new package dir..."
|
|
|
|
mkdir ${PACKAGE}
|
2011-03-24 17:13:53 -04:00
|
|
|
|
|
|
|
if [ "${X86_BUNDLE_OK}" = "T" ]; then
|
2011-04-06 15:02:11 -04:00
|
|
|
mv ${X86_BUNDLE}.tar.bz2 ${PACKAGE}
|
|
|
|
mv ${X86_BUNDLE}.size ${PACKAGE}/.${X86_BUNDLE}.size
|
2011-03-24 17:13:53 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${X86_64_BUNDLE_OK}" = "T" ]; then
|
2011-04-06 15:02:11 -04:00
|
|
|
mv ${X86_64_BUNDLE}.tar.bz2 ${PACKAGE}
|
|
|
|
mv ${X86_64_BUNDLE}.size ${PACKAGE}/.${X86_64_BUNDLE}.size
|
2011-03-24 17:13:53 -04:00
|
|
|
fi
|
|
|
|
|
2011-01-31 09:48:34 -05:00
|
|
|
cp install.sh ${PACKAGE}
|
2011-02-25 17:05:15 -05:00
|
|
|
cp stage2.run ${PACKAGE}/.stage2.run
|
|
|
|
cp README ${PACKAGE}
|
2011-01-31 09:48:34 -05:00
|
|
|
|
|
|
|
echo "Creating tarball..."
|
2011-03-25 17:48:12 -04:00
|
|
|
tar -cf ${PACKAGE}.tar ${PACKAGE}
|
2011-01-31 09:48:34 -05:00
|
|
|
|
|
|
|
echo "Clean up"
|
|
|
|
rm -rf ${PACKAGE}
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Done"
|
|
|
|
echo ""
|