summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.hgignore2
-rw-r--r--Makefile15
-rw-r--r--httpd/conf/httpd.conf9
3 files changed, 23 insertions, 3 deletions
diff --git a/.hgignore b/.hgignore
index 5a6fa9b..9180bfd 100644
--- a/.hgignore
+++ b/.hgignore
@@ -2,7 +2,7 @@ syntax: glob
.project
*.pyc
-*.tar.gz
+*.gz
httpd/cgi-bin/*.bak
misc/*.bak
misc/bundle/*.bak
diff --git a/Makefile b/Makefile
index 8d48512..c1d6c85 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,20 @@
VERSION = $(shell perl -ne '/^\$$VERSION\b.*?([\d.]+)/ && print $$1' httpd/cgi-bin/check)
+CSS_FILES = $(wildcard htdocs/*.css htdocs/style/*.css)
+JS_FILES = $(wildcard htdocs/scripts/*.js)
PERL_FILES = httpd/cgi-bin/check httpd/cgi-bin/sendfeedback.pl \
misc/soc2xml.pl misc/spmpp.pl misc/docs_errors.pl \
misc/bundle/Makefile.PL misc/bundle/lib/Bundle/W3C/Validator.pm
+GZIP_FILES = $(addsuffix .gz,$(CSS_FILES) $(JS_FILES))
PERLTIDY = perltidy --profile=misc/perltidyrc --backup-and-modify-in-place
PERLCRITIC = perlcritic --profile misc/perlcriticrc
+GZIP = gzip -9n
+
VALIDATOR_URI = http://localhost/w3c-validator/check
-all: htdocs/docs/errors.html htdocs/sgml-lib/catalog.xml
+all: htdocs/docs/errors.html htdocs/sgml-lib/catalog.xml $(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 > $@
@@ -17,6 +22,9 @@ htdocs/docs/errors.html: misc/docs_errors.pl share/templates/en_US/error_message
htdocs/sgml-lib/catalog.xml: misc/soc2xml.pl htdocs/sgml-lib/xml.soc
misc/soc2xml.pl < htdocs/sgml-lib/xml.soc > $@
+.css.css.gz .js.js.gz:
+ $(GZIP) -c $< > $@ && touch -r $< $@
+
test:
misc/testsuite/harness.py --validator_uri=$(VALIDATOR_URI) run
@@ -29,6 +37,9 @@ perltidy:
$(PERLTIDY) $$file ; \
done
+clean:
+ rm -f $(GZIP_FILES)
+
dist: all
@for file in htdocs/footer.html htdocs/whatsnew.html \
httpd/cgi-bin/check share/templates/*/footer.tmpl ; do \
@@ -37,3 +48,5 @@ dist: all
exit 1 ; } ; \
done
misc/mkrelease.sh $(VERSION)
+
+.SUFFIXES: .css .css.gz .js .js.gz
diff --git a/httpd/conf/httpd.conf b/httpd/conf/httpd.conf
index 419abcb..7cfda76 100644
--- a/httpd/conf/httpd.conf
+++ b/httpd/conf/httpd.conf
@@ -46,7 +46,14 @@ Alias /w3c-validator/ /usr/local/validator/htdocs/
AllowOverride None
AddHandler server-parsed .html
AddCharset utf-8 .html
-
+ AddEncoding x-gzip .gz
+ <Files *.js.gz>
+ ForceType application/javascript
+ </Files>
+ <Files *.css.gz>
+ ForceType text/css
+ </Files>
+
<IfModule mod_rewrite.c>
Options +SymLinksIfOwnerMatch
RewriteEngine On