.key RELEASENAME/A,BASENAME/A,SOURCE/A,ROOT/A,AUTHOR/A,UPLOADER/A,SHORT/A,TYPE/A,REPLACES/A,REQUIRES/A,VERSION/A,CLEAN/S
.bra {
.ket }
;
; $VER: build-aminet 37.4 (08 Mar 1997)
;
; Changes in 1997 by Szabolcs Pethõ
; (C) Copyright 1995 Marius Gröger
;     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, REPLACES, REQUIRES, VERSION
;        Texts as required for Aminet contributions.
;
;    CLEAN
;        If set, previous readmes are deleted.
;
;
; $HISTORY:
;
; 08 Mar 1997 : 037.004 :  conforms the Aminet suggestions -> release name
;                            doesn't contain version string
;                          new Aminet infos -> more fields are filled
;                            (REPLACES,REQUIRES,VERSION)
;                          Aminet readme moved to the root dir of release
;
; 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}/{RELEASNAME}(%|[0-9])[0-9].[0-9](%|[0-9])(%|[0-9]).readme"
   Delete {ROOT}//{RELEASENAME}.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)"`
set relname {RELEASENAME}
Echo >{ROOT}//$relname.readme "Short:    {SHORT}*NAuthor:   {AUTHOR}*NUploader: {UPLOADER}*NType:     {TYPE}*NReplaces: {REPLACES}*NRequires: {REQUIRES}*NVersion:  {VERSION}*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 $relname.readme
$LHA d T:{RELEASENAME}/$relname.lha #?.(no|opt0[0-4]0)

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

UnSet relname
UnSet TAR
UnSet LHA

Echo "=== ready ==="

