From 93036659b1ce197bc9dcd8b7c405f0aa7424ca8e Mon Sep 17 00:00:00 2001
From: Edward Longman <eialongman@gmail.com>
Date: Mon, 15 Feb 2021 11:43:09 +0000
Subject: [PATCH] Add prezipped quickstart options in makefile with ziptest
 make target

---
 source/latex/uosdocs/Makefile    | 42 ++++++++++++++++++++++++++++----
 source/latex/uosdocs/uosdocs.dtx |  6 ++---
 2 files changed, 40 insertions(+), 8 deletions(-)

diff --git a/source/latex/uosdocs/Makefile b/source/latex/uosdocs/Makefile
index ee57916..ef95465 100644
--- a/source/latex/uosdocs/Makefile
+++ b/source/latex/uosdocs/Makefile
@@ -72,11 +72,24 @@ DOCDIR     = "$(TEXMF)/doc/latex/$(STYLE)"
 BIBDIR     = "$(TEXMF)/bibtex/bib/$(STYLE)"
 SRCDIR     = "$(TEXMF)/source/latex/$(STYLE)"
 
+TEMPLATEDEPS = figure.eps UOS.bib
+ARTICLEDEPS = uosarticle.cls Article.tex $(TEMPATEDEPS)
+BOOKDEPS = $(TEMPATEDEPS) Definitions.tex Introduction.tex Conclusions.tex AppendixA.tex
+GDPDEPS = uosgdp.cls GDP.tex $(BOOKDEPS)
+GDPSUMMARYDEPS = uosgdpsummary.cls GDPSummary.tex $(TEMPATEDEPS)
+MINITHESISDEPS = uosminithesis.cls MiniThesis.tex $(BOOKDEPS)
+PROGRESSDEPS = uosprogress.cls Progress.tex $(BOOKDEPS)
+PROJECTDEPS = uosproject.cls Project.tex $(BOOKDEPS)
+REPORTDEPS = uosreport.cls  Report.tex $(BOOKDEPS)
+THESISDEPS = uosthesis.cls Thesis.tex UoSLogo.png $(BOOKDEPS)
+
 #*====================== LATEX INSTALLATION CONFIG ==========================
 
 LATEX      = pdflatex
 PDFTEXIFY  = texify --pdf
 MAKEINDEX  = makeindex
+ZIP = 7z a -tzip
+UNZIP = 7z e
 
 #*==================== DIFFERENT MAKE CONFIGURATIONS ========================
 
@@ -84,6 +97,8 @@ all: $(GENFILES) $(DOCFILES)
 
 dist: $(STYLE).zip
 test: $(GENFILES) $(TESTFILES)
+UNZIPFILES = $(patsubst %, unzipped/%, $(TESTFILES))
+ziptest: $(UNZIPFILES)
 
 #* .SECONDARY used to stop it building repeatedly
 #* https://stackoverflow.com/questions/2973445/
@@ -101,13 +116,30 @@ $(DOCFILES): $(STYLE).dtx
 
 %.pdf: %.tex
 	$(PDFTEXIFY) $*.tex
-
+unzipped/%.pdf: %.zip
+	$(UNZIP) -obuild/ $*.zip
+	$(PDFTEXIFY) build/$*.tex -output-directory="build/" --quiet
+	grep "2021/02/15 v1.3" build/$*.log
+	cp build/$*.pdf unzipped/$*.pdf
+	rm build/*
 #*========================== ZIP REQUIREMENTS ===============================
 
-
-$(STYLE).zip: $(GENFILES) $(DOCFILES)
-	$(MAKE) clean
-	zip $@ $(SRCFILES) $(GENFILES) $(DOCFILES)
+Article.zip: $(GENFILES) $(DOCFILES)
+	$(ZIP) $@ $(ARTICLEDEPS)
+GDP.zip: $(GENFILES) $(DOCFILES)
+	$(ZIP) $@ $(GDPDEPS)
+GDPSummary.zip: $(GENFILES) $(DOCFILES)
+	$(ZIP) $@ $(GDPSUMMARYDEPS)
+MiniThesis.zip: $(GENFILES) $(DOCFILES)
+	$(ZIP) $@ $(MINITHESISDEPS)
+Progress.zip: $(GENFILES) $(DOCFILES)
+	$(ZIP) $@ $(PROGRESSDEPS)
+Project.zip: $(GENFILES) $(DOCFILES)
+	$(ZIP) $@ $(PROJECTDEPS)
+Report.zip: $(GENFILES) $(DOCFILES)
+	$(ZIP) $@ $(REPORTDEPS)
+Thesis.zip: $(GENFILES) $(DOCFILES)
+	$(ZIP) $@ $(THESISDEPS)
 
 #*============================= CLEAN TYPES =================================
 clean:
diff --git a/source/latex/uosdocs/uosdocs.dtx b/source/latex/uosdocs/uosdocs.dtx
index 542b63b..ecf60b4 100644
--- a/source/latex/uosdocs/uosdocs.dtx
+++ b/source/latex/uosdocs/uosdocs.dtx
@@ -28,7 +28,7 @@
 \ProvidesFile{uosdocs.drv}
 %</driver>
 %<*thesis|minithesis|progress|project|report|article|gdp|gdpsummary|driver>
-              [2020/09/16 v1.2
+              [2021/02/15 v1.3
 %</thesis|minithesis|progress|project|report|article|gdp|gdpsummary|driver>
 %<thesis|minithesis|progress|project|report|article|gdp|gdpsummary>   LaTeX document class]
 %    \end{macrocode}
@@ -1265,9 +1265,9 @@
 %<*thesis|minithesis|progress|project|report|gdp>
     \chapter*{\addmaterialname
 %</thesis|minithesis|progress|project|report|gdp>
-%<*article>
+%<*article|gdpsummary>
     \section*{\addmaterialname
-%</article>
+%</article|gdpsummary>
       \@mkboth{
           \MakeUppercase\addmaterialname}{\MakeUppercase\addmaterialname}}
     \@starttoc{lom}
-- 
GitLab