1
0

New ZIP package creation script and packages added

This commit is contained in:
acn
2020-12-03 15:25:58 +01:00
parent 7575829669
commit 7e2497344e
42 changed files with 129 additions and 27 deletions
+46
View File
@@ -0,0 +1,46 @@
# Packages
In this directory, I created ``.zip`` packages of all games for BBS distribution.
The files are created by using Info-ZIP ``zip`` on Linux.
## The .zip packages
All .zip packages are placed in the directory [ZIP](ZIP/).
The files can be extracted using the CP/M UNZIP command that can also be found here:
* [UNZIP154.COM](UNZIP154.COM) - CP/M binary
* [UNZIP154.LBR](UNZIP154.LBR) - archive including source
The Github repository for this UNZIP can be found here: https://github.com/agn453/UNZIP-CPM-Z80
## Package creation
I've created scripts to automatically create the .zip archives as well as the HDimage.
For this to work, in every game directory, a file called ``.package`` is created which controls
the package creation process.
``.package`` is a semicolon separated file.
The first value contains a letter which indicates:
| N | name of the package (for .zip creation) |
| F | file (binary or game data) |
| S | source file (won't be put into HDimage) |
| R | README file, will be renamed <packagename>.DOC |
| D | description, will be put into ``FILE_ID.DIZ`` |
The second value contains the value for the kind of line.
Optionally, a third value can exist for ``F``, ``S`` and ``R`` lines which defines a target filename,
eg. if the original filename does not conform to the ``8.3`` format. The file will be put in the archive
under this new filename.
For example:
S;gpl-3.0.txt;GPL3.TXT
will put the file ``gpl-3.0.txt`` as ``GPL3.TXT`` in the .zip file, but not in the HDimage (as
source files will only be put in the .zip archives).
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+49
View File
@@ -0,0 +1,49 @@
#!/bin/bash
# where to store the packages
TARGET=${PWD}/ZIP
[ ! -d ${TARGET} ] && mkdir ${TARGET}
# get list of directories with .package files
DIRS=""
cd ..
for i in $(find . -name ".package"); do
DIRS="${DIRS} $(dirname $i)"
done
for pkg in ${DIRS}; do
echo "----- ${pkg}"
TMPDIR=$(mktemp -d)
NAME=""
while read LINE; do
IFS=';' read -ra DATA <<< ${LINE}
# the name of the target .zip archive:
[ "${DATA[0]}" = "N" ] && NAME=${DATA[1]}
# standard/source files:
if [ "${DATA[0]}" = "F" -o "${DATA[0]}" = "S" ]; then
if [ "${DATA[2]}" = "" ]; then
cp ${pkg}/${DATA[1]} ${TMPDIR}/${DATA[1]^^}
else
cp ${pkg}/${DATA[1]} ${TMPDIR}/${DATA[2]}
fi
fi
# README file:
if [ "${DATA[0]}" = "R" ]; then
if [ "${DATA[2]}" = "" ]; then
pandoc -f markdown -t plain -s ${pkg}/${DATA[1]} -o ${TMPDIR}/${NAME}.DOC
else
pandoc -f markdown -t plain -s ${pkg}/${DATA[1]} -o ${TMPDIR}/${DATA[2]}
fi
fi
# FILE_ID.DIZ contents:
[ "${DATA[0]}" = "D" ] && echo "${DATA[1]}" >> ${TMPDIR}/FILE_ID.DIZ
done < ${pkg}/.package
zip -k -j ${TARGET}/${NAME}.ZIP ${TMPDIR}/*
rm -R ${TMPDIR}
done