Description: reconfiguration and fixes toward bullseye
 * Observed that, as of upstream version 0.57.20190831, the book's
   source has been updated to build using modern, standard tools
   like PDFLaTeX and Hyperref; and, consequently, that upstream
   has retired and deleted btool/, removing the file PDF.cc and thus
   obviating (as of the present upload to sid) Lucas Nussbaum's
   Sept. 2020 bug report (closes: #971095).  Thanked Lucas for the
   timely, helpful report.
 * Reconfigured and rebuilt for upload to Debian sid.
 * Conformed to Standards-Version 4.5.1.
 * Specified the binary to be Multi-Arch: all.
 * Temporarily worked around new, perhaps buggy behavior by TeX Live.
   (In the new TeX Live, Pst-pdf seems to interact badly with
   Hyperref.  The present workaround works for now but provokes Ps2pdf
   to complain of deprecated usage; so before the Derivations package
   can implement a permanent solution, the future manner in
   which TeX Live addresses the apparent bug shall have to
   be observed.)
 * In tex/Makefile, added a missing, apparently optional = sign to an
   invocation of latex(1) and fixed the definition of the $(ch)
   variable.  (These changes will be sent upstream.)
 * Updated tex/README.  (This change too will be sent upstream.)
Author: Thaddeus H. Black <thb@debian.org>
Bug-Debian: https://bugs.debian.org/971095
Last-Update: 2021-01-19

--- derivations-0.57.20210107.orig/tex/Makefile
+++ derivations-0.57.20210107/tex/Makefile
@@ -92,9 +92,27 @@ dobd      := dobuilddraft
 dobd0     := dobd0.tex
 # Possibly confusingly, the "0" in "dobd0" means
 # roughly the opposite of the "0" in "main0".
+#
+# The several lines in this file that mention "dobp*"
+# and/or "dobuildpstonly" were added or (in the case of the file's
+# rules) changed as a workaround toward Debian 11 bullseye, for Debian
+# sid's recent Pst-pdf had been interacting badly with Hyperref (the
+# bad interaction seemingly having been inadvertently introduced
+# by TeX Live upstream).  The "dobp*" and "dobuildpstonly" lines
+# temporarily shunt Hyperref aside while Pst-pdf acts.  Besides the
+# foregoing, the -dALLOWPSTRANSPARENCY option was added to the ps2pdf
+# invocation (ps2pdf complains of deprecated behavior when this is
+# done, so one expects this part of the workaround, at least, to fail
+# for some future version of ps2pdf unless the other relevant tools are
+# updated).  Whether part or all of the workaround is to be retained
+# and/or integrated after bullseye's release has not, at this Jan. 2021
+# writing, been decided:  the workaroud has been little tested except
+# for purpose of building the Debian package.
+dobp      := dobuildpstonly
+dobp0     := dobp0.tex
 
 clsdir    := /usr/share/texlive/texmf-dist/tex/latex/base
-dobd-null := /dev/null
+dob-null  := /dev/null
 
 # Earlier versions of the book directly invoked GhostScript at PDF
 # level at 1.4.  Current versions let tools or TEX source set the
@@ -143,11 +161,12 @@ main        := $(main0).tex
 cls0        := $(class).cls
 cls         := $(out)-$(cls0)
 dobd1       := $(dobd).tex
-ch          := $(\
-                filter-out $(main) $(def) \
-                $(wildcard $(tmpl0)-*.tex), \
-                $(wildcard *.tex)\
-              )
+dobp1       := $(dobp).tex
+ch          := $(filter-out \
+                 $(main) $(def) $(wildcard $(tmpl0)-*.tex) \
+                 $(dobd0) $(dobd1) $(dobp0) $(dobp1), \
+                 $(wildcard *.tex)\
+               )
 bibtex      := bibtex    $(main0).aux
 makeindex   := makeindex $(main0).idx
 exists-dobd := [ -h "$(dobd1)" -a -e "$(dobd1)" ]
@@ -158,14 +177,17 @@ pdflatex     = pdflatex -shell-restricte
 .PHONY: all FORCE clean-for-pdf clean-for-dvi cleanless2 cleanless clean
 all : $(out).pdf
 
-$(out).pdf   : $(main) $(def) $(cls) $(ch) $(bib) | clean-for-pdf
-	rm -fv $(dobd1) && ln -sv $(dobd-null) $(dobd1)
+$(out).pdf   : $(main) $(def) $(cls) $(ch) $(bib) $(dobp0) | clean-for-pdf
+	rm -fv $(dobd1) && ln -sv $(dob-null) $(dobd1)
+	rm -fv $(dobp1) && ln -sv $(dob-null) $(dobp1)
 	$(pdflatex)
 	$(bibtex)
+	rm -fv $(dobp1) && ln -sv $(dobp0) $(dobp1)
 	@# Do not invoke $(latex) here but issue the command directly.
-	latex -jobname $(main0)-$(pics) $<
+	latex -jobname=$(main0)-$(pics) $<
+	rm -fv $(dobp1) && ln -sv $(dob-null) $(dobp1)
 	dvips -o $(main0)-$(pics).ps $(main0)-$(pics).dvi
-	ps2pdf   $(main0)-$(pics).ps
+	ps2pdf -dALLOWPSTRANSPARENCY $(main0)-$(pics).ps
 	$(pdflatex)
 	$(makeindex)
 	$(pdflatex)
@@ -178,8 +200,9 @@ $(out).pdf   : $(main) $(def) $(cls) $(c
 # quick PS draft serves the purpose.)
 $(out).ps    : $(main0).dvi
 	dvips -t letter -o $@ $<
-$(main0).dvi : $(main) $(def) $(cls) $(ch) $(dobd0) | clean-for-dvi
+$(main0).dvi : $(main) $(def) $(cls) $(ch) $(dobd0) $(dobp0) | clean-for-dvi
 	rm -fv $(dobd1) && ln -sv $(dobd0) $(dobd1)
+	rm -fv $(dobp1) && ln -sv $(dobp0) $(dobp1)
 	$(latex)
 	$(latex)
 
@@ -214,7 +237,7 @@ $(cls) :
 # cleanless" removes the various intermediate TeX working files, but
 # leaves intact the final output document files.
 clean-for-pdf :
-	if $(exists-dobd) && [ "$(dobd-target)" != "$(dobd-null)" ]; then \
+	if $(exists-dobd) && [ "$(dobd-target)" != "$(dob-null)" ]; then \
 	  $(MAKE) cleanless2; \
 	fi
 clean-for-dvi :
@@ -225,7 +248,7 @@ cleanless2    :
 	rm -fv *.{aux,bbl,blg,idx,ilg,ind,log,lof,lot,toc,pgn,out,bak} \
 	  *-$(pics).{dvi,ps,pdf}
 cleanless     : cleanless2
-	rm -fv *.{cls,dvi} $(dobd1)
+	rm -fv *.{cls,dvi} $(dobd1) $(dobp1)
 clean         : cleanless
 	rm -fv *.{ps,pdf}
 
--- derivations-0.57.20210107.orig/tex/README
+++ derivations-0.57.20210107/tex/README
@@ -1,8 +1,8 @@
 
 This directory contains the LaTeX and BibTeX source
-files for the book.  In addition to TeX, LaTeX, BibTeX,
-AMSmath and PSTricks, you also need Rubber installed to
-build the source with the default Makefile.
+files for the book.  To build the book also needs TeX,
+LaTeX, PDFLaTeX, BibTeX, AMSmath and PSTricks,
+among others.
 
 NOTES
 
--- /dev/null
+++ derivations-0.57.20210107/tex/dobp0.tex
@@ -0,0 +1 @@
+\setboolean{dobuildpstonly}{true}
--- derivations-0.57.20210107.orig/tex/main.tex
+++ derivations-0.57.20210107/tex/main.tex
@@ -4,6 +4,7 @@
 \documentclass[11pt,twoside,openright,letterpaper]{derivations-book}
 \usepackage{thb}
 \newboolean{dobuilddraft}\setboolean{dobuilddraft}{false}\include{dobuilddraft}
+\newboolean{dobuildpstonly}\setboolean{dobuildpstonly}{false}\include{dobuildpstonly}
 \ifthenelse{\boolean{dobuilddraft}}{}{\usepackage{pst-pdf}}
 \newboolean{isearlyflexedition}
 \setboolean{isearlyflexedition}{true}
@@ -19,12 +20,12 @@
 \ifthenelse{\boolean{dobuilddraft}}{}{\makeindex}
 
 %\includeonly{vector}
-\ifthenelse{\boolean{dobuilddraft}}{}{
+\ifthenelse{\boolean{dobuilddraft}}{}{\ifthenelse{\boolean{dobuildpstonly}}{}{
   % This package asks to be loaded last.  Observe that the value
   % of pdftitle is a PDF rather than a TEX entity, so it gets
   % no TEX markup.
   \usepackage[hidelinks,pdftitle={Thaddeus H. Black}]{hyperref}
-}
+}}
 \begin{document}
 \newwrite\locallog
 \immediate\openout\locallog=\jobname.pgn
