.key RELEASENAME/A,BASENAME/A,SOURCE/A,ROOT/A,AUTHOR/A,UPLOADER/A,SHORT/A,TYPE/A,CLEAN/S
.bra {
.ket }
;
; $VER: build-aminet 37.5 (30 Jul 1995)
;
; (C) Copyright 1995 Marius Grger
;     All Rights Reserved.
;
; AmigaShell script to create an Aminet release. From a bumprev file
; the current release number is extracted and used to form the
; proper readme and archive names. The following directory structure
; and files are assumed to exist:
;
;    CWD/{BASENAME}_rev.h     see C= SWTools/bumprev
;    CWD/{SOURCE}             a body text for an Aminet readme
;    {BASENAME}               name of distribution directory
;    {ROOT}                   distribution root directory
;    {ROOT}/../{BASENAME}     -> implicitely, must be valid
;
; The options in detail:
;
;    RELEASENAME
;        Unfortunately, the filing system used for Aminet CDs is only
;        capable of mainaining file names up to 21 characters length.
;        This parameter takes care of this: ideally meaning the same as
;        BASENAME, it should by an acronym for it.
;
;    BASENAME
;        Basename of the distribution.
;        A file $(BASENAME)_rev.h as created by bumprev must exist.
;
;    SOURCE
;        Source file which contains the readme body text. The Aminet header
;        infos will be prepended.
;
;    ROOT
;        Distribution root directory. Here goes the readme to, and this is
;        what will be archived.
;
;    AUTHOR, UPLOADER, SHORT, TYPE
;        Texts as required for Aminet contributions.
;
;    CLEAN
;        If set, previous readmes are deleted.
;
;
; $HISTORY:
;
; 30 Jul 1995 : 037.005 :  must also remove .o files from archive
; 25 Jul 1995 : 037.004 :  didn't remove obsolete readme's due to typo
; 02 Jul 1995 : 037.003 :  hardcoded "rel" drawer was unfortunate, now using
;                          {RELEASENAME}
; 27 Jun 1995 : 037.002 :  takes care for Aminet file name restrictions
; 03 Jun 1995 : 037.001 :  initial
;

; --------------------- customize this -----------------------
Set LHA  C:Lha
Set TAR  C:tar
; ----------------- end of customization ---------------------

If EQ "CLEAN" {CLEAN}
   Echo "=== removing obsolete readme's ==="
   Delete QUIET "{ROOT}/{RELEASENAME}(%|[0-9])[0-9].[0-9](%|[0-9])(%|[0-9]).readme"
Endif

If NOT EXISTS T:{RELEASENAME}
  Makedir T:{RELEASENAME}
EndIf
Delete QUIET T:{RELEASENAME}/#?

Set relname "`version file {BASENAME}_rev.h`"
Set relname {RELEASENAME}`rx "say word('$relname',2)"`
Echo >{ROOT}/$relname.readme "Short:    {SHORT}*NAuthor:   {AUTHOR}*NUploader: {UPLOADER}*NType:     {TYPE}*N"
Type {SOURCE} >>{ROOT}/$relname.readme
Copy {ROOT}/$relname.readme T:{RELEASENAME}/

Echo "=== creating lha archive ==="
$LHA a -rw T:{RELEASENAME}/$relname.lha {ROOT}/// {BASENAME} {BASENAME}.info
$LHA d T:{RELEASENAME}/$relname.lha #?.(o|no|opt0[0-4]0)

Echo "=== creating tar archive ==="
$TAR cvCf t: t:{RELEASENAME}.tar {RELEASENAME}

UnSet relname
UnSet TAR
UnSet LHA

Echo "=== ready ==="

