Debian Codegraph @

bin/makedist

raw
1 #!/bin/sh
2 # Make a monolithic DaCHS distribution and put it on GAVO's software
3 # distribution page.
4 # This is probably not useful outside GAVO development.
5 # Call this from the root of a repo checkout.
6
7 is_release() {
8 # return 0 if the argument just has a single dot, 1 else.
9 if [ t$(echo "$1" | sed -e 's/[^.]//g') = 't.' ]; then
10 return 0
11 else
12 return 1
13 fi
14 }
15
16 DIST_SERVER=alnilam
17 SERVER_DIR=/var/www/soft/dist
18 LOCAL_PKG_DIR=~/gavo/tarballs
19
20 if [ ! -f setup.py ]; then
21 echo "This must be called from the root of a repository checkout."
22 exit 1
23 fi
24
25 distVersion=`python setup.py --version`
26 distName="gavodachs-${distVersion}.tar.gz"
27
28 python setup.py sdist
29 scp "dist/$distName" ${DIST_SERVER}:${SERVER_DIR}
30
31 # dump a gpb-ready tarball in $LOCAL_PKG_DIR/tarballs
32 if [ -d "$LOCAL_PKG_DIR" ]; then
33 cp "dist/$distName" "$LOCAL_PKG_DIR"/gavodachs_${distVersion}.orig.tar.gz
34 fi
35
36 if is_release $distVersion; then
37 ssh $DIST_SERVER "ln -sf $SERVER_DIR/$distName $SERVER_DIR/gavodachs-latest.tar.gz"
38 fi