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)
26 # Verify that all source files using _() are listed in po/POTFILES.in.
28 grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1
29 grep -E -l '\b_\(' lib/*.c src/*.c | sort > $@-2
33 # Do not save the original name or timestamp in the .tar.gz file.
36 # Tag before making distribution. Also, don't make a distribution if
37 # checks fail. Also, make sure the NEWS file is up-to-date.
38 # FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck.
39 cvs-dist: maintainer-check
40 echo $(this-cvs-tag); \
41 if cvs -n log -h README| grep -e $(this-cvs-tag): > /dev/null; then \
42 echo "VERSION not new; not tagging" 1>&2; \
46 cvs tag -c $(this-cvs-tag)
49 # Use this to make sure we don't run these programs when building
50 # from a virgin tgz file, below.
59 my-distcheck: writable-files po-check
62 GZIP=$(GZIP) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
63 # Removing $(DEPDIR) like this is a gross kludge to work around a bug
64 # in automake. Remove that line once it's fixed.
66 && ./configure --disable-nls \
67 && $(MAKE) CFLAGS='-Wformat -Werror' \
68 AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
71 && $(MAKE) distclean \
73 cd $(t) && mv $(distdir) $(distdir).old \
74 && $(AMTAR) -zxf ../$(distdir).tar.gz
75 diff -ur $(t)/$(distdir).old $(t)/$(distdir)
77 @echo "========================"; \
78 echo "$(distdir).tar.gz is ready for distribution"; \
79 echo "========================"
81 a_host = alpha.gnu.org
82 b_host = freefriends.org
84 alpha_subdir = gnu/fetish
85 a_url_dir = $(alpha_subdir)
86 b_url_dir = $(alpha_subdir)
88 a_real_dir = /fs/share/ftp/$(alpha_subdir)
89 b_real_dir = fetish-ftp
91 url_dir_list = $(foreach x,a b,ftp://$($(x)_host)/$($(x)_url_dir))
93 md5 = $(shell md5sum < $(distdir).tar.gz|sed 's/ -//')
94 sha1 = $(shell sha1sum < $(distdir).tar.gz|sed 's/ -//')
97 tarz=/tmp/rel-check-tarz-$$$$; \
98 md5_tmp=/tmp/rel-check-md5-$$$$; \
100 trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
101 wget -q --output-document=$$tarz $(url); \
102 echo "$(md5) -" > $$md5_tmp; \
103 md5sum -c $$md5_tmp < $$tarz
105 release-archive-dir = ../release
106 prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
107 xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
109 announcement: NEWS ChangeLog $(distdir).tar.gz
111 echo Subject: $(distdir) released; \
113 echo FIXME: put comments here; \
115 for url in $(url_dir_list); do \
116 echo " $$url/$(distdir).tar.gz"; \
119 echo And here are xdelta-style diffs; \
121 for url in $(url_dir_list); do \
122 echo " $$url/$(xd-delta)"; \
125 echo "Here are the MD5 and SHA1 signatures for the .tar.gz file"; \
127 echo "$(md5) $(distdir).tar.gz"; \
128 echo "$(sha1) $(distdir).tar.gz"; \
131 sed -n "/$(THIS_VERSION_REGEXP)/,/^\[$(PREV_VERSION_REGEXP)/p" NEWS \
134 echo ChangeLog entries:; \
135 find . -name ChangeLog -maxdepth 2 \
136 | xargs cvs diff -up -r$(prev-cvs-tag) -rHEAD \
138 | perl -ne 'm!^\+\+ (\./)?! or print,next;' \
139 -e 'print "\n"."*"x70 ."\n"; s///; print; print "*"x70 ."\n"'; \
143 for file in $(distdir).tar.gz $(xd-delta) \
144 ../release/$(distdir).tar.gz ../release/$(xd-delta); do \
145 test -e $$file || continue; \
147 || { echo ERROR: $$file is not writable; fail=1; }; \
149 test "$$fail" && exit 1 || :
152 ftp-gnu = ftp://ftp.gnu.org/gnu
154 automake_repo=:pserver:anoncvs@anoncvs.cygnus.com:/cvs/automake
157 $(WGET) $(ftp-gnu)/texinfo/texinfo.tex -O $(srcdir)/doc/texinfo.tex
158 $(WGET) $(ftp-gnu)/config/config.guess -O $(srcdir)/config.guess
159 $(WGET) $(ftp-gnu)/config/config.sub -O $(srcdir)/config.sub
160 cvs -d $(automake_repo) co -p automake/depcomp > depcomp
162 alpha: writable-files po-check
164 $(MAKE) -s announcement > /tmp/announce-$(distdir)
165 ln $(distdir).tar.gz ../release
166 chmod a-w $(distdir).tar.gz
167 cd $(release-archive-dir) \
168 && xdelta delta -9 $(prev-tgz) $(distdir).tar.gz $(xd-delta) || :
169 ln $(release-archive-dir)/$(xd-delta) .
170 chmod a-w $(release-archive-dir)/$(xd-delta)
171 echo $(VERSION) > $(prev_version_file)
172 cvs ci -m. $(prev_version_file)
173 @echo =====================================
174 @echo =====================================
175 @echo 'rsync -e ssh --pro -av $(xd-delta) $(distdir).tar.gz \'
176 @echo ' $(b_host):$(b_real_dir)'
177 @echo '# send the /tmp/announcement e-mail'
178 @echo =====================================
179 @echo =====================================