# Script to create an upstream .tar.gz file for simh version 3.7.0
# Depends on packages wget and unzip
# This file is an executable script
# run it with this command line:
# /bin/bash ./upstream.txt
# The output tar file will be in ./upstream/

mkdir upstream
cd upstream
wget http://simh.trailing-edge.com/sources/simhv37-0.zip
wget http://simh.trailing-edge.com/sources/simtools.zip
mkdir simh-3.7.0
cd simh-3.7.0
cp ../simhv37-0.zip .
unzip simhv37-0.zip
rm simhv37-0.zip
mkdir DOCS
cd DOCS/
wget http://simh.trailing-edge.com/pdf/simh_doc.pdf
wget http://simh.trailing-edge.com/pdf/simh_swre.pdf
wget http://simh.trailing-edge.com/pdf/simh_faq.pdf
wget http://simh.trailing-edge.com/pdf/altairz80_doc.pdf
wget http://simh.trailing-edge.com/pdf/nova_doc.pdf
wget http://simh.trailing-edge.com/pdf/pdp1_doc.pdf
wget http://simh.trailing-edge.com/pdf/pdp18b_doc.pdf
wget http://simh.trailing-edge.com/pdf/pdp8_doc.pdf
wget http://simh.trailing-edge.com/pdf/pdp10_doc.pdf
wget http://simh.trailing-edge.com/pdf/pdp11_doc.pdf
wget http://simh.trailing-edge.com/pdf/vax780_doc.pdf
wget http://simh.trailing-edge.com/pdf/vax_doc.pdf
wget http://simh.trailing-edge.com/pdf/gri_doc.pdf
wget http://simh.trailing-edge.com/pdf/i1401_doc.pdf
wget http://simh.trailing-edge.com/pdf/i1620_doc.pdf
wget http://simh.trailing-edge.com/pdf/i7094_doc.pdf
wget http://simh.trailing-edge.com/pdf/id_doc.pdf
wget http://simh.trailing-edge.com/pdf/hp2100_doc.pdf
wget http://simh.trailing-edge.com/pdf/h316_doc.pdf
wget http://simh.trailing-edge.com/pdf/lgp_doc.pdf
wget http://simh.trailing-edge.com/pdf/sds_doc.pdf

wget http://simh.trailing-edge.com/docs/simh.pdf
wget http://simh.trailing-edge.com/docs/simh_vmio.pdf
wget http://simh.trailing-edge.com/docs/simh_breakpoints.pdf
wget http://simh.trailing-edge.com/docs/simh_magtape.pdf
wget http://simh.trailing-edge.com/docs/architecture18b.pdf
wget http://simh.trailing-edge.com/docs/decodingh316.pdf
wget http://simh.trailing-edge.com/docs/advmonsys.pdf
wget http://simh.trailing-edge.com/docs/pdp11interrupts.pdf
wget http://simh.trailing-edge.com/docs/bugfeature.pdf
wget http://simh.trailing-edge.com/docs/massbusmystery.pdf
wget http://simh.trailing-edge.com/docs/ucode_bugs.pdf
wget http://simh.trailing-edge.com/docs/hpiop.pdf
wget http://simh.trailing-edge.com/docs/ctss_hardware.pdf
wget http://simh.trailing-edge.com/docs/decsys.pdf
wget http://simh.trailing-edge.com/docs/card_readers_18b.pdf

cd ..
mkdir TOOLS
cd TOOLS/
cp ../../simtools.zip .
unzip simtools.zip
rm simtools.zip
cd ..
rm TOOLS/extracters/ckabstape.c # unknown licensing
rm -Rf TOOLS/extracters/backup # original author unknown = unknown licensing
rm -Rf TOOLS/extracters/rawcopy # unknown licensing
rm -Rf TOOLS/putr 
rm TOOLS/*.exe # don't need, don't trust msdos executables
rm TOOLS/ods2_readme.txt # docs for a utility not included
rm VAX/ka655x.bin # see line above
rm VAX/vmb.exe # msdos executable
rm -Rf Ibm1130 # license only allows "use" not redistribution
# admittedly, "use" is a universal verb that can be nearly any action
# but I'd prefer to remove it until explicit permission to redistribute 
# is granted.
cd ..
tar -czf simh_3.7.0.tar.gz simh-3.7.0/
