Rename bounds to monitor in place_overlap and move a const
[mikachu/openbox.git] / release / go
1 #!/bin/sh
2
3 help() {
4   echo "Usage: $0 <revision> <version> [lastrelease]"
5   echo
6   echo "  <revision>    The revision which should be used for release."
7   echo "  <version>     The version of the release."
8   echo "  [lastrelease] The revision of the most recent release made."
9   echo "                By default it uses the most recent release-tag."
10   exit 1
11 }
12
13 REV="$1"
14 test -z "$REV" && help
15 VERSION="$2"
16 test -z "$VERSION" && help
17 LAST="$3"
18
19 . release/common
20
21 #### CONFIRM SHORTLOG #####
22
23 echo Shortlog from previous release:
24 echo "$SHORTLOG"
25 echo
26 echo Shortlog from $LAST contains $(echo "$SHORTLOG"|wc -l) lines
27 echo -n "ok? (y/n) "
28 read a
29 test "$a" = "y" || error "aborted"
30
31 #### TEST english po VERSIONS ####
32
33 BAD_PO="$(grep Project-Id-Version po/en*.po|grep -v "openbox $VERSION\\\\n")"
34 test -z "$BAD_PO" || error "wrong version in po files" "$BAD_PO"
35
36 #### TEST COMPILATION ####
37
38 # check that it builds
39 ./bootstrap >/dev/null || "bootstrap failed"
40 #CFLAGS="-Werror -isystem /usr/lib/glib-2.0" \
41 ./configure -C --enable-debug >/dev/null || \
42   error "configure (with debug) failed"
43 make || error "make (with debug and Werror) failed"
44 git clean -f -x -d -q
45
46 # check that it builds with each optional featureset
47 ./bootstrap >/dev/null || "bootstrap failed"
48
49 echo Check compile with all options enabled
50 ./configure -C >/dev/null || \
51   error "configure failed"
52 make >/dev/null 2>/dev/null || \
53   error "make failed"
54 grep "XKB 1" config.log >/dev/null || error "missing xkb extension"
55 grep "XRANDR 1" config.log >/dev/null || error "missing xrandr extension"
56 grep "XINERAMA 1" config.log >/dev/null || error "missing xinerama extension"
57 grep "SYNC 1" config.log >/dev/null || error "missing sync extension"
58 make clean >/dev/null || error "make clean failed"
59
60 echo Check compile with startup notification disabled
61 ./configure -C --disable-startup-notification >/dev/null || \
62   error "configure failed"
63 make >/dev/null 2>/dev/null || \
64   error "make (with --disable-startup-notification) failed"
65 make clean >/dev/null || error "make clean failed"
66
67 echo Check compile with xcursor disabled
68 ./configure -C --disable-xcursor >/dev/null || \
69   error "configure failed"
70 make >/dev/null 2>/dev/null || \
71   error "make (with --disable-xcursor) failed"
72 make clean >/dev/null || error "make clean failed"
73
74 echo Check compile with imlib2 disabled
75 ./configure -C --disable-imlib2 >/dev/null || \
76   error "configure failed"
77 make >/dev/null 2>/dev/null || \
78   error "make (with --disable-imlib2) failed"
79 make clean >/dev/null || error "make clean failed"
80
81 echo Check compile with session management disabled
82 ./configure -C --disable-session-management >/dev/null || \
83   error "configure failed"
84 make >/dev/null 2>/dev/null || \
85   error "make (with --disable-session-management) failed"
86 make clean >/dev/null || error "make clean failed"
87
88 echo Check compile with xkb disabled
89 ./configure -C --disable-xkb >/dev/null || error "configure failed"
90 make >/dev/null 2>/dev/null || error "make (with --disable-xkb) failed"
91 make clean >/dev/null || error "make clean failed"
92
93 echo Check compile with xrandr disabled
94 ./configure -C --disable-xrandr >/dev/null || error "configure failed"
95 make >/dev/null 2>/dev/null || error "make (with --disable-xrandr) failed"
96 make clean >/dev/null || error "make clean failed"
97
98 echo Check compile with xinerama disabled
99 ./configure -C --disable-xinerama >/dev/null || error "configure failed"
100 make >/dev/null 2>/dev/null || error "make (with --disable-xinerama) failed"
101 make clean >/dev/null || error "make clean failed"
102
103 echo Check compile with xsync disabled
104 ./configure -C --disable-xsync >/dev/null || error "configure failed"
105 make >/dev/null 2>/dev/null || error "make (with --disable-xsync) failed"
106 make clean >/dev/null || error "make clean failed"
107
108 # check that it installs sanely
109 echo Check installation correctness
110 ./configure -C >/dev/null || \
111   error "configure failed"
112 make distcheck >/dev/null || \
113   error "make distcheck failed"
114
115 # VERIFY TARBALL
116
117 TAR="openbox-$VERSION.tar.gz"
118 ASC="openbox-$VERSION.tar.gz.asc"
119
120 echo Found Openbox release tarball:
121 ls -d openbox-*.tar.gz
122 test -e "$TAR" || \
123   error "Specified version does not match configure.am"
124
125 # SIGN THE TARBALL
126
127 echo Signing the release tarball:
128 gpg --sign --detach-sign --armor "$TAR"
129 test $? = 0 || \
130   error "Failed to sign release tarball"
131
132 echo Tagging the release:
133 git tag -s -m "tagging the $VERSION release" "release-$VERSION" $REV || \
134   error "Failed to tag the release"
135
136 mv "$TAR" "$ASC" "$SRCDIR"
137
138 echo "=$VERSION="
139 echo "$CLNOWRAP"
140 echo
141 echo
142 echo Edit download page:
143 echo "  http://openbox.org/oldwiki/index.php?title=Openbox:Download&action=edit&section=1"
144 echo
145 echo Edit changelog:
146 echo "  http://openbox.org/oldwiki/index.php?title=Openbox:Changelog&action=edit&section=1"
147 echo
148 echo Push the tag:
149 echo "  git push origin tag release-$VERSION"
150 echo
151 echo Email:
152 echo "  ./release/email $*"
153 echo
154 cd "$SRCDIR"
155 ls -l "$TAR" "$ASC"
156
157 clean
158 exit 0