1 #!/bin/bash 2 3 # Must be run in the source directory. 4 # Should have passed make distcheck. 5 # And all final changes should already have been pushed. 6 # Backup copy will be created in $HOME/elfutils-$VERSION 7 8 # Any error is fatal 9 set -e 10 11 # We take one arguent, the version (e.g. 0.173) 12 if [ $# -ne 1 ]; then 13 echo "$0 <version> (e.g. 0.169)" 14 exit 1 15 fi 16 17 VERSION="$1" 18 19 echo Make sure the git repo is tagged, signed and pushed 20 echo git tag -s -m \"elfutils $VERSION release\" elfutils-$VERSION 21 echo git push --tags 22 23 # Create a temporary directoy and make sure it is cleaned up. 24 tempdir=$(mktemp -d) || exit 25 trap "rm -rf -- ${tempdir}" EXIT 26 27 pushd "${tempdir}" 28 29 # Checkout 30 git clone git://sourceware.org/git/elfutils.git 31 cd elfutils 32 git checkout -b "$VERSION" "elfutils-${VERSION}" 33 34 # Create dist 35 autoreconf -v -f -i 36 ./configure --enable-maintainer-mode 37 make -j$(nproc) && make dist 38 39 # Sign 40 mkdir $VERSION 41 cp elfutils-$VERSION.tar.bz2 $VERSION/ 42 cd $VERSION/ 43 gpg -b elfutils-$VERSION.tar.bz2 44 cd .. 45 46 # Backup copy 47 cp -r $VERSION $HOME/elfutils-$VERSION 48 49 # Upload 50 scp -r $VERSION sourceware.org:/sourceware/ftp/pub/elfutils/ 51 ssh sourceware.org "(cd /sourceware/ftp/pub/elfutils \ 52 && ln -sf $VERSION/elfutils-$VERSION.tar.bz2 elfutils-latest.tar.bz2 \ 53 && ln -sf $VERSION/elfutils-$VERSION.tar.bz2.sig elfutils-latest.tar.bz2.sig \ 54 && ls -lah elfutils-latest*)" 55 56 # Cleanup 57 popd 58 trap - EXIT 59 exit 60