28.13 Producing an ALLPROSE Release Distribution
This section describes how to produce a release distribution of ALLPROSE.
There are basically two targets available, namely checked-allprose-distribution and
allprose-distribution.
28.13.1 Check Proper Compilation
Whereas checked-allprose-distribution first compiles and checks the library
and compiles all sorts of documentation, allprose-distribution assumes that
everything has been checked and simply puts the relevant files together into an
archive.
We do not like undefined references in the distribution, so we stop if we find one.
414⟨make ALLPROSE distribution file 413⟩+
≡ (350) ⊲413 415 ⊳
checklog:
$(PERL) \
-e ’while(<>){’ \
-e ’ if(/LaTeX Warning: There were undefined references\./){’\
-e ’ exit 1;}}’ $(projectname).log
Defines:
checklog, used in chunks 413 and 423.
Uses PERL 431b and projectname 127.
28.13.2 Collect Distribution Files
The ALLPROSE distribution basically consist of all file that are listed in allprosefiles.list plus a few more files that can be found below.
We start by putting a release-date at the first line of the file ChangeLog file. Then
we write any file name to a manifest file, create a directory with the name
allprose-0.2.5, and copy all relevant files to that directory. Finally that directory
is put into an archive and compressed.
415⟨make ALLPROSE distribution file 413⟩+
≡ (350) ⊲414 417a ⊳
allprose-distribution: allprosefiles.list release-date
@echo "Creating ALLPROSE distribution..."
echo manifest.allprose > manifest.allprose
echo README >> manifest.allprose
echo GPL >> manifest.allprose
echo ChangeLog >> manifest.allprose
echo Makefile >> manifest.allprose
$(MAKE) $(shell $(PERL) -pe ’s/$$/.allprosedistro/’ allprosefiles.list)
$(MAKE) VERSION=$(ALLPROSEVERSION) tgz.allprose
%/myalps.allprosedistro:
$(FIND) $*/myalps -name ’*.nw’ >> manifest.allprose
%.allprosedistro:
echo $* >> manifest.allprose
Defines:
allprose-distribution, used in chunk 413.
Uses allprosefiles.list 408, ALLPROSEVERSION 366, FIND 432, PERL 431b,
and release-date 417b.
28.13.3 Release Date
We write the project name, its version, and the current date onto the top
of the ChangeLog file. The ChangeLog file is not modified if a line of the
form
-- ALLPROSE 0.2.2 -- 28-May-2006 --
|
is already there with identical name, version, and date. If just the date differs then
the release-date target will not succeed.
Of course, we must make sure that a ChangeLog file actually exists.
417b⟨make ALLPROSE distribution file 413⟩+
≡ (350) ⊲417a 420b ⊳
release-date: ChangeLog
$(PERL) \
⟨PERL determine the current date in dd-Mmm-yyyy form 417c⟩ \
⟨PERL read the ChangeLog file to the variable @lines 418a⟩ \
⟨PERL set NAMEVERSION 420a⟩ \
⟨PERL exit if first line already contains NAMEVERSION 418b⟩ \
⟨PERL add release date to ChangeLog file 418c⟩
Defines:
release-date, used in chunks 415 and 424.
Uses PERL 431b.
417c⟨PERL determine the current date in dd-Mmm-yyyy form 417c⟩≡ (417b)
-e ’($$s,$$m,$$h,$$D,$$M,$$Y) = localtime(time);’ \
-e ’@Month = ("Jan", "Feb", "Mar", "Apr", "May", "Jun",’ \
-e ’"Jul", "Aug", "Sep", "Oct", "Nov", "Dec");’ \
-e ’$$date=sprintf("%02d-%s-%04d",$$D,$$Month[$$M],$$Y+1900);’
418a⟨PERL read the ChangeLog file to the variable @lines 418a⟩≡ (417b)
-e ’open(CL, "ChangeLog") || die "Cannot open ChangeLog";’ \
-e ’@lines=<CL>;’\
-e ’close CL;’
Here we exist with success, if name, version, and date are the same as
appearing in the first line of ChangeLog. If name and version are OK, but
the date is not the same as today then we abort with an error message.
418b⟨PERL exit if first line already contains NAMEVERSION 418b⟩≡ (417b)
-e ’if(0==index $$lines[0], $$NAMEVERSION){’ \
-e ’ $$D=substr $$lines[0], length $$NAMEVERSION;’ \
-e ’ if($$D=~/^ $$date --$$/){exit}’ \
-e ’ print STDERR "=====================================\n";’ \
-e ’ print STDERR "First line of ChangeLog differs from\n";’ \
-e ’ print STDERR "$$NAMEVERSION$$date --\n";’ \
-e ’ print STDERR "You probably want to increase MAJORVERSION,\n";’\
-e ’ print STDERR "MINORVERSION, or PATCHVERSION in the file\n";’ \
-e ’ print STDERR "Makefile.def.nw.\n";’ \
-e ’ die;’ \
-e ’}’
Uses MAJORVERSION 127, MINORVERSION 127, and PATCHVERSION 127.
418c⟨PERL add release date to ChangeLog file 418c⟩≡ (417b)
-e ’open(CL, ">ChangeLog") || die "Cannot create ChangeLog";’ \
-e ’print CL "$$NAMEVERSION $$date --\n";’ \
-e ’print CL @lines;’ \
-e ’close CL;’
The following part is very ALLPROSE-specific. We simply want that lines
similar to
-- ALLPROSE 0.2.2 -- 28-May-2006
|
instead of
-- MyAlps 0.2.2 -- 28-May-2006
|
appear in the ChangeLog file.
28.13.4 Build an Archive
Since the following piece of code is also needed in Section 28.14, we separate it from
the ALLPROSE specific part.
The first TAR command, basically copies the relevant files into a subdirectory
with the name of the distribution. Then this directory will be put into an
archive and compressed. The resulting archive extracts into a new directory.
420b⟨make ALLPROSE distribution file 413⟩+
≡ (350) ⊲417b
tgz.%:
$(MDparent) $*-$(VERSION)
$(TAR) cpf - --files-from manifest.$* | \
(cd $*-$(VERSION); $(TAR) xpf -)
$(TAR) cf $*-$(VERSION).tar $*-$(VERSION)
${GNUZIP} $*-$(VERSION).tar
$(RMrecursive) $*-$(VERSION)
$(RM) tmp.tar
Uses GNUZIP 354b, MDparent 432, RMrecursive 432, and TAR 354b.