2 # This Makefile fragment is shared between fileutils, sh-utils, textutils.
5 if head ChangeLog| grep 'Version $(VERSION)' > /dev/null; then \
8 echo "$(VERSION) not in ChangeLog; not tagging" 1>&2; \
14 prev_version_file = .prev-version
16 THIS_VERSION_REGEXP = $(subst .,\.,$(VERSION))
17 PREV_VERSION := $(shell cat $(prev_version_file))
18 PREV_VERSION_REGEXP := $(shell echo $(PREV_VERSION)|sed 's/\./\\./g')
20 tag-package = $(shell echo "$(PACKAGE)" | tr a-z A-Z)
21 tag-this-version = $(subst .,_,$(VERSION))
22 tag-prev-version = $(subst .,_,$(PREV_VERSION))
23 this-cvs-tag = $(tag-package)-$(tag-this-version)
24 prev-cvs-tag = $(tag-package)-$(tag-prev-version)
25 my_distdir = $(PACKAGE)-$(VERSION)
27 # Verify that all source files using _() are listed in po/POTFILES.in.
29 grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1
30 grep -E -l '\b_\(' lib/*.c src/*.c | sort > $@-2
34 # Do not save the original name or timestamp in the .tar.gz file.
37 # Tag before making distribution. Also, don't make a distribution if
38 # checks fail. Also, make sure the NEWS file is up-to-date.
39 # FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck.
40 cvs-dist: maintainer-check
41 echo $(this-cvs-tag); \
42 if cvs -n log -h README| grep -e $(this-cvs-tag): > /dev/null; then \
43 echo "VERSION not new; not tagging" 1>&2; \
47 cvs tag -c $(this-cvs-tag)
50 # Use this to make sure we don't run these programs when building
51 # from a virgin tgz file, below.
60 my-distcheck: writable-files po-check
63 GZIP=$(GZIP) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
64 # Removing $(DEPDIR) like this is a gross kludge to work around a bug
65 # in automake. Remove that line once it's fixed.
67 && ./configure --disable-nls \
68 && $(MAKE) CFLAGS='-Wformat -Werror' \
69 AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
72 && $(MAKE) distclean \
74 cd $(t) && mv $(distdir) $(distdir).old \
75 && $(AMTAR) -zxf ../$(distdir).tar.gz
76 diff -ur $(t)/$(distdir).old $(t)/$(distdir)
78 @echo "========================"; \
79 echo "$(distdir).tar.gz is ready for distribution"; \
80 echo "========================"
82 a_host = alpha.gnu.org
83 b_host = freefriends.org
85 alpha_subdir = gnu/fetish
86 a_url_dir = $(alpha_subdir)
87 b_url_dir = $(alpha_subdir)
89 # This must be the same name on both hosts.
90 # Make it a symlink that points to the right place.
93 url_dir_list = $(foreach x,a b,ftp://$($(x)_host)/$($(x)_url_dir))
95 md5 = $(shell md5sum < $(my_distdir).tar.gz|sed 's/ -//')
96 sha1 = $(shell sha1sum < $(my_distdir).tar.gz|sed 's/ -//')
99 tarz=/tmp/rel-check-tarz-$$$$; \
100 md5_tmp=/tmp/rel-check-md5-$$$$; \
102 trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
103 wget -q --output-document=$$tarz $(url); \
104 echo "$(md5) -" > $$md5_tmp; \
105 md5sum -c $$md5_tmp < $$tarz
107 release-archive-dir = ../release
108 prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
109 xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
111 announcement: NEWS ChangeLog $(distdir).tar.gz
113 echo Subject: $(my_distdir) released; \
115 echo FIXME: put comments here; \
117 for url in $(url_dir_list); do \
118 echo " $$url/$(my_distdir).tar.gz"; \
121 echo And here are xdelta-style diffs; \
123 for url in $(url_dir_list); do \
124 echo " $$url/$(xd-delta)"; \
127 echo "Here are the MD5 and SHA1 signatures for the .tar.gz file"; \
129 echo "$(md5) $(my_distdir).tar.gz"; \
130 echo "$(sha1) $(my_distdir).tar.gz"; \
133 sed -n "/$(THIS_VERSION_REGEXP)/,/^\[$(PREV_VERSION_REGEXP)/p" NEWS \
136 echo ChangeLog entries:; \
137 find . -name ChangeLog -maxdepth 2 \
138 | xargs cvs diff -up -r$(prev-cvs-tag) -rHEAD \
140 | perl -ne 'm!^\+\+ (\./)?! or print,next;' \
141 -e 'print "\n"."*"x70 ."\n"; s///; print; print "*"x70 ."\n"'; \
145 for file in $(distdir).tar.gz $(xd-delta) \
146 ../release/$(distdir).tar.gz ../release/$(xd-delta); do \
147 test -e $$file || continue; \
149 || { echo ERROR: $$file is not writable; fail=1; }; \
151 test "$$fail" && exit 1 || :
154 ftp-gnu = ftp://ftp.gnu.org/gnu
156 automake_repo=:pserver:anoncvs@anoncvs.cygnus.com:/cvs/automake
159 $(WGET) $(ftp-gnu)/texinfo/texinfo.tex -O $(srcdir)/doc/texinfo.tex
160 $(WGET) $(ftp-gnu)/config/config.guess -O $(srcdir)/config.guess
161 $(WGET) $(ftp-gnu)/config/config.sub -O $(srcdir)/config.sub
162 cvs -d $(automake_repo) co -p automake/depcomp > depcomp
164 define emit-rsync-commands
165 echo =====================================
166 echo =====================================
167 echo 'for host in $(a_host) $(b_host); do \'
168 echo ' rsync -e ssh --pro -av $(xd-delta) $(my_distdir).tar.gz \'
169 echo ' $$host:$(real_dir); done'
170 echo '# send the /tmp/announcement e-mail'
171 echo =====================================
172 echo =====================================
175 alpha: writable-files po-check
177 $(MAKE) -s announcement > /tmp/announce-$(my_distdir)
178 ln $(distdir).tar.gz ../release
179 chmod a-w $(distdir).tar.gz
180 cd $(release-archive-dir) \
181 && xdelta delta -9 $(prev-tgz) $(distdir).tar.gz $(xd-delta) || :
182 ln $(release-archive-dir)/$(xd-delta) .
183 chmod a-w $(release-archive-dir)/$(xd-delta)
184 echo $(VERSION) > $(prev_version_file)
185 cvs ci -m. $(prev_version_file)
186 @$(emit-rsync-commands)