Add include of cairo.h when using librsvg
[dana/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 build_and_test() {
14   style=$1
15   make >/dev/null 2>/dev/null || error "make failed ($style)"
16   ./obt/obt_unittests > /dev/null || error "unittest failed ($style)"
17   make distclean >/dev/null || error "make distclean failed"
18 }
19
20 REV="$1"
21 test -z "$REV" && help
22 VERSION="$2"
23 test -z "$VERSION" && help
24 LAST="$3"
25
26 . release/common
27
28 #### CONFIRM SHORTLOG #####
29
30 echo Shortlog from previous release:
31 echo "$SHORTLOG"
32 echo
33 echo Shortlog from $LAST contains $(echo "$SHORTLOG"|wc -l) lines
34 echo -n "ok? (y/n) "
35 read a
36 test "$a" = "y" || error "aborted"
37
38 #### TEST english po VERSIONS ####
39
40 BAD_PO="$(grep Project-Id-Version po/en*.po|grep -v "openbox $VERSION\\\\n")"
41 test -z "$BAD_PO" || error "wrong version in po files" "$BAD_PO"
42
43 #### RESET THE REPO TO A CLEAN STATE ####
44
45 git clean -f -x -d -q
46
47 #### TEST ALL OPTIONAL COMPILATION FLAGS ####
48
49 # check that it builds
50 echo Bootstrapping
51 ./bootstrap >/dev/null 2>/dev/null || "bootstrap failed"
52
53 echo Check compile with debug and all options enabled
54 CFLAGS="-Werror -isystem /usr/lib/glib-2.0" \
55 ./configure -C --enable-debug >/dev/null || \
56   error "configure (with debug) failed"
57 build_and_test "with debug and Werror"
58
59 # check that it builds with each optional featureset
60 echo Check compile with all options enabled
61 ./configure -C >/dev/null || \
62   error "configure failed"
63 grep "XKB 1" config.log >/dev/null || error "missing xkb extension"
64 grep "XRANDR 1" config.log >/dev/null || error "missing xrandr extension"
65 grep "XINERAMA 1" config.log >/dev/null || error "missing xinerama extension"
66 grep "SYNC 1" config.log >/dev/null || error "missing sync extension"
67 grep "USE_XCURSOR 1" config.log >/dev/null || error "missing xcursor extension"
68 grep "USE_IMLIB2 1" config.log >/dev/null || error "missing imlib2 library"
69 grep "USE_LIBRSVG 1" config.log >/dev/null || error "missing librsvg library"
70 grep "USE_SM 1" config.log >/dev/null || error "missing session management extension"
71 build_and_test
72
73 echo Check compile with startup notification disabled
74 ./configure -C --disable-startup-notification >/dev/null || \
75   error "configure failed"
76 build_and_test "with --disable-startup-notification"
77
78 echo Check compile with xcursor disabled
79 ./configure -C --disable-xcursor >/dev/null || \
80   error "configure failed"
81 build_and_test "with --disable-xcursor"
82
83 echo Check compile with imlib2 disabled
84 ./configure -C --disable-imlib2 >/dev/null || \
85   error "configure failed"
86 build_and_test "with --disable-imlib2"
87
88 echo Check compile with librsvg disabled
89 ./configure -C --disable-librsvg >/dev/null || \
90   error "configure failed"
91 build_and_test "with --disable-librsvg"
92
93 echo Check compile with session management disabled
94 ./configure -C --disable-session-management >/dev/null || \
95   error "configure failed"
96 build_and_test "with --disable-session-management"
97
98 echo Check compile with xkb disabled
99 ./configure -C --disable-xkb >/dev/null || error "configure failed"
100 build_and_test "with --disable-xkb"
101
102 echo Check compile with xrandr disabled
103 ./configure -C --disable-xrandr >/dev/null || error "configure failed"
104 build_and_test "with --disable-xrandr"
105
106 echo Check compile with xinerama disabled
107 ./configure -C --disable-xinerama >/dev/null || error "configure failed"
108 build_and_test("with --disable-xinerama")
109
110 echo Check compile with xsync disabled
111 ./configure -C --disable-xsync >/dev/null || error "configure failed"
112 build_and_test("with --disable-xsync")
113
114 # check that it installs sanely
115 echo Check installation correctness
116 ./configure -C >/dev/null || \
117   error "configure failed"
118 make distcheck >/dev/null || \
119   error "make distcheck failed"
120
121 # VERIFY TARBALL
122
123 TAR="openbox-$VERSION.tar.gz"
124 ASC="openbox-$VERSION.tar.gz.asc"
125
126 echo Found Openbox release tarball:
127 ls -d openbox-*.tar.gz
128 test -e "$TAR" || \
129   error "Specified version does not match configure.ac"
130
131 # SIGN THE TARBALL
132
133 echo Signing the release tarball:
134 gpg --sign --detach-sign --armor "$TAR"
135 test $? = 0 || \
136   error "Failed to sign release tarball"
137
138 echo Tagging the release:
139 git tag -s -m "tagging the $VERSION release" "release-$VERSION" $REV || \
140   error "Failed to tag the release"
141
142 mv "$TAR" "$ASC" "$SRCDIR"
143
144 echo "=$VERSION="
145 echo "$CLNOWRAP"
146 echo
147 echo
148 echo Edit download page:
149 echo "  http://openbox.org/oldwiki/index.php?title=Openbox:Download&action=edit&section=1"
150 echo
151 echo Edit changelog:
152 echo "  http://openbox.org/oldwiki/index.php?title=Openbox:Changelog&action=edit&section=1"
153 echo
154 echo Add the version to the bug tracker:
155 echo "  https://bugzilla.icculus.org/editversions.cgi?action=add&product=Openbox"
156 echo
157 echo Push the tag:
158 echo "  git push origin tag release-$VERSION"
159 echo
160 echo Email:
161 echo "  ./release/email $*"
162 echo
163 echo Update IRC topic and have a beer/juice!
164 echo
165 cd "$SRCDIR"
166 ls -l "$TAR" "$ASC"
167
168 clean
169 exit 0