Skip to content
Snippets Groups Projects
Commit b8708228 authored by Simon Piette's avatar Simon Piette
Browse files

build-system: build_tarball.sh cleanup

- Make it fail on error
- Improved error handling on find commands
- Called as script instead of being sourced

Ref #55333

Change-Id: I893c5d6e10b4bca4552779260c5ca4afb17e4b74
parent 43b1a30d
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,10 @@
#
# Author: Francois Marier <francois@debian.org>
# Exit on error
set -o errexit
# This is an environment variable provided by Jenkins. It points to the repository's root
cd ${WORKSPACE}
......@@ -12,8 +16,8 @@ if [ ! -e daemon/configure.ac ] ; then
exit 1
fi
if [ "z$1" = "z" ] ; then
echo "Usage: $0 SOFTWARE_VERSION_NUMBER"
if [ $# -ne 1 ] ; then
echo "Usage: $(basename $0) SOFTWARE_VERSION_NUMBER"
exit 2
fi
......@@ -26,39 +30,41 @@ if [ -e $BUILDDIR ] ; then
exit 3
fi
# Populate the tarball directory
mkdir $BUILDDIR
cp -r * $BUILDDIR/
SRCITEMS=$(echo *)
# Exclude existing tarballs from the created tarball
SRCITEMS=${SRCITEMS//*.tar.gz}
# ${SRCITEMS//$BUILDDIR} is used to remove $BUILDDIR from $SRCITEMS
# See bash parameter expansion
cp -r ${SRCITEMS//$BUILDDIR} $BUILDDIR/
pushd $BUILDDIR
rm -rf $BUILDDIR
rm -f *.tar.gz
rm -rf lang/
# No dash in Version:
sed /^Version/s/[0-9].*/${SOFTWARE_VERSION%%-*}/ tools/build-system/rpm/sflphone.spec > sflphone.spec
rm -rf tools/
#rm -rf kde/
# Remove unwanted files
rm -rf lang/
rm -rf tools/
rm -rf .git/
rm -f .gitignore
find -name .project -type f -exec rm {} \;
find -name .cproject -type f -exec rm {} \;
find -name .settings -type d -exec rm -rf {} \;
find -name .gitignore -delete
find -name .project -type f -delete
find -name .cproject -type f -delete
find -name .settings -type d -exec rm -rf {} +
# Generate the configure files
pushd daemon
./autogen.sh
find -name \*.spec -delete
popd
pushd gnome
./autogen.sh
NOCONFIGURE=1 ./autogen.sh
popd
find -name autom4te.cache -type d -exec rm -rf {} \;
find -name *.in~ -type f -exec rm {} \;
find -name autom4te.cache -type d -exec rm -rf {} +
find -name *.in~ -type f -delete
popd # builddir
rm -f sflphone-*.tar.gz
tar zcf sflphone-$SOFTWARE_VERSION.tar.gz sflphone-$SOFTWARE_VERSION
tar zcf sflphone-${SOFTWARE_VERSION}.tar.gz sflphone-${SOFTWARE_VERSION}
rm -rf $BUILDDIR
......@@ -298,7 +298,8 @@ END
done
# Archive source tarball for Debian maintainer
. ${WORKING_DIR}/build_tarball.sh ${SOFTWARE_VERSION}
# and for RPM package building
./${WORKING_DIR}/build_tarball.sh ${SOFTWARE_VERSION}
# Undo any modifications caused by temporary patches
if [ "$REQUIRE_RESET" == "1" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment