release-sign-tarballs revision cac133768c18c89d4fccd4fc65d1a95232b51406
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce#!/bin/bash
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryceSIGNER="bryce@bryceharrington.org"
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryceVERSION="0.92"
3114ead9a60b65191e92dea6c76c038c03a8f1dcbrycePKG_NAME="inkscape"
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceLIST_TO="inkscape-announce@lists.sf.net"
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceLIST_CC="inkscape-devel@lists.sf.net"
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce# Locate Dependencies
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce#------------------------------------------------------------------------------
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryceMD5SUM=`which md5sum || which gmd5sum`
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryceSHA1SUM=`which sha1sum || which gsha1sum`
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryceSHA256SUM=`which sha256sum || which gsha256sum`
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce# Choose which make program to use (could be gmake)
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryceMAKE=${MAKE:="make"}
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce# Set the default make tarball creation command
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryceMAKE_DIST_CMD=distcheck
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce# Choose which grep program to use (on Solaris, must be gnu grep)
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryceif [ "x$GREP" = "x" ] ; then
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce if [ -x /usr/gnu/bin/grep ] ; then
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce GREP=/usr/gnu/bin/grep
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce else
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce GREP=grep
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce fi
3114ead9a60b65191e92dea6c76c038c03a8f1dcbrycefi
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce# Find path for GnuPG v2
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryceif [ "x$GPG" = "x" ] ; then
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce if [ -x /usr/bin/gpg2 ] ; then
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce GPG=/usr/bin/gpg2
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce else
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce GPG=gpg
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce fi
3114ead9a60b65191e92dea6c76c038c03a8f1dcbrycefi
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
cac133768c18c89d4fccd4fc65d1a95232b51406bryce#------------------------------------------------------------------------------
cac133768c18c89d4fccd4fc65d1a95232b51406bryce
cac133768c18c89d4fccd4fc65d1a95232b51406brycecheck_local_changes() {
cac133768c18c89d4fccd4fc65d1a95232b51406bryce # TODO
cac133768c18c89d4fccd4fc65d1a95232b51406bryce return 1
cac133768c18c89d4fccd4fc65d1a95232b51406bryce}
cac133768c18c89d4fccd4fc65d1a95232b51406bryce
cac133768c18c89d4fccd4fc65d1a95232b51406bryce#------------------------------------------------------------------------------
cac133768c18c89d4fccd4fc65d1a95232b51406bryce# Function: make_dist
cac133768c18c89d4fccd4fc65d1a95232b51406bryce#
cac133768c18c89d4fccd4fc65d1a95232b51406bryce# Create the package distribution
cac133768c18c89d4fccd4fc65d1a95232b51406bryce# Return 0 on success, 1 on fail
cac133768c18c89d4fccd4fc65d1a95232b51406brycemake_dist() {
cac133768c18c89d4fccd4fc65d1a95232b51406bryce if [ ! -d .bzr ]; then
cac133768c18c89d4fccd4fc65d1a95232b51406bryce echo "Error: There is no bzr repository here: $(pwd)"
cac133768c18c89d4fccd4fc65d1a95232b51406bryce return 1
cac133768c18c89d4fccd4fc65d1a95232b51406bryce fi
cac133768c18c89d4fccd4fc65d1a95232b51406bryce
cac133768c18c89d4fccd4fc65d1a95232b51406bryce # Change to an out-of-source build directory
cac133768c18c89d4fccd4fc65d1a95232b51406bryce config_indicator=CMakeCache.txt
cac133768c18c89d4fccd4fc65d1a95232b51406bryce status_file=$(find . -name ${config_indicator} -type f)
cac133768c18c89d4fccd4fc65d1a95232b51406bryce if [ $? -ne 0 ]; then
cac133768c18c89d4fccd4fc65d1a95232b51406bryce echo "Error: Failed to locate ${config_indicator}."
cac133768c18c89d4fccd4fc65d1a95232b51406bryce echo "Has the module been configured?"
cac133768c18c89d4fccd4fc65d1a95232b51406bryce return 1
cac133768c18c89d4fccd4fc65d1a95232b51406bryce fi
cac133768c18c89d4fccd4fc65d1a95232b51406bryce configNum=$(echo "$status_file" | wc -l | sed 's:^ *::')
cac133768c18c89d4fccd4fc65d1a95232b51406bryce if [ x"$configNum" = x0 ]; then
cac133768c18c89d4fccd4fc65d1a95232b51406bryce echo "Error: Failed to locate ${config_indicator}, has the module been configured?"
cac133768c18c89d4fccd4fc65d1a95232b51406bryce return 1
cac133768c18c89d4fccd4fc65d1a95232b51406bryce elif [ x"$configNum" != x1 ]; then
cac133768c18c89d4fccd4fc65d1a95232b51406bryce echo "Error: More than one ${config_indicator} file was found."
cac133768c18c89d4fccd4fc65d1a95232b51406bryce echo "Please cleanup previously failed attempts at distcheck."
cac133768c18c89d4fccd4fc65d1a95232b51406bryce fi
cac133768c18c89d4fccd4fc65d1a95232b51406bryce
cac133768c18c89d4fccd4fc65d1a95232b51406bryce build_dir=$(dirname ${status_file})
cac133768c18c89d4fccd4fc65d1a95232b51406bryce cd ${build_dir}
cac133768c18c89d4fccd4fc65d1a95232b51406bryce if [ $? -ne 0 ]; then
cac133768c18c89d4fccd4fc65d1a95232b51406bryce echo "Error: Failed to cd to build directory ${build_dir}."
cac133768c18c89d4fccd4fc65d1a95232b51406bryce return 1
cac133768c18c89d4fccd4fc65d1a95232b51406bryce fi
cac133768c18c89d4fccd4fc65d1a95232b51406bryce
cac133768c18c89d4fccd4fc65d1a95232b51406bryce check_local_changes
cac133768c18c89d4fccd4fc65d1a95232b51406bryce if [ $? -ne 0 ]; then
cac133768c18c89d4fccd4fc65d1a95232b51406bryce cd ${top_src}
cac133768c18c89d4fccd4fc65d1a95232b51406bryce return 1
cac133768c18c89d4fccd4fc65d1a95232b51406bryce fi
cac133768c18c89d4fccd4fc65d1a95232b51406bryce
cac133768c18c89d4fccd4fc65d1a95232b51406bryce echo "Info: running 'make $MAKE_DIST_CMD' to create tarballs:"
cac133768c18c89d4fccd4fc65d1a95232b51406bryce ${MAKE} ${MAKE_DIST_CMD} > /dev/null
cac133768c18c89d4fccd4fc65d1a95232b51406bryce if [ $? -ne 0 ]; then
cac133768c18c89d4fccd4fc65d1a95232b51406bryce echo "Error: '${MAKE} ${MAKEFLAGS} ${MAKE_DIST_CMD}' failed."
cac133768c18c89d4fccd4fc65d1a95232b51406bryce cd $top_src
cac133768c18c89d4fccd4fc65d1a95232b51406bryce return 1
cac133768c18c89d4fccd4fc65d1a95232b51406bryce fi
cac133768c18c89d4fccd4fc65d1a95232b51406bryce
cac133768c18c89d4fccd4fc65d1a95232b51406bryce return 0
cac133768c18c89d4fccd4fc65d1a95232b51406bryce}
cac133768c18c89d4fccd4fc65d1a95232b51406bryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce# Function: sign_or_fail
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce#------------------------------------------------------------------------------
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce#
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce# Sign the given file, if any
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce# Output the name of the signature generated to stdout (all other output to
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce# stderr)
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce# Return 0 on success, 1 on fail
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce#
3114ead9a60b65191e92dea6c76c038c03a8f1dcbrycesign_or_fail() {
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce if [ -n "$1" ]; then
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce sig=$1.sig
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce rm -f $sig
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce [ -n ${SIGNER} ] && signer="-u $SIGNER"
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce echo "$GPG $signer --detach-sign $1" 1>&2
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce $GPG $signer --detach-sign $1 1>&2
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce if [ $? -ne 0 ]; then
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce echo "Error: failed to sign $1." >&2
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce return 1
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce fi
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce echo $sig
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce fi
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce return 0
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce}
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbrycesign_packages() {
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce targz="${PKG_NAME}-${VERSION}.tar.gz"
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce tarbz2="${PKG_NAME}-${VERSION}.tar.bz2"
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce tarxz="${PKG_NAME}-${VERSION}.tar.xz"
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce zip="${PKG_NAME}-${VERSION}.zip"
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce signatures=""
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce for tarball in $targz $tarxz $tarbz2 $zip; do
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce if [ -e "${tarball}" ]; then
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce sig="$(sign_or_fail ${tarball})"
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce gpgsignerr=$((${gpgsignerr} + $?))
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce sig_url="http://inkscape.org/.../$sig"
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce signatures="$signatures
72ba327677b00dc4013e4ca19dd5ac4b87da63cebrycehttps://inkscape.org/en/download/source/
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceMD5: `$MD5SUM $tarball`
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceSHA1: `$SHA1SUM $tarball`
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceSHA256: `$SHA256SUM $tarball`
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce$sig_url
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce"
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce fi
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce done
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce if [ ${gpgsignerr} -ne 0 ]; then
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce echo "Error: unable to sign at least one of the tarballs."
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce return 1
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce elif [ -z "$siggz" ]; then
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce # The tar.gz is always required
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce echo "Error: Unable to sign the tar.gz file."
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce return 2
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce fi
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce return 0;
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce}
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbrycegenerate_announce() {
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce # TODO: Once converted to git, enable display of shortlog
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce #tag_previous=`git describe --abbrev=0 HEAD^ 2>/dev/null`
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce #tag_range="FIXME..FIXME"
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce #`git log --no-merges "$tag_range" | git shortlog`
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce tag_name="$tar_name"
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce cat <<RELEASE
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceSubject: [ANNOUNCE] $PKG_NAME $VERSION
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceTo: $LIST_TO
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceCc: $LIST_CC
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceThe Inkscape community proudly announces the release of Inkscape $VERSION.
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce https://inkscape.org/en/download/
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceInkscape is a drawing and painting tool similar to Illustrator,
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceCorelDraw, and Xara X, but with features, new tools, and interface style
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceof its own. It emphasizes the W3C standard Scalable Vector Graphics
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce(SVG) file format, but reads and writes a wealth of other formats
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceincluding PDF, so it is an easy complement to your other graphics and
72ba327677b00dc4013e4ca19dd5ac4b87da63cebrycedesktop tools. Best of all, Inkscape is created *by* the community *for*
72ba327677b00dc4013e4ca19dd5ac4b87da63cebrycethe community: Inkscape is 100% Open Source and freely available to
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceeveryone in the world.
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce<INSERT DETAILS ABOUT THE RELEASE HERE>
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceThe above barely scratches the surface of what's included in this
72ba327677b00dc4013e4ca19dd5ac4b87da63cebrycerelease. For the full scoop, please see our detailed Release Notes:
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce http://wiki.inkscape.org/wiki/index.php/Release_notes/$VERSION
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce
72ba327677b00dc4013e4ca19dd5ac4b87da63cebrycegit tag: $tag_name
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryce$signatures
72ba327677b00dc4013e4ca19dd5ac4b87da63cebryceRELEASE
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce}
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryceprocess() {
cac133768c18c89d4fccd4fc65d1a95232b51406bryce top_src=$(pwd)
cac133768c18c89d4fccd4fc65d1a95232b51406bryce
cac133768c18c89d4fccd4fc65d1a95232b51406bryce make_dist
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce sign_packages
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce generate_announce > "$tar_name.announce"
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce echo "Info: [ANNOUNCE] template generated in \"$tar_name.announce\" file."
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce echo " Please pgp sign and send it."
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce return 0
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce}
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryce
3114ead9a60b65191e92dea6c76c038c03a8f1dcbryceprocess