1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
|
#=============================================================================
#
# Maintainer stuff; don't even LOOK at this - and when you E-mail me
# about it you'll get blacklisted }:-).
#
# I added it only here for other GNU maintainers to look at.
# In order to use this as-is, you'll need the following utilities:
#
# GNU make
# GNU which-2.x
# GNU awk
# GNU date
# GNU groff
# texinfo2man.c (I'll make this available via my home page)
# texi2html
# cvs2html (archived on https://github.com/CarloWood/cvs2html)
# rcs2log
# cut
# grep
# egrep
# test
# sed
# head
# tail
#
# This maintainer Makefile provides the following functionality:
#
# Targets
# -------
#
# - release
# Creates everything and puts it all in the release directory $(WWWDIR)
# This target calls all of the below targets.
# Note: You must `cvs commit' *before* calling this target!
#
# The remaining targets can be used to test a part of the distribution process,
# but are not really useful on their own otherwise.
#
# - cvslog
# Generates html-ized ChangeLog from the CVS repository log.
#
# - html
# Generates html-ized man page(s) (from @PACKAGE@.texi) and
# the release front page index.html. index.html is generated by
# replacing "!VERSION!" in index.html.in by @VERSION@ and the
# word "CHANGELOGLIST" by a list of links the cvslog change logs
# (also from previous releases).
#
# - @PACKAGE@.lsm
# Generates an LSM file for distribution via the web page.
# It does this by simply replacing "!VERSION!" by @VERSION@.
#
# - README
# Generate README file by replacing "!VERSION!" in README.in by
# @VERSION@.
#
# - @PACKAGE@.1
# Generate man page from @PACKAGE@.texi.
#
# - ChangeLog
# Generates the `ChangeLog' file from the CVS repository logs.
WWWDIR=/home/carlo/www/@PACKAGE@
TARGET=i386
REL=1
AUTHOR=Carlo Wood <carlo@gnu.org>
TAG:=${shell echo "V@VERSION@" | sed -e 's/\./_/g'}
PREVTAG:=${shell test -f $(srcdir)/.prevtag && cat $(srcdir)/.prevtag}
CVSREADACCESS:=${shell if test -f $(srcdir)/CVS/Entries; then echo "yes"; else echo "no"; fi}
test-values:
@echo "WWWDIR = \"$(WWWDIR)\""
@echo "TARGET = \"$(TARGET)\""
@echo "REL = \"$(REL)\""
@echo "AUTHOR = \"$(AUTHOR)\""
@echo "TAG = \"$(TAG)\""
@echo "PREVTAG = \"$(PREVTAG)\""
@echo "PACKAGE = \"@PACKAGE@\""
@echo "VERSION = \"@VERSION@\""
@echo "CVSREADACCESS = \"$(CVSREADACCESS)\""
## Make sure the ChangeLog is up to date in maintainer mode
.PHONY: release tar cvslog html ChangeLog
@PACKAGE@.1: $(srcdir)/@PACKAGE@.1.in $(srcdir)/@PACKAGE@.texi texinfo2man $(srcdir)/configure.ac
./texinfo2man $(srcdir)/@PACKAGE@.1.in $(srcdir)/@PACKAGE@.texi > @PACKAGE@.1
texinfo2man: ../indent/texinfo2man.c
$(CC) -g -o texinfo2man ../indent/texinfo2man.c
@PACKAGE@.lsm: $(srcdir)/@PACKAGE@.lsm.in $(srcdir)/configure.ac
sed -e 's%!VERSION!%'`grep 's,@VERSION' config.status | cut -d, -f3 | sed -e 's/|.*|//'`'%g' $(srcdir)/@PACKAGE@.lsm.in > @PACKAGE@.lsm
reconfig: $(top_builddir)/config.status
$(top_builddir)/config.status --recheck
$(top_builddir)/config.status
cvslog:
@( \
cd $(srcdir); \
D1=`cat .release_second`; \
D2=`date +%s`; \
DD=`echo "$$D1 $$D2" | awk '{ printf("%d\n", ($$2 - $$1)/86400) }'`; \
echo "Last release was $$DD days ago."; \
/usr/src/cvs2html/cvs2html -e -r$(PREVTAG):HEAD -o cvslog-@VERSION@; \
)
ChangeLog:
if test $(CVSREADACCESS) = yes; then \
echo "`which --skip-dot cvs` \`echo \"\$$*\" | sed -e 's%1970%1990%'\`" > cvs; \
chmod 755 cvs; \
here=`pwd`; \
(cd $(srcdir); PATH="$$here:$$PATH" /usr/share/cvs/contrib/rcs2log) | sed -e 's/author.*<author@.*>/$(AUTHOR)/;s/ </ </' > ChangeLog; \
rm cvs; \
else \
touch ChangeLog; \
fi
release: dist cvslog html @PACKAGE@.lsm NEWS
install -m 644 index.html $(WWWDIR)
install -m 644 @PACKAGE@.lsm $(WWWDIR)
install -m 644 `ls $(srcdir)/cvslog-@VERSION@*.html` $(WWWDIR)
install -m 644 $(srcdir)/NEWS $(WWWDIR)
install -m 644 @PACKAGE@-@VERSION@.tar.gz $(WWWDIR)
gpg -b @PACKAGE@-@VERSION@.tar.gz
echo "version: 1.1" > @PACKAGE@-@VERSION@.tar.gz.directive
echo "directory: which" >> @PACKAGE@-@VERSION@.tar.gz.directive
echo "filename: @PACKAGE@-@VERSION@.tar.gz" >> @PACKAGE@-@VERSION@.tar.gz.directive
echo "comment: release of @VERSION@" >> @PACKAGE@-@VERSION@.tar.gz.directive
gpg --clearsign @PACKAGE@-@VERSION@.tar.gz.directive
rm $(srcdir)/cvslog-@VERSION@*.html
cvs tag $(TAG)
echo "$(TAG)" > $(srcdir)/.prevtag
date +%s > $(srcdir)/.release_second
@echo "*** To upload run: ncftpput ftp-upload.gnu.org /incoming/ftp @PACKAGE@-@VERSION@.tar.gz @PACKAGE@-@VERSION@.tar.gz.sig @PACKAGE@-@VERSION@.tar.gz.directive.asc"
##-----------------------------------------------------------------------------
## `which' specific generation:
html: EXAMPLES $(srcdir)/index.html.in $(srcdir)/configure.ac
grep -B2000 '^CHANGELOGLIST' $(srcdir)/index.html.in \
| sed -e 's%!VERSION!%@VERSION@%g' \
| grep -v '^CHANGELOGLIST' > index.html
( \
VER=`echo "@VERSION@" | cut -d. -f1`; \
PATCHLEVEL=`echo "@VERSION@" | cut -d. -f2`; \
while test "$$PATCHLEVEL" != "-1" ; do \
echo "<LI><A HREF="cvslog-$$VER.$$PATCHLEVEL.html">Version $$VER.$$PATCHLEVEL</A>" >> index.html; \
PATCHLEVEL=`echo "$$PATCHLEVEL" | awk '{ printf("%d", $$1 - 1); }'`; \
done \
)
grep -A2000 '^CHANGELOGLIST' $(srcdir)/index.html.in | grep -v '^CHANGELOGLIST' | grep -B2000 '^MANPAGE' | grep -v '^MANPAGE' >> index.html
groff -man -Tascii which.1 | sed -e 's/.//g' | head -n 61 | tail -n 58 >> index.html
groff -man -Tascii which.1 | sed -e 's/.//g' | head -n 123 | tail -n 51 | grep -B2000 '^ ' >> index.html
grep -A2000 '^MANPAGE' $(srcdir)/index.html.in | grep -v '^MANPAGE' | grep -B2000 '^EXAMPLES' | grep -v '^EXAMPLES' >> index.html
cat EXAMPLES >> index.html
grep -A2000 '^EXAMPLES' $(srcdir)/index.html.in | grep -v '^EXAMPLES' >> index.html
EXAMPLES: which
( cd test; ../$(srcdir)/test/whichtest check; ) || exit -1;
( cd test; ../$(srcdir)/test/whichtest generate; )
README: which.1 $(srcdir)/README.in $(srcdir)/configure.ac
sed -e 's%!VERSION!%'`grep 's,@VERSION' config.status | cut -d, -f3`'%g' $(srcdir)/README.in > README
groff -man -Tascii which.1 | sed -e 's/.//g' | head -n 61 | tail -n 58 >> README
groff -man -Tascii which.1 | sed -e 's/.//g' | head -n 123 | tail -n 51 | grep -B2000 '^ ' >> README
|