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 '[:lower:]' '[:upper:]')
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 for f in config.guess config.sub; do \
161 $(WGET) $(ftp-gnu)/config/$$f -O $(srcdir)/$$f; \
163 for f in depcomp missing; do \
164 echo checking out $$f...; \
165 cvs -d $(automake_repo) co -p automake/$$f > t$$$$ \
169 define emit-rsync-commands
170 echo =====================================
171 echo =====================================
172 echo 'for host in $(a_host) $(b_host); do \'
173 echo ' rsync -e ssh --pro -av $(xd-delta) $(my_distdir).tar.gz \'
174 echo ' $$host:$(real_dir); done'
175 echo '# send the /tmp/announcement e-mail'
176 echo =====================================
177 echo =====================================
180 # Make sure that the copyright date in lib/version-etc.c is up to date.
181 check-copyright: lib/version-etc.c
182 @grep 'N_("Copyright (C) $(shell date +%Y) Free' $< > /dev/null \
183 || { echo 'out of date copyright in $<; update it' 1>&2; exit 1; }
185 alpha: writable-files po-check check-copyright
187 $(MAKE) -s announcement > /tmp/announce-$(my_distdir)
188 ln $(distdir).tar.gz ../release
189 chmod a-w $(distdir).tar.gz
190 cd $(release-archive-dir) \
191 && xdelta delta -9 $(prev-tgz) $(distdir).tar.gz $(xd-delta) || :
192 ln $(release-archive-dir)/$(xd-delta) .
193 chmod a-w $(release-archive-dir)/$(xd-delta)
194 echo $(VERSION) > $(prev_version_file)
195 cvs ci -m. $(prev_version_file)
196 @$(emit-rsync-commands)