2009-12-07 Rolf Bjarne Kvinge <RKvinge@novell.com>
[moon.git] / cairo / build / Makefile.am.releasing
blob83486c5eebe40c6bf755473d74addad6876ea557
1 # Some custom targets to make it easier to release things.
3 # To make real stable releases or devel snapshots, use either:
4 #               make release-check
5 # or            make release-publish
7 # To make a quick properly named (date and git hash stamped) tarball:
8 #               make snapshot
11 TAR_OPTIONS = --owner=0 --group=0
13 dist-hook: dist-clear-sticky-bits
15 # Clean up any sticky bits we may inherit from parent dir
16 dist-clear-sticky-bits:
17         chmod -R a-s $(distdir)
20 snapshot:
21         distdir="$(distdir)-`date '+%Y%m%d'`"; \
22         test -d "$(srcdir)/.git" && distdir=$$distdir-`cd "$(srcdir)" && git-rev-parse HEAD | cut -c 1-6`; \
23         TAR_OPTIONS="$(TAR_OPTIONS)" $(MAKE) $(AM_MAKEFLAGS) distdir="$$distdir" snapshot-dist
25 snapshot-dist: dist
26         @(echo "$(distdir) archives ready for distribution: "; \
27           list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
28           sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
30 RELEASE_OR_SNAPSHOT = $$(if test "x$(CAIRO_VERSION_MINOR)" = "x$$(echo "$(CAIRO_VERSION_MINOR)/2*2" | bc)" ; then echo release; else echo snapshot; fi)
31 RELEASE_UPLOAD_HOST =   cairographics.org
32 RELEASE_UPLOAD_BASE =   /srv/cairo.freedesktop.org/www
33 RELEASE_UPLOAD_DIR =    $(RELEASE_UPLOAD_BASE)/$(RELEASE_OR_SNAPSHOT)s
34 RELEASE_URL_BASE =      http://cairographics.org/$(RELEASE_OR_SNAPSHOT)s
35 RELEASE_ANNOUNCE_LIST = cairo-announce@cairographics.org (and CC gnome-announce-list@gnome.org)
37 MANUAL_DATED =                  cairo-manual-`date +%Y%m%d`
38 MANUAL_TAR_FILE =               $(MANUAL_DATED).tar.gz
39 MANUAL_VERSIONED =              manual-$(VERSION)
40 MANUAL_VERSIONED_TAR_FILE =     $(MANUAL_VERSIONED).tar.gz
41 MANUAL_UPLOAD_DIR =             $(RELEASE_UPLOAD_BASE)
43 tar_file = $(PACKAGE)-$(VERSION).tar.gz
44 sha1_file = $(tar_file).sha1
45 gpg_file = $(sha1_file).asc
47 $(sha1_file): $(tar_file)
48         sha1sum $^ > $@
50 $(gpg_file): $(sha1_file)
51         @echo "Please enter your GPG password to sign the checksum."
52         gpg --armor --sign $^
54 release-verify-sane-changelogs: changelogs
55         @echo -n "Checking that the ChangeLog files are sane..."
56         @if grep -q "is required to generate" $(CHANGELOGS); then \
57                 (echo "Ouch." && echo "Some of the ChangeLogs are not generated correctly." \
58                 && echo "Remove ChangeLog* and make changelogs" \
59                 && false); else :; fi
60         @echo "Good."
62 release-verify-sane-tests:
63         @echo "Checking that the test suite is sane..."
64         @cd test && $(MAKE) $(AM_MAKEFLAGS) release-verify-sane-tests
66 release-verify-even-micro:
67         @echo -n "Checking that $(VERSION) has an even micro component..."
68         @test "$(CAIRO_VERSION_MICRO)" = "`echo $(CAIRO_VERSION_MICRO)/2*2 | bc`" \
69                 || (echo "Ouch." && echo "The version micro component '$(CAIRO_VERSION_MICRO)' is not an even number." \
70                 && echo "The version in configure.in must be incremented before a new release." \
71                 && false)
72         @echo "Good."
74 release-verify-newer:
75         @echo -n "Checking that no $(VERSION) release already exists..."
76         @ssh $(RELEASE_UPLOAD_HOST) test ! -e $(RELEASE_UPLOAD_DIR)/$(tar_file) \
77                 || (echo "Ouch." && echo "Found: $(RELEASE_UPLOAD_HOST):$(RELEASE_UPLOAD_DIR)/$(tar_file)" \
78                 && echo "Are you sure you have an updated checkout?" \
79                 && echo "This should never happen." \
80                 && false)
81         @echo "Good."
83 release-remove-old:
84         $(RM) $(tar_file) $(sha1_file) $(gpg_file)
87 # Strict ordering enforced for parallel make to work
88 release-check: \
89         release-verify-even-micro \
90         release-verify-sane-changelogs \
91         release-verify-sane-tests \
92         release-verify-newer \
93         $(NULL)
94         $(MAKE) $(AM_MAKEFLAGS) release-remove-old
95         TAR_OPTIONS="$(TAR_OPTIONS)" $(MAKE) $(AM_MAKEFLAGS) distcheck
97 release-upload: $(tar_file) $(sha1_file) $(gpg_file)
98         mkdir -p releases
99         scp $(tar_file) $(sha1_file) $(gpg_file) $(RELEASE_UPLOAD_HOST):$(RELEASE_UPLOAD_DIR)
100         mv $(tar_file) $(sha1_file) $(gpg_file) releases
101         ssh $(RELEASE_UPLOAD_HOST) "rm -f $(RELEASE_UPLOAD_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(tar_file) $(RELEASE_UPLOAD_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
102         git-tag -s  -m "cairo $(CAIRO_VERSION_MAJOR).$(CAIRO_VERSION_MINOR).$(CAIRO_VERSION_MICRO) release" $(CAIRO_VERSION_MAJOR).$(CAIRO_VERSION_MINOR).$(CAIRO_VERSION_MICRO)
104 release-publish-message: releases/$(sha1_file)
105         @echo "Please follow the instructions in RELEASING to push stuff out and"
106         @echo "send out the announcement mails.  Here is the excerpt you need:"
107         @echo ""
108         @echo "Subject: $(PACKAGE) $(RELEASE_OR_SNAPSHOT) $(VERSION) now available"
109         @echo ""
110         @echo "============================== CUT HERE =============================="
111         @echo "A new $(PACKAGE) $(RELEASE_OR_SNAPSHOT) $(VERSION) is now available from:"
112         @echo ""
113         @echo " $(RELEASE_URL_BASE)/$(tar_file)"
114         @echo ""
115         @echo "    which can be verified with:"
116         @echo ""
117         @echo " $(RELEASE_URL_BASE)/$(sha1_file)"
118         @echo -n "      "
119         @cat releases/$(sha1_file)
120         @echo ""
121         @echo " $(RELEASE_URL_BASE)/$(gpg_file)"
122         @echo " (signed by `getent passwd "$$USER" | cut -d: -f 5 | cut -d, -f 1`)"
123         @echo ""
124         @echo "  Additionally, a git clone of the source tree:"
125         @echo ""
126         @echo " git clone git://git.cairographics.org/git/cairo"
127         @echo ""
128         @echo "    will include a signed $(VERSION) tag which points to a commit named:"
129         @echo " `git cat-file tag $(VERSION) | grep ^object | sed -e 's,object ,,'`"
130         @echo ""
131         @echo "    which can be verified with:"
132         @echo " git verify-tag $(VERSION)"
133         @echo ""
134         @echo "    and can be checked out with a command such as:"
135         @echo " git checkout -b build $(VERSION)"
136         @echo ""
137         @echo "============================== CUT HERE =============================="
139 doc-publish: doc
140         rm -rf ./$(MANUAL_DATED)
141         cp -a doc/public/html $(MANUAL_DATED)
142         tar czf $(MANUAL_TAR_FILE) $(MANUAL_DATED)
143         scp $(MANUAL_TAR_FILE) $(RELEASE_UPLOAD_HOST):$(MANUAL_UPLOAD_DIR)
144         ssh $(RELEASE_UPLOAD_HOST) "cd $(MANUAL_UPLOAD_DIR) && tar xzf $(MANUAL_TAR_FILE) && rm -f manual && ln -s $(MANUAL_DATED) manual && ln -sf $(MANUAL_TAR_FILE) cairo-manual.tar.gz"
146 doc-publish-versioned: doc
147         rm -rf ./$(MANUAL_VERSIONED)
148         cp -a doc/public/html $(MANUAL_VERSIONED)
149         tar czf $(MANUAL_VERSIONED_TAR_FILE) $(MANUAL_VERSIONED)
150         scp $(MANUAL_VERSIONED_TAR_FILE) $(RELEASE_UPLOAD_HOST):$(MANUAL_UPLOAD_DIR)
151         ssh $(RELEASE_UPLOAD_HOST) "cd $(MANUAL_UPLOAD_DIR) && tar xzf $(MANUAL_VERSIONED_TAR_FILE)"
153 # Strict ordering enforced for parallel make to work
154 release-publish: release-check
155         $(MAKE) $(AM_MAKEFLAGS) release-upload
156         $(MAKE) $(AM_MAKEFLAGS) doc-publish-versioned
157         $(MAKE) $(AM_MAKEFLAGS) release-publish-message
159 if OS_WIN32
161 # Win32 package zipfiles
162 runtime_zip_file = $(PACKAGE)-$(VERSION).zip
163 developer_zip_file = $(PACKAGE)-dev-$(VERSION).zip
165 $(runtime_zip_file): install
166         -$(RM) $@
167         pwd=`pwd`; cd $(prefix); \
168         zip "$$pwd"/$@ bin/libcairo-$(CAIRO_VERSION_SONUM).dll
170 $(developer_zip_file): install
171         -$(RM) $@
172         pwd=`pwd`; cd $(prefix); \
173         zip -r "$$pwd"/$@ include/cairo lib/libcairo.dll.a lib/cairo.lib lib/pkgconfig/cairo.pc lib/pkgconfig/cairo-*.pc share/gtk-doc/html/cairo
175 zips: $(runtime_zip_file) $(developer_zip_file)
177 endif
180 .PHONY: \
181         dist-clear-sticky-bits \
182         doc-publish \
183         doc-publish-versioned \
184         release-check \
185         release-publish \
186         release-publish-message \
187         release-remove-old \
188         release-upload \
189         release-verify-even-micro \
190         release-verify-newer \
191         release-verify-sane-changelogs \
192         release-verify-sane-tests \
193         snapshot \
194         snapshot-dist \
195         $(NULL)