]>
Commit | Line | Data |
---|---|---|
4bf178c5 JT |
1 | #!/bin/sh |
2 | # mkrelease.sh: Creates a release suitable for distfiles.atheme.org. | |
3 | # | |
4 | # Copyright (c) 2007 atheme.org | |
5 | # | |
6 | # Permission to use, copy, modify, and/or distribute this software for | |
7 | # any purpose with or without fee is hereby granted, provided that the above | |
8 | # copyright notice and this permission notice appear in all copies. | |
9 | # | |
10 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |
11 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
12 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
13 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | |
14 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
15 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
16 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | |
17 | # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
18 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | |
19 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
20 | # | |
21 | ||
22 | if [ "x$1" = "x" ]; then | |
23 | echo "usage: $0 releasename [--automatic]" | |
24 | exit | |
25 | else | |
26 | RELEASENAME="$1" | |
27 | fi | |
28 | ||
29 | if [ "x$2" = "x--automatic" ]; then | |
30 | AUTOMATIC="yes" | |
31 | fi | |
32 | ||
33 | TIP=`hg tip --template "#rev#:#node|short#"` | |
34 | ||
35 | WRKDIR=`pwd` | |
36 | ||
37 | if [ -d $RELEASENAME ]; then | |
38 | echo "Deleting previous release named $RELEASENAME." | |
39 | rm -rf $WRKDIR/$RELEASENAME/ | |
40 | fi | |
41 | ||
42 | echo "Making release named $RELEASENAME (tip $TIP)" | |
43 | ||
44 | echo | |
45 | echo "Building root: $RELEASENAME/" | |
46 | hg archive $RELEASENAME | |
47 | cd $RELEASENAME | |
48 | sh autogen.sh | |
49 | rm -rf autogen.sh autom4te.cache | |
50 | ||
51 | # Run application specific instructions here. | |
52 | if [ -x "$WRKDIR/application.sh" ]; then | |
53 | . $WRKDIR/application.sh | |
54 | fi | |
55 | ||
56 | cd .. | |
57 | ||
58 | echo "Building $RELEASENAME.tgz from $RELEASENAME/" | |
59 | tar zcf $RELEASENAME.tgz $RELEASENAME/ | |
60 | ||
61 | echo "Building $RELEASENAME.tbz2 from $RELEASENAME/" | |
62 | tar jcf $RELEASENAME.tbz2 $RELEASENAME/ | |
63 | ||
64 | PUBLISH="yes" | |
65 | ||
66 | ok="0" | |
67 | if [ "x$AUTOMATIC" != "xyes" ]; then | |
68 | echo | |
69 | echo "Would you like to publish these releases now?" | |
70 | while [ $ok -eq 0 ]; do | |
71 | echo -n "[$PUBLISH] " | |
72 | ||
73 | read INPUT | |
74 | case $INPUT in | |
75 | [Yy]*) | |
76 | PUBLISH="yes" | |
77 | ok=1 | |
78 | ;; | |
79 | [Nn]*) | |
80 | PUBLISH="no" | |
81 | ok=1 | |
82 | ;; | |
83 | esac | |
84 | done | |
85 | fi | |
86 | ||
87 | if [ "x$PUBLISH" = "xyes" ]; then | |
98fd0427 JT |
88 | scp $RELEASENAME.tgz hg.atheme.org:/srv/distfiles |
89 | scp $RELEASENAME.tbz2 hg.atheme.org:/srv/distfiles | |
4bf178c5 JT |
90 | |
91 | echo | |
92 | echo "The releases have been published, and will be available to the entire" | |
93 | echo "distribution network within 15 minutes." | |
94 | fi | |
95 | ||
96 | echo | |
97 | echo "Done. If you have any bugs to report, report them against" | |
98 | echo "the distfiles.atheme.org component at http://bugzilla.atheme.org" | |
99 | echo "Thanks!" | |
100 | echo |