JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
kill cvs tags
[spectrwm.git] / release.sh
1 #!/bin/ksh
2 #
3
4 PREFIX=scrotwm-
5 DIRS="lib linux osx"
6 FILES="Makefile baraction.sh initscreen.sh screenshot.sh scrotwm.1 scrotwm_es.1 scrotwm_it.1 scrotwm_pt.1 scrotwm_ru.1 scrotwm.c scrotwm.conf linux/Makefile linux/linux.c linux/util.h linux/scrotwm.desktop lib/Makefile lib/shlib_version lib/swm_hack.c osx/Makefile osx/osx.h osx/osx.c"
7
8 if [ -z "$1" ]; then
9         echo "usage: release.sh <version>"
10         exit 1
11 fi
12
13 if [ -d "$PREFIX$1" ]; then
14         echo "$PREFIX$1 already exists"
15         exit 1
16 fi
17
18 if [ -d "$PREFIX$1-port" ]; then
19         echo "$PREFIX$1 already exists"
20         exit 1
21 fi
22
23 TARGET="$PREFIX$1"
24 mkdir $TARGET
25
26 for i in $DIRS; do
27         mkdir "$TARGET/$i"
28 done
29
30 for i in $FILES; do
31         cp $i "$TARGET/$i"
32 done
33
34 tar zcf $TARGET.tgz $TARGET
35
36 # make port
37 sudo rm -rf ports
38 sudo cvs -d /cvs co ports/x11/scrotwm
39 PORT="$PREFIX$1-port"
40 mkdir $PORT
41
42 # Makefile
43 cat port/Makefile | sed "s/SCROTWMVERSION/$1/g" > $PORT/Makefile
44
45 # distinfo
46 cksum -b -a md5 $TARGET.tgz > $PORT/distinfo
47 cksum -b -a rmd160 $TARGET.tgz >> $PORT/distinfo
48 cksum -b -a sha1 $TARGET.tgz >> $PORT/distinfo
49 cksum -b -a sha256 $TARGET.tgz >> $PORT/distinfo
50 wc -c $TARGET.tgz 2>/dev/null | awk '{print "SIZE (" $2 ") = " $1}' >> $PORT/distinfo
51
52 # pkg
53 mkdir $PORT/pkg
54 cp port/pkg/DESCR $PORT/pkg/
55 cp port/pkg/PFRAG.shared $PORT/pkg/
56 cp port/pkg/PLIST $PORT/pkg/
57
58 # patches
59 mkdir $PORT/patches
60 cp port/patches/patch-scrotwm_c $PORT/patches/
61 cp port/patches/patch-scrotwm_conf $PORT/patches/
62
63 # make diff
64 diff -ruNp -x CVS ports/x11/scrotwm/ $PORT > $TARGET.diff
65
66 # kill ports dir or cvs will be angry
67 sudo rm -rf ports