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