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 # This must be the same name on both hosts.
89 # Make it a symlink that points to the right place.
92 url_dir_list = $(foreach x,a b,ftp://$($(x)_host)/$($(x)_url_dir))
94 md5 = $(shell md5sum < $(distdir).tar.gz|sed 's/ -//')
95 sha1 = $(shell sha1sum < $(distdir).tar.gz|sed 's/ -//')
98 tarz=/tmp/rel-check-tarz-$$$$; \
99 md5_tmp=/tmp/rel-check-md5-$$$$; \
101 trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
102 wget -q --output-document=$$tarz $(url); \
103 echo "$(md5) -" > $$md5_tmp; \
104 md5sum -c $$md5_tmp < $$tarz
106 release-archive-dir = ../release
107 prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
108 xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
110 announcement: NEWS ChangeLog $(distdir).tar.gz
112 echo Subject: $(distdir) released; \
114 echo FIXME: put comments here; \
116 for url in $(url_dir_list); do \
117 echo " $$url/$(distdir).tar.gz"; \
120 echo And here are xdelta-style diffs; \
122 for url in $(url_dir_list); do \
123 echo " $$url/$(xd-delta)"; \
126 echo "Here are the MD5 and SHA1 signatures for the .tar.gz file"; \
128 echo "$(md5) $(distdir).tar.gz"; \
129 echo "$(sha1) $(distdir).tar.gz"; \
132 sed -n "/$(THIS_VERSION_REGEXP)/,/^\[$(PREV_VERSION_REGEXP)/p" NEWS \
135 echo ChangeLog entries:; \
136 find . -name ChangeLog -maxdepth 2 \
137 | xargs cvs diff -up -r$(prev-cvs-tag) -rHEAD \
139 | perl -ne 'm!^\+\+ (\./)?! or print,next;' \
140 -e 'print "\n"."*"x70 ."\n"; s///; print; print "*"x70 ."\n"'; \
144 for file in $(distdir).tar.gz $(xd-delta) \
145 ../release/$(distdir).tar.gz ../release/$(xd-delta); do \
146 test -e $$file || continue; \
148 || { echo ERROR: $$file is not writable; fail=1; }; \
150 test "$$fail" && exit 1 || :
153 ftp-gnu = ftp://ftp.gnu.org/gnu
155 automake_repo=:pserver:anoncvs@anoncvs.cygnus.com:/cvs/automake
158 $(WGET) $(ftp-gnu)/texinfo/texinfo.tex -O $(srcdir)/doc/texinfo.tex
159 $(WGET) $(ftp-gnu)/config/config.guess -O $(srcdir)/config.guess
160 $(WGET) $(ftp-gnu)/config/config.sub -O $(srcdir)/config.sub
161 cvs -d $(automake_repo) co -p automake/depcomp > depcomp
163 define emit-rsync-commands
164 echo =====================================
165 echo =====================================
166 echo 'for host in $(a_host) $(b_host); do \'
167 echo ' rsync -e ssh --pro -av $(xd-delta) $(distdir).tar.gz \'
168 echo ' $$host:$(real_dir); done'
169 echo '# send the /tmp/announcement e-mail'
170 echo =====================================
171 echo =====================================
174 alpha: writable-files po-check
176 $(MAKE) -s announcement > /tmp/announce-$(distdir)
177 ln $(distdir).tar.gz ../release
178 chmod a-w $(distdir).tar.gz
179 cd $(release-archive-dir) \
180 && xdelta delta -9 $(prev-tgz) $(distdir).tar.gz $(xd-delta) || :
181 ln $(release-archive-dir)/$(xd-delta) .
182 chmod a-w $(release-archive-dir)/$(xd-delta)
183 echo $(VERSION) > $(prev_version_file)
184 cvs ci -m. $(prev_version_file)
185 @$(emit-rsync-commands)