Author: Nicholas Bamber <nicholas@periapt.co.uk>
Subject:
 The Makefile regenerates the compressed files and the error file.
 - Perl script failing in Makefile rule due to lack of permissions
 - Don't need to build XML stuff in same source directory (w3c-sgml-lib)
 - Need to debianize yui-compressor
Last-Update: 2013-03-15
Forwarded: no

--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@
 PERLTIDY = perltidy --profile=misc/perltidyrc --backup-and-modify-in-place
 PERLCRITIC = perlcritic --profile misc/perlcriticrc
 
-YUICOMPRESSOR = java -jar $(wildcard /usr/share/java/yuicompressor*.jar)
+YUICOMPRESSOR = java -jar /usr/share/yui-compressor/yui-compressor.jar
 GZIP = gzip -9n
 
 VALIDATOR_URI = http://localhost/w3c-validator/check
@@ -20,13 +20,11 @@
 # Override the above variables in config.mk if needed.
 -include config.mk
 
-all: htdocs/docs/errors.html htdocs/sgml-lib/catalog.xml $(GZIP_FILES)
+all: htdocs/docs/errors.html $(GZIP_FILES)
 
 htdocs/docs/errors.html: misc/docs_errors.pl share/templates/en_US/error_messages.cfg share/templates/en_US/docs_errors.tmpl htdocs/config/validator.conf
-	env W3C_VALIDATOR_HOME=. W3C_VALIDATOR_CFG=htdocs/config/validator.conf misc/docs_errors.pl > $@
-
-htdocs/sgml-lib/catalog.xml: misc/soc2xml.pl htdocs/sgml-lib/xml.soc
-	misc/soc2xml.pl < htdocs/sgml-lib/xml.soc > $@
+	mkdir debian/tmp
+	env W3C_VALIDATOR_HOME=. W3C_VALIDATOR_CFG=htdocs/config/validator.conf perl -T misc/docs_errors.pl > $@
 
 htdocs/scripts/combined.js: $(JS_SOURCES)
 	rm -f $@
--- a/misc/docs_errors.pl
+++ b/misc/docs_errors.pl
@@ -54,6 +54,11 @@
 included files are readable by the web server user. The error was:\n'$@'
 EOF
     }
+    use Cwd;
+    my $dir = getcwd;
+    $CFG->{Paths}->{TidyConf} = "$dir/htdocs/config/tidy.conf";
+    $CFG->{Paths}->{Base} = "$dir";
+    $CFG->{Paths}->{Templates} = "$dir/share/templates";
 }    # end of BEGIN block.
 
 #
