Merge lp:~smspillaz/compiz-core/compiz-core.dist-buildsystem into lp:compiz-core/trunk
- compiz-core.dist-buildsystem
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 2760 |
Proposed branch: | lp:~smspillaz/compiz-core/compiz-core.dist-buildsystem |
Merge into: | lp:compiz-core/trunk |
Diff against target: |
394 lines (+287/-32) 5 files modified
CMakeLists.txt (+7/-7) VERSION (+1/-0) cmake/CompizCommon.cmake (+272/-20) cmake/CompizPlugin.cmake (+6/-0) include/compiz-common.h.in (+1/-5) |
To merge this branch: | bzr merge lp:~smspillaz/compiz-core/compiz-core.dist-buildsystem |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jason Smith (community) | Approve | ||
Review via email: mp+67100@code.launchpad.net |
Commit message
Description of the change
Adds new release targets to the buildsystem
make release-prep: generates NEWS ChangeLog and AUTHORS file
make distcheck: generates a tarball
make release-signoff: signs the tarball using the key in RELEASE_KEY and if
in a git repository, creates tags and branches for that
- 2760. By Sam Spilsbury
-
Add various fixes for distcheck, source distributions without a VCS
and non-C sources (eg python bindings where we can't do try_compile
because C and CXX are not in the enabled languages)
Aurélien Gâteau (agateau) wrote : | # |
- 2761. By Sam Spilsbury
-
Drop support for bz2, add targets for release uploads, cleanup
Aurélien Gâteau (agateau) wrote : | # |
Looks nicer, just two minor nitpicks:
1. The "if" cmake command allows you to simplify the tests from "if (${IS_GIT_REPO})" to "if (IS_GIT_REPO)".
2. There is some commented code, not sure if it is intentional or not.
- 2762. By Sam Spilsbury
-
Nitpicking and fix FTBFS on bzr
Jason Smith (jassmith) wrote : | # |
Can this be run by someone without commit access to compiz?
Sam Spilsbury (smspillaz) wrote : | # |
Yes, the targets are independent of each other
release-prep: updates the NEWS, ChangeLog, AUTHORS (in /build, NOT in the working tree)
distcheck: checks for build failure, does tests
release-signoff: creates git branches, tags, copies NEWS etc into working tree, commits, updates tarball, signs it + checksums it and bumps VERSION
release-push: pushes objects into git
release-upload: uploads tarball to releases.compiz.org
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2011-07-06 19:52:01 +0000 | |||
3 | +++ CMakeLists.txt 2011-07-07 16:29:45 +0000 | |||
4 | @@ -15,13 +15,10 @@ | |||
5 | 15 | set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (Debug/Release/RelWithDebInfo/MinSizeRe)" FORCE) | 15 | set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (Debug/Release/RelWithDebInfo/MinSizeRe)" FORCE) |
6 | 16 | endif (NOT CMAKE_BUILD_TYPE) | 16 | endif (NOT CMAKE_BUILD_TYPE) |
7 | 17 | 17 | ||
15 | 18 | # compiz package version number | 18 | file (READ ${CMAKE_SOURCE_DIR}/VERSION COMPIZ_RELEASE_VERSION LIMIT 12 OFFSET 0) |
16 | 19 | # An odd micro number indicates in-progress development. | 19 | string (STRIP ${COMPIZ_RELEASE_VERSION} COMPIZ_RELEASE_VERSION) |
17 | 20 | # An even micro number indicates a released version. | 20 | |
18 | 21 | set (COMPIZ_VERSION_MAJOR 0) | 21 | set (VERSION ${COMPIZ_RELEASE_VERSION}) |
12 | 22 | set (COMPIZ_VERSION_MINOR 9) | ||
13 | 23 | set (COMPIZ_VERSION_MICRO 5) | ||
14 | 24 | set (VERSION ${COMPIZ_VERSION_MAJOR}.${COMPIZ_VERSION_MINOR}.${COMPIZ_VERSION_MICRO}) | ||
19 | 25 | 22 | ||
20 | 26 | set (DECOR_INTERFACE_VERSION 20110504) | 23 | set (DECOR_INTERFACE_VERSION 20110504) |
21 | 27 | 24 | ||
22 | @@ -126,6 +123,9 @@ | |||
23 | 126 | compiz_package_generation ("Compiz") | 123 | compiz_package_generation ("Compiz") |
24 | 127 | compiz_add_uninstall () | 124 | compiz_add_uninstall () |
25 | 128 | compiz_add_git_dist () | 125 | compiz_add_git_dist () |
26 | 126 | compiz_add_distcheck () | ||
27 | 127 | compiz_add_release () | ||
28 | 128 | compiz_add_release_signoff () | ||
29 | 129 | 129 | ||
30 | 130 | _print_configure_results () | 130 | _print_configure_results () |
31 | 131 | 131 | ||
32 | 132 | 132 | ||
33 | === added file 'VERSION' | |||
34 | --- VERSION 1970-01-01 00:00:00 +0000 | |||
35 | +++ VERSION 2011-07-07 16:29:45 +0000 | |||
36 | @@ -0,0 +1,1 @@ | |||
37 | 1 | 0.9.5.0 | ||
38 | 0 | 2 | ||
39 | === modified file 'cmake/CompizCommon.cmake' | |||
40 | --- cmake/CompizCommon.cmake 2011-02-22 11:27:28 +0000 | |||
41 | +++ cmake/CompizCommon.cmake 2011-07-07 16:29:45 +0000 | |||
42 | @@ -49,6 +49,24 @@ | |||
43 | 49 | set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") | 49 | set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") |
44 | 50 | endif () | 50 | endif () |
45 | 51 | 51 | ||
46 | 52 | if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git) | ||
47 | 53 | set(IS_GIT_REPO 1) | ||
48 | 54 | else (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git) | ||
49 | 55 | set(IS_GIT_REPO 0) | ||
50 | 56 | endif (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git) | ||
51 | 57 | |||
52 | 58 | if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.gitmodules) | ||
53 | 59 | set(IS_GIT_SUBMODULES_REPO 1) | ||
54 | 60 | else (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.gitmodules) | ||
55 | 61 | set(IS_GIT_SUBMODULES_REPO 0) | ||
56 | 62 | endif (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.gitmodules) | ||
57 | 63 | |||
58 | 64 | if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.bzr) | ||
59 | 65 | set(IS_BZR_REPO 1) | ||
60 | 66 | elseif (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.bzr) | ||
61 | 67 | set(IS_BZR_REPO 0) | ||
62 | 68 | endif (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.bzr) | ||
63 | 69 | |||
64 | 52 | function (compiz_ensure_linkage) | 70 | function (compiz_ensure_linkage) |
65 | 53 | find_program (LDCONFIG_EXECUTABLE ldconfig) | 71 | find_program (LDCONFIG_EXECUTABLE ldconfig) |
66 | 54 | mark_as_advanced (FORCE LDCONFIG_EXECUTABLE) | 72 | mark_as_advanced (FORCE LDCONFIG_EXECUTABLE) |
67 | @@ -64,12 +82,243 @@ | |||
68 | 64 | endfunction () | 82 | endfunction () |
69 | 65 | 83 | ||
70 | 66 | macro (compiz_add_git_dist) | 84 | macro (compiz_add_git_dist) |
77 | 67 | set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${VERSION}) | 85 | |
78 | 68 | add_custom_target(dist | 86 | # Try to use the git and bzr inbuilt functions for generating |
79 | 69 | COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD | 87 | # archives first, otherwise do it manually |
80 | 70 | | bzip2 > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2 | 88 | if (${IS_GIT_REPO}) |
81 | 71 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | 89 | |
82 | 72 | endmacro () | 90 | if (${IS_GIT_SUBMODULES_REPO}) |
83 | 91 | find_program (GIT_ARCHIVE_ALL git-archive-all.sh) | ||
84 | 92 | |||
85 | 93 | if (NOT (${GIT_ARCHIVE_ALL} STREQUAL "GIT_ARCHIVE_ALL-NOTFOUND")) | ||
86 | 94 | add_custom_target (dist ${GIT_ARCHIVE_ALL} --prefix ${CMAKE_PROJECT_NAME}-${VERSION}/ ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar | ||
87 | 95 | COMMAND bzip2 ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar | ||
88 | 96 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
89 | 97 | COMMENT "Creating bz2 archive") | ||
90 | 98 | else (NOT (${GIT_ARCHIVE_ALL} STREQUAL "GIT_ARCHIVE_ALL-NOTFOUND")) | ||
91 | 99 | message ("[WARNING]: git-archive-all.sh is needed to make releases of git submodules, get it from https://github.com/meitar/git-archive-all.sh.git and install it into your PATH") | ||
92 | 100 | endif (NOT (${GIT_ARCHIVE_ALL} STREQUAL "GIT_ARCHIVE_ALL-NOTFOUND")) | ||
93 | 101 | else (${IS_GIT_SUBMODULES_REPO}) | ||
94 | 102 | add_custom_target (dist git archive --format=tar --prefix ${CMAKE_PROJECT_NAME}-${VERSION}/ -o ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar HEAD | ||
95 | 103 | COMMAND bzip2 ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar | ||
96 | 104 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
97 | 105 | COMMENT "Creating bz2 archive") | ||
98 | 106 | endif (${IS_GIT_SUBMODULES_REPO}) | ||
99 | 107 | else (${IS_GIT_REPO}) | ||
100 | 108 | if (${IS_BZR_REPO}) | ||
101 | 109 | add_custom_target (dist | ||
102 | 110 | COMMAND bzr export --root=${CMAKE_PROJECT_NAME}-${VERSION} ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 | ||
103 | 111 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) | ||
104 | 112 | else (${IS_BZR_REPO}) | ||
105 | 113 | add_custom_target (dist) | ||
106 | 114 | #add_custom_target (dist | ||
107 | 115 | # COMMAND tar -cvf ${CMAKE_SOURCE_DIR} | bzip2 > ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 | ||
108 | 116 | # WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../) | ||
109 | 117 | endif (${IS_BZR_REPO}) | ||
110 | 118 | endif (${IS_GIT_REPO}) | ||
111 | 119 | |||
112 | 120 | endmacro () | ||
113 | 121 | |||
114 | 122 | macro (compiz_add_distcheck) | ||
115 | 123 | add_custom_target (distcheck | ||
116 | 124 | COMMAND mkdir -p ${CMAKE_BINARY_DIR}/dist-build | ||
117 | 125 | && cp ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 ${CMAKE_BINARY_DIR}/dist-build | ||
118 | 126 | && cd ${CMAKE_BINARY_DIR}/dist-build | ||
119 | 127 | && tar xvf ${CMAKE_BINARY_DIR}/dist-build/${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 | ||
120 | 128 | && mkdir -p ${CMAKE_BINARY_DIR}/dist-build/${CMAKE_PROJECT_NAME}-${VERSION}/build | ||
121 | 129 | && cd ${CMAKE_BINARY_DIR}/dist-build/${CMAKE_PROJECT_NAME}-${VERSION}/build | ||
122 | 130 | && cmake -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/dist-build/buildroot -DCOMPIZ_PLUGIN_INSTALL_TYPE='package' .. -DCMAKE_MODULE_PATH=/usr/share/cmake -DCOMPIZ_DISABLE_PLUGIN_KDE=ON | ||
123 | 131 | && make -j4 | ||
124 | 132 | && make -j4 install | ||
125 | 133 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
126 | 134 | add_dependencies (distcheck dist) | ||
127 | 135 | endmacro () | ||
128 | 136 | |||
129 | 137 | macro (compiz_add_release_signoff) | ||
130 | 138 | |||
131 | 139 | add_custom_target (release-signoff) | ||
132 | 140 | |||
133 | 141 | add_custom_target (release-update-working-tree | ||
134 | 142 | COMMAND cp NEWS ${CMAKE_SOURCE_DIR} && | ||
135 | 143 | cp AUTHORS ${CMAKE_SOURCE_DIR} && | ||
136 | 144 | cp ChangeLog ${CMAKE_SOURCE_DIR}) | ||
137 | 145 | |||
138 | 146 | if (${IS_GIT_REPO}) | ||
139 | 147 | add_custom_target (release-commits | ||
140 | 148 | COMMAND git commit -a -m "Update NEWS for ${VERSION}" | ||
141 | 149 | COMMENT "Release Commit" | ||
142 | 150 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
143 | 151 | add_custom_target (release-tags | ||
144 | 152 | COMMAND git tag -u $ENV{RELEASE_KEY} compiz-${VERSION} HEAD -m "Compiz ${VERSION} Release" | ||
145 | 153 | COMMENT "Release Tags" | ||
146 | 154 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
147 | 155 | add_custom_target (release-branch | ||
148 | 156 | COMMAND git checkout -b compiz-${VERSION}-series && | ||
149 | 157 | touch RELEASED && | ||
150 | 158 | git add RELEASED && | ||
151 | 159 | cat VERSION > RELEASED && | ||
152 | 160 | git commit -a -m "Add RELEASED file" | ||
153 | 161 | COMMENT "Release Branch" | ||
154 | 162 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
155 | 163 | add_custom_target (release-update-dist | ||
156 | 164 | COMMAND git checkout master && | ||
157 | 165 | rm ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 && | ||
158 | 166 | make dist | ||
159 | 167 | COMMENT "Updating bz2 archive" | ||
160 | 168 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
161 | 169 | add_custom_target (release-version-bump | ||
162 | 170 | COMMAND git checkout master && | ||
163 | 171 | $ENV{EDITOR} VERSION && | ||
164 | 172 | git add VERSION && | ||
165 | 173 | git commit VERSION -m "Bump VERSION" | ||
166 | 174 | COMMENT "Bumping VERSION" | ||
167 | 175 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
168 | 176 | else (${IS_GIT_REPO}) | ||
169 | 177 | add_custom_target (release-commits) | ||
170 | 178 | add_custom_target (release-tags) | ||
171 | 179 | add_custom_target (release-branch) | ||
172 | 180 | add_custom_target (release-update-dist) | ||
173 | 181 | add_custom_target (release-version-bump) | ||
174 | 182 | |||
175 | 183 | endif (${IS_GIT_REPO}) | ||
176 | 184 | |||
177 | 185 | add_custom_target (release-sign-tarballs | ||
178 | 186 | COMMAND gpg --armor --sign --detach-sig ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 | ||
179 | 187 | COMMENT "Signing tarball" | ||
180 | 188 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
181 | 189 | add_custom_target (release-sha1-tarballs | ||
182 | 190 | COMMAND sha1sum ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 > ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2.sha1 | ||
183 | 191 | COMMENT "SHA1Summing tarball" | ||
184 | 192 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
185 | 193 | add_custom_target (release-sign-sha1-tarballs | ||
186 | 194 | COMMAND gpg --armor --sign --detach-sig ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2.sha1 | ||
187 | 195 | COMMENT "Signing SHA1Sum checksum" | ||
188 | 196 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
189 | 197 | |||
190 | 198 | add_dependencies (release-commits release-update-working-tree) | ||
191 | 199 | add_dependencies (release-tags release-commits) | ||
192 | 200 | add_dependencies (release-branch release-tags) | ||
193 | 201 | add_dependencies (release-update-dist release-branch) | ||
194 | 202 | add_dependencies (release-version-bump release-update-dist) | ||
195 | 203 | add_dependencies (release-sign-tarballs release-version-bump) | ||
196 | 204 | add_dependencies (release-sha1-tarballs release-sign-tarballs) | ||
197 | 205 | add_dependencies (release-sign-sha1-tarballs release-sha1-tarballs) | ||
198 | 206 | |||
199 | 207 | # This means that releasing needs to be done from a git repo for now | ||
200 | 208 | # But that's fine | ||
201 | 209 | add_dependencies (release-signoff release-sign-sha1-tarballs) | ||
202 | 210 | |||
203 | 211 | # Actually pushes the release | ||
204 | 212 | if (${IS_GIT_REPO}) | ||
205 | 213 | add_custom_target (push-master | ||
206 | 214 | COMMAND git push origin master | ||
207 | 215 | COMMENT "Pushing to master" | ||
208 | 216 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
209 | 217 | add_custom_target (push-release-branch | ||
210 | 218 | COMMAND git push origin compiz-${VERISON}-series | ||
211 | 219 | COMMENT "Pushing to compiz-${VERISON}-series" | ||
212 | 220 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
213 | 221 | add_custom_target (push-tag | ||
214 | 222 | COMMAND git push origin compiz-${VERSION} | ||
215 | 223 | COMMENT "Pushing tag compiz-${VERSION}" | ||
216 | 224 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
217 | 225 | else (${IS_GIT_REPO}) | ||
218 | 226 | add_custom_target (push-master) | ||
219 | 227 | add_custom_target (push-release-branch) | ||
220 | 228 | add_custom_target (push-tag) | ||
221 | 229 | endif (${IS_GIT_REPO}) | ||
222 | 230 | |||
223 | 231 | add_custom_target (release-push) | ||
224 | 232 | |||
225 | 233 | add_dependencies (release-push push-release-branch) | ||
226 | 234 | add_dependencies (push-release-branch push-tag) | ||
227 | 235 | add_dependencies (push-tag push-master) | ||
228 | 236 | |||
229 | 237 | # Push the tarball to releases.compiz.org | ||
230 | 238 | set (COMPIZ_RELEASE_UPLOAD_HOST releases.compiz.org) | ||
231 | 239 | set (COMPIZ_RELEASE_UPLOAD_BASE /home/releases) | ||
232 | 240 | set (COMPIZ_RELEASE_UPLOAD_DIR_VERSION ${COMPIZ_RELEASE_UPLOAD_BASE}/${VERSION}/) | ||
233 | 241 | set (COMPIZ_RELEASE_UPLOAD_DIR_COMPONENT ${COMPIZ_RELEASE_UPLOAD_BASE}/components/${CMAKE_PROJECT_NAME}) | ||
234 | 242 | |||
235 | 243 | message ("releasing to " ${COMPIZ_RELEASE_UPLOAD_HOST}) | ||
236 | 244 | message (" base: " ${COMPIZ_RELEASE_UPLOAD_BASE}) | ||
237 | 245 | message (" version: " ${COMPIZ_RELEASE_UPLOAD_BASE}/${VERSION}) | ||
238 | 246 | message (" component: ${COMPIZ_RELEASE_UPLOAD_BASE}/components/${CMAKE_PROJECT_NAME}") | ||
239 | 247 | |||
240 | 248 | add_custom_target (release-upload-version | ||
241 | 249 | COMMAND ssh $ENV{USER}@${COMPIZ_RELEASE_UPLOAD_HOST} "mkdir -p ${COMPIZ_RELEASE_UPLOAD_BASE}/${VERSION}" && scp ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 $ENV{USER}@${COMPIZ_RELEASE_UPLOAD_HOST}:${COMPIZ_RELEASE_UPLOAD_DIR_VERSION} | ||
242 | 250 | COMMENT "Uploading ${CMAKE_PROJECT_NAME}-${VERSION} to ${VERSION}" | ||
243 | 251 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
244 | 252 | |||
245 | 253 | # Does nothing for now | ||
246 | 254 | add_custom_target (release-upload-component) | ||
247 | 255 | #add_custom_target (release-upload-component | ||
248 | 256 | # COMMAND ssh $ENV{USER}@${COMPIZ_RELEASE_UPLOAD_HOST} "mkdir -p ${COMPIZ_RELEASE_UPLOAD_BASE}/${VERSION}" && scp ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2.asc ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2.sha1 ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2.sha1.asc $ENV{USER}@${COMPIZ_RELEASE_UPLOAD_HOST}:${COMPIZ_RELEASE_UPLOAD_BASE_DIR_COMPONENT} | ||
249 | 257 | # COMMENT "Uploading ${CMAKE_PROJECT_NAME}-${VERSION} to ${CMAKE_PROJECT_NAME}/${VERSION}" | ||
250 | 258 | # WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
251 | 259 | |||
252 | 260 | add_custom_target (release-upload) | ||
253 | 261 | |||
254 | 262 | add_dependencies (release-upload-component release-upload-version) | ||
255 | 263 | add_dependencies (release-upload release-upload-component) | ||
256 | 264 | |||
257 | 265 | endmacro () | ||
258 | 266 | |||
259 | 267 | macro (compiz_add_release) | ||
260 | 268 | |||
261 | 269 | if (${IS_GIT_REPO}) | ||
262 | 270 | find_program (GEN_GIT_LOG gen-git-log.sh) | ||
263 | 271 | add_custom_target (authors | ||
264 | 272 | COMMAND git shortlog -se | cut -c8- > AUTHORS | ||
265 | 273 | COMMENT "Generating AUTHORS" | ||
266 | 274 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
267 | 275 | if (NOT (${GEN_GIT_LOG} STREQUAL "GEN_GIT_LOG-NOTFOUND")) | ||
268 | 276 | add_custom_target (changelog | ||
269 | 277 | COMMAND ${GEN_GIT_LOG} > ChangeLog | ||
270 | 278 | COMMENT "Generating ChangeLog" | ||
271 | 279 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
272 | 280 | else (NOT (${GEN_GIT_LOG} STREQUAL "GEN_GIT_LOG-NOTFOUND")) | ||
273 | 281 | message ("[WARNING]: gen-git-log.sh is required to make releases, ensure that it is installed into your PATH") | ||
274 | 282 | endif (NOT (${GEN_GIT_LOG} STREQUAL "GEN_GIT_LOG-NOTFOUND")) | ||
275 | 283 | |||
276 | 284 | add_custom_target (news-header echo 'Release ${VERSION} ('`date +%Y-%m-%d`' '`git config user.name`' <'`git config user.email`'>)' > ${CMAKE_BINARY_DIR}/NEWS.update && seq -s "=" `cat ${CMAKE_BINARY_DIR}/NEWS.update | wc -c` | sed 's/[0-9]//g' >> ${CMAKE_BINARY_DIR}/NEWS.update && $ENV{EDITOR} ${CMAKE_BINARY_DIR}/NEWS.update && echo >> ${CMAKE_BINARY_DIR}/NEWS.update | ||
277 | 285 | COMMAND $ENV{EDITOR} ${CMAKE_BINARY_DIR}/NEWS.update | ||
278 | 286 | COMMENT "Generating NEWS Header" | ||
279 | 287 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
280 | 288 | else (${IS_GIT_REPO}) | ||
281 | 289 | if (${IS_BZR_REPO}) | ||
282 | 290 | add_custom_target (authors | ||
283 | 291 | COMMAND bzr log --long --levels=0 | grep -e "^\\s*author:" -e "^\\s*committer:" | cut -d ":" -f 2 | sort -u > AUTHORS | ||
284 | 292 | COMMENT "Generating AUTHORS") | ||
285 | 293 | add_custom_target (changelog | ||
286 | 294 | COMMAND bzr log --gnu-changelog > ChangeLog | ||
287 | 295 | COMMENT "Generating ChangeLog") | ||
288 | 296 | |||
289 | 297 | add_custom_target (news-header echo > ${CMAKE_BINARY_DIR}/NEWS.update | ||
290 | 298 | COMMAND echo 'Release ${VERSION} ('`date +%Y-%m-%d`' '`bzr config email`')' > ${CMAKE_BINARY_DIR}/NEWS.update && seq -s "=" `cat ${CMAKE_BINARY_DIR}/NEWS.update | wc -c` | sed 's/[0-9]//g' >> ${CMAKE_BINARY_DIR}/NEWS.update && $ENV{EDITOR} ${CMAKE_BINARY_DIR}/NEWS.update && echo >> ${CMAKE_BINARY_DIR}/NEWS.update | ||
291 | 299 | COMMENT "Generating NEWS Header" | ||
292 | 300 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | ||
293 | 301 | else (${IS_BZR_REPO}) | ||
294 | 302 | add_custom_target (authors) | ||
295 | 303 | add_custom_target (changelog) | ||
296 | 304 | add_custom_target (news-header) | ||
297 | 305 | endif (${IS_BZR_REPO}) | ||
298 | 306 | endif (${IS_GIT_REPO}) | ||
299 | 307 | |||
300 | 308 | add_custom_target (news | ||
301 | 309 | COMMAND cat ${CMAKE_SOURCE_DIR}/NEWS > NEWS.old && | ||
302 | 310 | cat NEWS.old >> ${CMAKE_BINARY_DIR}/NEWS.update && | ||
303 | 311 | cat NEWS.update > NEWS | ||
304 | 312 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
305 | 313 | |||
306 | 314 | add_dependencies (changelog authors) | ||
307 | 315 | add_dependencies (news-header changelog) | ||
308 | 316 | add_dependencies (news news-header) | ||
309 | 317 | |||
310 | 318 | add_custom_target (release-prep) | ||
311 | 319 | add_dependencies (release-prep news) | ||
312 | 320 | |||
313 | 321 | endmacro (compiz_add_release) | ||
314 | 73 | 322 | ||
315 | 74 | # unsets the given variable | 323 | # unsets the given variable |
316 | 75 | macro (compiz_unset var) | 324 | macro (compiz_unset var) |
317 | @@ -120,6 +369,7 @@ | |||
318 | 120 | endfunction () | 369 | endfunction () |
319 | 121 | 370 | ||
320 | 122 | function (compiz_add_plugins_in_folder folder) | 371 | function (compiz_add_plugins_in_folder folder) |
321 | 372 | set (COMPIZ_PLUGIN_PACK_BUILD 1) | ||
322 | 123 | file ( | 373 | file ( |
323 | 124 | GLOB _plugins_in | 374 | GLOB _plugins_in |
324 | 125 | RELATIVE "${folder}" | 375 | RELATIVE "${folder}" |
325 | @@ -256,21 +506,23 @@ | |||
326 | 256 | endmacro () | 506 | endmacro () |
327 | 257 | 507 | ||
328 | 258 | #posix 2008 scandir check | 508 | #posix 2008 scandir check |
337 | 259 | include (CheckCXXSourceCompiles) | 509 | if (CMAKE_CXX_COMPILER) |
338 | 260 | CHECK_CXX_SOURCE_COMPILES ( | 510 | include (CheckCXXSourceCompiles) |
339 | 261 | "# include <dirent.h> | 511 | CHECK_CXX_SOURCE_COMPILES ( |
340 | 262 | int func (const char *d, dirent ***list, void *sort) | 512 | "# include <dirent.h> |
341 | 263 | { | 513 | int func (const char *d, dirent ***list, void *sort) |
342 | 264 | int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort); | 514 | { |
343 | 265 | return n; | 515 | int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort); |
344 | 266 | } | 516 | return n; |
345 | 517 | } | ||
346 | 267 | 518 | ||
353 | 268 | int main (int, char **) | 519 | int main (int, char **) |
354 | 269 | { | 520 | { |
355 | 270 | return 0; | 521 | return 0; |
356 | 271 | } | 522 | } |
357 | 272 | " | 523 | " |
358 | 273 | HAVE_SCANDIR_POSIX) | 524 | HAVE_SCANDIR_POSIX) |
359 | 525 | endif (CMAKE_CXX_COMPILER) | ||
360 | 274 | 526 | ||
361 | 275 | if (HAVE_SCANDIR_POSIX) | 527 | if (HAVE_SCANDIR_POSIX) |
362 | 276 | add_definitions (-DHAVE_SCANDIR_POSIX) | 528 | add_definitions (-DHAVE_SCANDIR_POSIX) |
363 | 277 | 529 | ||
364 | === modified file 'cmake/CompizPlugin.cmake' | |||
365 | --- cmake/CompizPlugin.cmake 2011-05-17 23:51:02 +0000 | |||
366 | +++ cmake/CompizPlugin.cmake 2011-07-07 16:29:45 +0000 | |||
367 | @@ -423,6 +423,12 @@ | |||
368 | 423 | 423 | ||
369 | 424 | compiz_add_uninstall () | 424 | compiz_add_uninstall () |
370 | 425 | 425 | ||
371 | 426 | if (NOT COMPIZ_PLUGIN_PACK_BUILD) | ||
372 | 427 | compiz_add_git_dist () | ||
373 | 428 | compiz_add_release () | ||
374 | 429 | compiz_add_release_signoff () | ||
375 | 430 | endif (NOT COMPIZ_PLUGIN_PACK_BUILD) | ||
376 | 431 | |||
377 | 426 | else () | 432 | else () |
378 | 427 | message (STATUS "[WARNING] One or more dependencies for compiz plugin ${plugin} not found. Skipping plugin.") | 433 | message (STATUS "[WARNING] One or more dependencies for compiz plugin ${plugin} not found. Skipping plugin.") |
379 | 428 | message (STATUS "Missing dependencies :${COMPIZ_${_PLUGIN}_MISSING_DEPS}") | 434 | message (STATUS "Missing dependencies :${COMPIZ_${_PLUGIN}_MISSING_DEPS}") |
380 | 429 | 435 | ||
381 | === modified file 'include/compiz-common.h.in' | |||
382 | --- include/compiz-common.h.in 2009-03-15 23:01:06 +0000 | |||
383 | +++ include/compiz-common.h.in 2011-07-07 16:29:45 +0000 | |||
384 | @@ -1,9 +1,5 @@ | |||
385 | 1 | #ifndef COMPIZ_COMMON_H | 1 | #ifndef COMPIZ_COMMON_H |
386 | 2 | #define COMPIZ_COMMON_H | 2 | #define COMPIZ_COMMON_H |
387 | 3 | 3 | ||
393 | 4 | #define COMPIZ_VERSION_MAJOR @COMPIZ_VERSION_MAJOR@ | 4 | #define COMPIZ_VERSION_STRING "@VERSION@" |
389 | 5 | #define COMPIZ_VERSION_MINOR @COMPIZ_VERSION_MINOR@ | ||
390 | 6 | #define COMPIZ_VERSION_MICRO @COMPIZ_VERSION_MICRO@ | ||
391 | 7 | |||
392 | 8 | #define COMPIZ_VERSION_STRING "@COMPIZ_VERSION_MAJOR@.@COMPIZ_VERSION_MINOR@.@COMPIZ_VERSION_MICRO@" | ||
394 | 9 | #endif | 5 | #endif |
(disclaimer: I only read the diff, didn't try it for real)
Some questions and suggestions:
1. You could get rid of one line when reading the version number by directly using the VERSION variable instead of an intermediate COMPIZ_ RELEASE_ VERSION one.
2. is there a real reason to support both bz2 and gz? I would expect everybody to be able to decode bz2 now. Supporting only bz2 would simplify this diff quite a bit.
3. The check for whether you are in a git or a bzr repository could be moved outside the macros to avoid duplication. I would also simplify it to something like this (untested):
if (IS_DIRECTORY ${CMAKE_ SOURCE_ DIR}/.git) SOURCE_ DIR}/.git) SOURCE_ DIR}/.git)
set(IS_GIT_REPO TRUE)
elseif (IS_DIRECTORY ${CMAKE_
set(IS_GIT_REPO FALSE)
endif (IS_DIRECTORY ${CMAKE_
if (IS_DIRECTORY ${CMAKE_ SOURCE_ DIR}/.bzr) SOURCE_ DIR}/.bzr) SOURCE_ DIR}/.bzr)
set(IS_BZR_REPO TRUE)
elseif (IS_DIRECTORY ${CMAKE_
set(IS_BZR_REPO FALSE)
endif (IS_DIRECTORY ${CMAKE_
You can then replace your tests with easier-to-read checks on IS_GIT_REPO and IS_BZR_REPO