-
Notifications
You must be signed in to change notification settings - Fork 17
/
mkdist.sh
executable file
·80 lines (66 loc) · 1.57 KB
/
mkdist.sh
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/sh
BASE=/home/piers/git/public/ruby-sapnwrfc
cd $BASE
find . -name '*.log' -type f -exec echo \> {} \;
find . -name 'rfc*trc' -type f -exec rm -f {} \;
find . -name '*~' -type f -exec rm -f {} \;
VERS=0.26
DIST=sapnwrfc-$VERS
BALL=$DIST.tar.gz
ZIP=$DIST.zip
export VERS
#perl -i -ne 's/\d\.\d\d/$ENV{VERS}/;print' *.gemspec build.sh
ruby -i -ne '$_.sub!(/\d\.\d\d/, ENV["VERS"]); print' *.gemspec build.sh
./build.sh
./doco
if [ -d $DIST ]; then
echo "removing: $DIST ..."
rm -rf $DIST
fi
if [ -f $BALL ]; then
echo "removing: $BALL ..."
rm -f $BALL
fi
if [ -f $ZIP ]; then
echo "removing: $ZIP ..."
rm -f $ZIP
fi
echo "setting up the distribution foot print $DIST ..."
mkdir -p $DIST
for i in `cat MANIFEST`
do
DIR=`perl -e '$ARGV[0] =~ s/^(.*)\/.*?$/$1/; print $ARGV[0]' $i`
if [ -d $DIR ]; then
echo "making dir: $DIR"
mkdir -p $DIST/$DIR
fi
echo "copy $BASE/$i to $DIST/$i ..."
if [ -f $BASE/$i ]; then
echo "$BASE/$i exists..."
else
if [ -d $BASE/$i ]; then
echo "$BASE/$i exists..."
else
echo "$BASE/$i IS MISSING !!!"
exit 1
fi
fi
cp -a $i $DIST/$i
done
echo "make tar ball: $BALL"
tar -czvf $BALL $DIST
ls -l $BALL
echo "make zip: $ZIP"
zip -r $ZIP $DIST
ls -l $ZIP
if [ -d $DIST ]; then
echo "removing: $DIST ..."
rm -rf $DIST
fi
echo "Done."
chmod -R a+r doc $BALL $ZIP
echo "Copy up documentation"
rsync -av --delete --rsh=ssh doc piersharding.com:www/download/ruby/sapnwrfc/
echo "Copy up distribution"
scp $BALL piersharding.com:www/download/ruby/sapnwrfc/
scp $ZIP piersharding.com:www/download/ruby/sapnwrfc/