summaryrefslogtreecommitdiffstats
path: root/tools/export.sh
blob: 7fe73224e166a71dfc664400e746ab0476658533 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env sh

name="bcfg2"
repo="https://svn.mcs.anl.gov/repos/bcfg"
version="${1}"
expath="/tmp/${name}-${version}/"
tarname="/tmp/${name}-${version}.tar.gz"
url=`svn info | grep URL | awk '{print $2}'`

if [ -z "${version}" ] ; then
    echo "Usage: $0 <version>"
    exit 1
fi

# update the version
tmpbase=`basename $0`
deblogtmp=`mktemp /tmp/${tmpbase}.XXXXXX`
majorver=`/usr/bin/python -c "print '${version}'[:5]"`
minorver=`/usr/bin/python -c "print '${version}'[5:]"`
printf "name: "
read name
printf "email: "
read email
cat > deblogtmp << EOF
bcfg2 (${majorver}-0.0${minorver}) unstable; urgency=low

  * New upstream release

 -- ${name} <${email}>  `/bin/date -R`

EOF
sed -i "s/^\(Version:\)          [:digits:]*.*$/\1          ${version}/" misc/bcfg2.spec
sed -i "s|^\(Source0:\).*$|\1          ftp://ftp.mcs.anl.gov/pub/bcfg/bcfg2-${version}.tar.gz|" misc/bcfg2.spec
sed -i "s/^\(%setup -q -n\).*/\1 bcfg2-${version}/" misc/bcfg2.spec
cat debian/changelog >> deblogtmp
mv deblogtmp debian/changelog
echo ${majorver} > redhat/VERSION
echo 0.0${minorver} > redhat/RELEASE
sed -i "s/\(version=\).*/\1\"${version}\",/" setup.py
sed -i "s/^\(VERS\).*/\1=${version}-1/" solaris/Makefile
svn ci -m "Version bump to ${version}"

# tag the release
tagstr=`echo ${version} | sed -e 's/\./_/g'`
svn copy "$url" "${repo}/tags/${name}_${tagstr}" -m "tagged ${version} release"
svn export . "${expath}"
svn log -v "${repo}/tags/${name}_${tagstr}" > "${expath}/ChangeLog"
cd /tmp

tar czf "${tarname}" "${name}-${version}"
gpg --armor --output "${tarname}".gpg --detach-sig "${tarname}"
scp "${tarname}"* terra.mcs.anl.gov:/mcs/ftp/pub/bcfg