• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env 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
9set -e
10
11# We take one arguent, the version (e.g. 0.173)
12if [ $# -ne 1 ]; then
13  echo "$0 <version> (e.g. 0.169)"
14  exit 1
15fi
16
17VERSION="$1"
18
19echo Make sure the git repo is tagged, signed and pushed
20echo git tag -s -m \"elfutils $VERSION release\" elfutils-$VERSION
21echo git push --tags
22
23# Create a temporary directory and make sure it is cleaned up.
24tempdir=$(mktemp -d) || exit
25trap "rm -rf -- ${tempdir}" EXIT
26
27pushd "${tempdir}"
28
29# Checkout
30git clone git://sourceware.org/git/elfutils.git
31cd elfutils
32git tag --verify "elfutils-${VERSION}"
33git checkout -b "$VERSION" "elfutils-${VERSION}"
34
35# Create dist
36autoreconf -v -f -i
37./configure --enable-maintainer-mode
38make -j$(nproc) && make dist
39
40# Sign
41mkdir $VERSION
42cp elfutils-$VERSION.tar.bz2 $VERSION/
43cd $VERSION/
44gpg -b elfutils-$VERSION.tar.bz2
45cd ..
46
47# Backup copy
48cp -r $VERSION $HOME/elfutils-$VERSION
49
50# Upload
51scp -r $VERSION sourceware.org:/sourceware/ftp/pub/elfutils/
52ssh sourceware.org "(cd /sourceware/ftp/pub/elfutils \
53  && chmod go+rx $VERSION \
54  && chmod go+r  $VERSION/elfutils-$VERSION.tar.bz2* \
55  && ln -sf $VERSION/elfutils-$VERSION.tar.bz2 elfutils-latest.tar.bz2 \
56  && ln -sf $VERSION/elfutils-$VERSION.tar.bz2.sig elfutils-latest.tar.bz2.sig \
57  && ls -lah elfutils-latest*)"
58
59# Cleanup
60popd
61trap - EXIT
62exit
63