aboutsummaryrefslogtreecommitdiffstats
path: root/make_release.sh
blob: be9923d4555461abd0f5493cc4ceef8af0b8c859 (plain) (blame)
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
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh

RM="`which rm` -vrf"
MKDIR="`which mkdir` -p"

if [ "$1foo" = "foo" ]; then
        echo "usage: `basename $0` X.Y.Z [username]"
        exit 1
fi

if [ "$2foo" = "foo" ]; then
        echo "usage: `basename $0` X.Y.Z <username>"
	exit 1
fi

USER=$2

PKG="wikipediafs-$1"
TAR_PKG="$PKG.tar.gz"
ZIP_PKG="$PKG.zip"
TMP_DIR="/tmp/$PKG"

echo "Creating temporary directory..."
$RM $TMP_DIR
$MKDIR $TMP_DIR
cp -r * $TMP_DIR
cd $TMP_DIR

echo "Creating man page"
docbook-to-man doc/mount.wikipediafs.sgml > doc/mount.wikipediafs.1
man2html -r doc/mount.wikipediafs.1 | sed -e "s/Content-type: text\/html//" \
    > doc/mount.wikipediafs.htm
gzip -9 doc/mount.wikipediafs.1

echo "Uploading site..."
cp README README.txt
scp site/*.htm site/*.png doc/mount.wikipediafs.htm README.txt \
$USER@shell.sourceforge.net:/home/groups/w/wi/wikipediafs/htdocs/
$RM README.txt

echo "Removing unnecessary files..."
$RM `find . -name "*.pyc" -or -name ".*" -or -name "*~" -or -name "*.orig"`
$RM "make_release.sh"
$RM site/

echo "Updating version number..."
echo "VERSION = '"$1"'" > src/wikipediafs/version.py
echo $1 > VERSION

cd ..

echo "Generating tarball..."
$RM $TAR_PKG 
tar -czf $TAR_PKG $PKG

echo "Generating zip..."
$RM $ZIP_PKG 
zip -r $ZIP_PKG $PKG

echo "Generated archives:"
du -h "`dirname $TMP_DIR`/$TAR_PKG"
du -h "`dirname $TMP_DIR`/$ZIP_PKG"

exit 0