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

mkdir upstream
cd upstream
wget http://simh.trailing-edge.com/sources/simhv38-1.zip
wget http://simh.trailing-edge.com/sources/simtools.zip
mkdir simh-3.8.1
cd simh-3.8.1
cp ../simhv38-1.zip .
unzip simhv38-1.zip
rm simhv38-1.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.8.1.tar.gz simh-3.8.1/

exit


simh package log file

The purpose of this plain text file is to be a procedure or log or journal
of building a simh package.

Prepare a raw upstream dir
apt-get source simh to download the current package to get the old files
Generate an upstream file.  See the upstream.txt file.
Unpack the upstream file.
cd in the main simh dir
dh_make -f ../simh_3.8.1.tar.gz
single binary package, hit enter.

Clean up the debian directory
cd debian
mv changelog changelog.new
cp "the old changelog" changelog.old
cat changelog.new changelog.old > changelog
edit the changelog file to explain the situation
rm changelog.old changelog.new
cp "the old README.Debian" over the new README.Debian
cp "the old TODO" file into the new directory
cp all the *.1 manpages into the new directory
cp the old "rules" "control" "copyright" "docs" files into the debian dir
edit docs to reflect new version for 0readme file
cp the old "simh.manpages" "simh.menu" files into the debian dir
rm cron.d.ex init.d.ex watch.ex post* pre*
rm emacsen* menu.ex simh-default.ex simh.doc-base.EX
rm manpage.1.ex  manpage.sgml.ex  manpage.xml.ex
cp the README.source and itsbuild.html into the debian directory
cp all the simh.doc-base files into the debian directory
Now edit the files in the main directory
cp the old makefile over the distributed makefile
edit the makefile if necessary

Review and apply any standards changes, then edit control file

dpkg-buildpackage -rfakeroot

Fix all the compilation errors.

Run lintian -i and fix any errors

Test.
