@@ -33,27 +33,64 @@ while getopts "d:n:th" opt; do
33
33
esac
34
34
done
35
35
36
- if [ " $DISTRIBUTION " != " precise" ] &&
36
+ if [ " $DISTRIBUTION " != " all" ] &&
37
+ [ " $DISTRIBUTION " != " precise" ] &&
37
38
[ " $DISTRIBUTION " != " trusty" ] &&
38
39
[ " $DISTRIBUTION " != " wheezy" ] &&
39
40
[ " $DISTRIBUTION " != " jessie" ]; then
40
- usage
41
- exit 1
41
+ usage
42
+ exit 1
42
43
fi
43
44
44
- echo " Packaging Tor2web for:" $DISTRIBUTION
45
+ if [ " $DISTRIBUTION " == " all" ]; then
46
+ TARGETS=" precise trusty wheezy jessie"
47
+ else
48
+ TARGETS=$DISTRIBUTION
49
+ fi
45
50
46
- [ -d T2WRelease ] && rm -rf T2WRelease
51
+ # Preliminary Requirements Check
52
+ ERR=0
53
+ echo " Checking preliminary Tor2web Build requirements"
54
+ for REQ in git debuild
55
+ do
56
+ if which $REQ > /dev/null; then
57
+ echo " + $REQ requirement meet"
58
+ else
59
+ ERR=$(( $ERR + 1 ))
60
+ echo " - $REQ requirement not meet"
61
+ fi
62
+ done
47
63
48
- mkdir T2WRelease
49
- cd T2WRelease
50
- git clone
[email protected] :globaleaks/Tor2web.git
64
+ if [ $ERR -ne 0 ]; then
65
+ echo " Error: Found ${ERR} unmet requirements"
66
+ echo " Information on how to setup tor2web development environment at: https://github.com/globaleaks/Tor2web/wiki/setting-up-globaleaks-development-environment"
67
+ exit 1
68
+ fi
69
+
70
+ BUILDSRC=" T2WRelease"
71
+ [ -d $BUILDSRC ] && rm -rf $BUILDSRC
72
+ mkdir $BUILDSRC && cd $BUILDSRC
73
+ git clone https://github.com/globaleaks/Tor2web.git
51
74
cd Tor2web
52
75
git checkout $TAG
53
- sed -i " s/stable; urgency=/ $DISTRIBUTION ; urgency=/g " debian/changelog
76
+ cd ../../
54
77
55
- if [ $NOSIGN -eq 1 ]; then
56
- debuild -i -us -uc -b
57
- else
58
- debuild
59
- fi
78
+ for TARGET in $TARGETS ; do
79
+ echo " Packaging Tor2web for:" $TARGET
80
+
81
+ BUILDDIR=" T2WRelease-$TARGET "
82
+
83
+ [ -d $BUILDDIR ] && rm -rf $BUILDDIR
84
+
85
+ cp -r $BUILDSRC $BUILDDIR
86
+ cd $BUILDDIR /Tor2web
87
+ sed -i " s/stable; urgency=/$TARGET ; urgency=/g" debian/changelog
88
+
89
+ if [ $NOSIGN -eq 1 ]; then
90
+ debuild -i -us -uc -b
91
+ else
92
+ debuild
93
+ fi
94
+
95
+ cd ../../
96
+ done
0 commit comments