diff options
-rw-r--r-- | .hgignore | 2 | ||||
-rw-r--r-- | Makefile | 15 | ||||
-rw-r--r-- | httpd/conf/httpd.conf | 9 |
3 files changed, 23 insertions, 3 deletions
@@ -2,7 +2,7 @@ syntax: glob .project *.pyc -*.tar.gz +*.gz httpd/cgi-bin/*.bak misc/*.bak misc/bundle/*.bak @@ -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 |