|
|
|
### Programme ###
|
|
|
|
# XSLT-Prozessor:
|
|
|
|
PROCESSOR=xsltproc
|
|
|
|
PFLAGS=--catalogs
|
|
|
|
# XML-Validator
|
|
|
|
VALIDATOR=xmllint
|
|
|
|
VFLAGS=--noout --valid --catalogs
|
|
|
|
SGML_CATALOG_FILES=$(XML_CATALOG)
|
|
|
|
export SGML_CATALOG_FILES
|
|
|
|
# Downloadmanager (Alternativ: curl, fetch):
|
|
|
|
WGET=wget --timestamping
|
|
|
|
# rsync
|
|
|
|
RSYNC=rsync
|
|
|
|
RSYNC_FLAGS=--verbose --recursive --delete --delete-after --delete-excluded --checksum
|
|
|
|
# Editor
|
|
|
|
EDITOR?=vim
|
|
|
|
# Browser
|
|
|
|
BROWSER?=links
|
|
|
|
|
|
|
|
### Ressourcen ###
|
|
|
|
# XSLT-Stylesheets:
|
|
|
|
STYLE=xsl/xhtml.xsl
|
|
|
|
DS_STYLE=xsl/datenspuren/xhtml.xsl
|
|
|
|
# Document-Type-Definition:
|
|
|
|
DTD:=dtd/c3d2web.dtd
|
|
|
|
# XML-Katalog (Pfad zu den DTDs) - wird benötigt vom Validator
|
|
|
|
XML_CATALOG:=dtd/catalog.xml
|
|
|
|
# Navigationsleiste:
|
|
|
|
NAVIGATION=content/navigation.xml
|
|
|
|
# Chaosupdates:
|
|
|
|
WWW_CCC_DE_UPDATES=chaosupdates.rdf
|
|
|
|
|
|
|
|
### Ziele ###
|
|
|
|
# Dateinamen der zu erzeugenden html-Dateien:
|
|
|
|
CONTENT=$(PAGES) $(NEWS_PAGES) $(DS_PAGES) $(NEWSFILES)
|
|
|
|
|
|
|
|
# 'normale' Seiten:
|
|
|
|
PAGES:=$(patsubst content/pages/%.xml, build/%.html, $(wildcard content/pages/*.xml))
|
|
|
|
# Seiten zu einzelnen News-Items:
|
|
|
|
NEWS_PAGES:=$(patsubst content/news/%.xml, build/news/%.html, $(wildcard content/news/*.xml))
|
|
|
|
# News-Index und Feeds:
|
|
|
|
NEWSFILES:=build/news.html build/news-rss.xml build/news-atom.xml
|
|
|
|
# Datenspuren-Seiten:
|
|
|
|
DS_PAGES:=$(patsubst content/datenspuren/%.xml, build/datenspuren/%.html, $(wildcard content/datenspuren/*.xml)) build/datenspuren/schedule.html
|
|
|
|
|
|
|
|
# Quellen
|
|
|
|
NEWSITEMS:=$(wildcard content/news/*.xml)
|
|
|
|
CLEAN=$(CONTENT) $(NEWSFILES) $(WWW_CCC_DE_UPDATES) $(DS_PAGES)
|
|
|
|
|
|
|
|
|
|
|
|
### Defaults ###
|
|
|
|
|
|
|
|
www: $(XML_CATALOG) $(CONTENT)
|
|
|
|
$(RSYNC) $(RSYNC_FLAGS) content/static/ build/ $@
|
|
|
|
|
|
|
|
.SILENT: check
|
|
|
|
.PHONY: check
|
|
|
|
check: $(PAGES)
|
|
|
|
# XXX
|
|
|
|
for page in $^ ; do \
|
|
|
|
echo "Checking $${page}..." ; \
|
|
|
|
$(VALIDATOR) $(VFLAGS) $${page} ; \
|
|
|
|
done
|
|
|
|
|
|
|
|
### Regeln für den XSLT-Prozess ###
|
|
|
|
|
|
|
|
build/news.html: $(STYLE)
|
|
|
|
build/news-rss.xml: xsl/rss.xsl
|
|
|
|
build/news-atom.xml: xsl/atom.xsl
|
|
|
|
|
|
|
|
$(NEWSFILES) : STYLE=$(filter-out $(NEWSITEMS) $(NAVIGATION),$^)
|
|
|
|
$(NEWSFILES): $(NAVIGATION) $(NEWSITEMS)
|
|
|
|
for item in $(NEWSITEMS) ; do \
|
|
|
|
$(VALIDATOR) $(VFLAGS) $${item} || exit 1 ; \
|
|
|
|
done
|
|
|
|
|
|
|
|
sh scripts/gen_news.xml.sh $(NEWSITEMS) | $(PROCESSOR) $(PFLAGS) -o $@ $(STYLE) -
|
|
|
|
|
|
|
|
content/datenspuren/schedule.xml: content/static/datenspuren/fahrplan/days.de.html
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
build/%.html: content/pages/%.xml $(STYLE) $(NAVIGATION) $(WWW_CCC_DE_UPDATES)
|
|
|
|
$(VALIDATOR) $(VFLAGS) $<
|
|
|
|
$(PROCESSOR) $(PFLAGS) -o $@ $(STYLE) $<
|
|
|
|
|
|
|
|
build/datenspuren/%.html: content/datenspuren/%.xml $(DS_STYLE)
|
|
|
|
# -- MNE-20060421: Lt. Astro geht Validierung noch nicht mit dem Fahrplan,
|
|
|
|
# daher fuer Datenspuren auskommentiert
|
|
|
|
$(VALIDATOR) $(VFLAGS) $<
|
|
|
|
$(PROCESSOR) $(PFLAGS) -o $@ $(DS_STYLE) $<
|
|
|
|
|
|
|
|
build/news/%.html: content/news/%.xml $(STYLE) $(NAVIGATION) $(WWW_CCC_DE_UPDATES)
|
|
|
|
$(VALIDATOR) $(VFLAGS) $<
|
|
|
|
$(PROCESSOR) $(PFLAGS) -o $@ $(STYLE) $<
|
|
|
|
|
|
|
|
dtd/catalog.xml:
|
|
|
|
sh scripts/gen_catalog.xml.sh > $@
|
|
|
|
|
|
|
|
### Die neuesten Chaosupdates holen ###
|
|
|
|
$(WWW_CCC_DE_UPDATES):
|
|
|
|
$(WGET) http://www.ccc.de/updates/$(WWW_CCC_DE_UPDATES) || \
|
|
|
|
cp chaosupdates-2006-01-02.rdf $@
|
|
|
|
|
|
|
|
### Mr. Propper ###
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f $(CLEAN)
|