/members.xml
/events.ics
/books.xml
-/default.mk
+/common.mk
-INPUTS = index.xml
-SUBDIRS = about events office news services media
+FILES = events.ics events.atom news.atom index.html \
+ favicon.ico default.css robots.txt csclub.der csclub.pem
+SUBDIRS = about events office news services media buttons logos flash
+include common.mk
-first: noroot events.ics members.xml events.atom news.atom all
+build: noroot mkoutdir common.mk $(OUTPUTS)
+ @for i in $(SUBDIRS) ; do ($(MAKE) -C $$i || exit 1); done
find ! -regex '.*/\..*' -type f ! -perm -0664 -print0 | xargs -r0 chmod u=rwX,g=rwX,o=rX || true
find ! -regex '.*/\..*' -type d ! -perm 2775 -print0 | xargs -r0 chmod 2775 || true
find ! -regex '.*/\..*' -type d ! -group www -print0 | xargs -r0 chgrp www || true
-noroot:
- if test $$UID = 0; then echo "don't build as root!"; exit 1; fi
-
-members.xml:
- test -e /usr/bin/ceoquery || (echo 'Erorr: ceoquery not found'; exit 1)
- echo '<?xml version='\''1.0'\''?>' > $@
- echo '<memberlist>' >> $@
- ceoquery memberlist | sort | awk -F \| '{ name = $$1; program = $$2; userid = $$3; gsub(/&/, "\\&", name); gsub(/&/, "\\&", program); gsub(/"/, "\\"", name); gsub(/"/, "\\"", program); print "<member name=\"" name "\" program=\"" program "\" userid=\"" userid "\" />"; }' >> $@
- echo '</memberlist>' >> $@
-
-events.ics:
- perl scripts/xml2ics.pl events.xml > events.ics
-
-include default.mk
-
-%.atom: %.xml xsl/atom.xsl
- java -classpath $(CLASSPATH) net.sf.saxon.Transform -o $@ $< $(ROOT)/xsl/atom.xsl $(XSLTARGS)
- sed -i 's| xmlns=""||' $@
-
-default.mk: default.mk.in
+common.mk: common.mk.in
echo 'ROOT = '`pwd` > $@
cat $< >> $@
+ make
+ exit $?
-.PHONY: members.xml
+.PHONY: noroot
+noroot:
+ if test $$UID = 0; then echo "don't build as root!"; exit 1; fi
-INPUTS = index.xml exec.xml members.xml constitution.xml \
- constitution-change-20020920.xml constitution-change-20040205.xml
+FILES = members.xml index.html exec.html members.html constitution.html \
+ constitution-change-20020920.html constitution-change-20040205.html
+RELDIR = about/
+include ../common.mk
-include ../default.mk
-
-members.html: ../members.xml
+$(OUTDIR)members.html: $(OUTDIR)members.xml
+$(OUTDIR)members.xml:
+ test -e /usr/bin/ceoquery || (echo 'Erorr: ceoquery not found'; exit 1)
+ echo '<?xml version='\''1.0'\''?>' > $@
+ echo '<memberlist>' >> $@
+ ceoquery memberlist | sort | awk -F \| '{ name = $$1; program = $$2; userid = $$3; gsub(/&/, "\\&", name); gsub(/&/, "\\&", program); gsub(/"/, "\\"", name); gsub(/"/, "\\"", program); print "<member name=\"" name "\" program=\"" program "\" userid=\"" userid "\" />"; }' >> $@
+ echo '</memberlist>' >> $@
--- /dev/null
+FILES = about.png events.png gitweb.png gopher.png home.png library.png \
+ mailman.png media.png office.png services.png stats.png webmail.png \
+ wiki.png
+RELDIR = buttons/
+include ../common.mk
--- /dev/null
+
+all: mkoutdir build
+
+OUTDIR = $(ROOT)/build/$(RELDIR)
+OUTPUTS = $(addprefix $(OUTDIR),$(FILES))
+
+.PHONY += mkoutdir
+mkoutdir:
+ mkdir -p $(OUTDIR)
+
+.PHONY += build
+build: $(OUTPUTS)
+
+.PHONY += clean
+clean:
+ rm -rf $(OUTDIR)
+
+XSLTARGS = g_date=`date -I` g_time=`date +%H:%M:%S` \
+ g_pwd="$$(pwd)" g_root="$(ROOT)" g_outdir="$(OUTDIR)"
+CLASSPATH = /users/www/saxon8/saxon8.jar
+
+$(OUTDIR)%.html: %.xml $(ROOT)/csc.dtd $(ROOT)/xsl/*.xsl $(ROOT)/events.xml $(ROOT)/news.xml directory.xml
+ java -classpath $(CLASSPATH) net.sf.saxon.Transform -o $@ $< $(ROOT)/xsl/html.xsl $(XSLTARGS)
+ sed -i 's| xmlns=""||' $@
+
+$(OUTDIR)%.atom: %.xml xsl/atom.xsl
+ java -classpath $(CLASSPATH) net.sf.saxon.Transform -o $@ $< $(ROOT)/xsl/atom.xsl $(XSLTARGS)
+ sed -i 's| xmlns=""||' $@
+
+$(OUTDIR)%.ics: %.xml
+ perl scripts/xml2ics.pl $< > $@
+
+$(OUTDIR)%.ico: %.ico
+ cp -f $< $@
+$(OUTDIR)%.css: %.css
+ cp -f $< $@
+$(OUTDIR)%.gif: %.gif
+ cp -f $< $@
+$(OUTDIR)%.png: %.png
+ cp -f $< $@
+$(OUTDIR)%.swf: %.swf
+ cp -f $< $@
+$(OUTDIR)%.js: %.js
+ cp -f $< $@
+$(OUTDIR)%.txt: %.txt
+ cp -f $< $@
+$(OUTDIR)%.der: %.der
+ cp -f $< $@
+$(OUTDIR)%.pem: %.pem
+ cp -f $< $@
+++ /dev/null
-<?xml version='1.0'?>
-
-<xsl:stylesheet version="2.0"
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:fn="http://www.w3.org/2005/xpath-functions"
- xmlns:csc="http://csclub.uwaterloo.ca/xslt">
-
-<xsl:param name="g_date" required="yes" />
-<xsl:param name="g_time" required="yes" />
-<xsl:param name="g_pwd" required="yes" />
-<xsl:param name="g_root" required="yes" />
-
-<!--
-
- Set global "g_pre" variable based on /cscpage/@pre, which represents the
- relative path needed to get to the root. If you do not include a "pre"
- attribute on cscpage then the "pre" attribute will default to "../".
-
--->
-<xsl:variable name="g_pre">
- <xsl:choose>
- <xsl:when test="/cscpage/@pre"><xsl:value-of select="/cscpage/@pre" /></xsl:when>
- <xsl:otherwise>../</xsl:otherwise>
- </xsl:choose>
-</xsl:variable>
-
-<!-- mirror variables -->
-<xsl:variable name="g_mirror_csc">http://csclub.uwaterloo.ca/files/</xsl:variable>
-<xsl:variable name="g_mirror_cs">http://mirror.cs.uwaterloo.ca/csclub/</xsl:variable>
-
-<xsl:output method="xml" encoding="ISO-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
-
-<!-- include additional style sheets -->
-<xsl:include href="./xsl/functions.xsl" />
-<xsl:include href="./xsl/common.xsl" />
-<xsl:include href="./xsl/directory.xsl" />
-<xsl:include href="./xsl/menu.xsl" />
-<xsl:include href="./xsl/exec.xsl" />
-<xsl:include href="./xsl/members.xsl" />
-<xsl:include href="./xsl/events.xsl" />
-<xsl:include href="./xsl/news.xsl" />
-<xsl:include href="./xsl/media.xsl" />
-
-<xsl:template match="*">
- <xsl:copy>
- <xsl:copy-of select="@*" />
- <xsl:apply-templates />
- </xsl:copy>
-</xsl:template>
-
-</xsl:stylesheet>
+++ /dev/null
-
-OUTPUTS=$(INPUTS:.xml=.html)
-XSLTARGS=g_date=`date -I` g_time=`date +%H:%M:%S` \
- g_pwd="$$(pwd)" g_root="$(ROOT)"
-CLASSPATH=/users/www/saxon8/saxon8.jar
-
-all: $(OUTPUTS)
- @for i in $(SUBDIRS) ; do cd $$i && ($(MAKE) || exit 1) && cd .. ; done
-
-clean:
- @for i in $(SUBDIRS) ; do cd $$i && ($(MAKE) clean || exit 1) && cd .. ; done
- rm -f *.html events.ics
-
-%.html: %.xml $(ROOT)/csc.dtd $(ROOT)/cscweb.xsl $(ROOT)/xsl/*.xsl $(ROOT)/events.xml $(ROOT)/news.xml $(ROOT)/default.mk directory.xml
- java -classpath $(CLASSPATH) net.sf.saxon.Transform -o $@ $< $(ROOT)/cscweb.xsl $(XSLTARGS)
- sed -i 's| xmlns=""||' $@
-INPUTS = index.xml old.xml
+FILES = index.html old.html
+RELDIR = events/
+include ../common.mk
-include ../default.mk
-
-all:
- sed -i 's| xmlns=""||' *.html
+build:
+ sed -i 's| xmlns=""||' $(OUTDIR)*.html
--- /dev/null
+FILES = flvplayer.swf swfobject.js
+RELDIR = flash/
+include ../common.mk
--- /dev/null
+FILES = acm_logo.gif csc_logo.gif csc_only.png csc_title.gif uw_logo.gif
+RELDIR = logos/
+include ../common.mk
-INPUTS = index.xml
-SUBDIRS =
+FILES = index.html
+RELDIR = media/
+include ../common.mk
-include ../default.mk
-
-all:
- sed -i 's| xmlns=""||' *.html
+build:
+ sed -i 's| xmlns=""||' $(OUTDIR)*.html
+++ /dev/null
-Redirect /media/files/ http://www.csclub.uwaterloo.ca/files/
+++ /dev/null
-../flash/
\ No newline at end of file
-INPUTS = index.xml
+FILES = index.html
+RELDIR = news/
+include ../common.mk
-include ../default.mk
-
-all:
- sed -i 's| xmlns=""||' *.html
+build:
+ sed -i 's| xmlns=""||' $(OUTDIR)*.html
-INPUTS = index.xml books.xml webcam.xml webcam-streaming.xml
-
-include ../default.mk
+FILES = index.html books.html webcam.html webcam-streaming.html
+RELDIR = office/
+include ../common.mk
-INPUTS = index.xml clubs.xml machine_usage.xml machine_usage_summary.xml \
- machine_usage-change-20070819.xml
-SUBDIRS =
-
-include ../default.mk
+FILES = index.html clubs.html machine_usage.html machine_usage_summary.html \
+ machine_usage-change-20070819.html
+RELDIR = services/
+include ../common.mk
<xsl:result-document method="xml" encoding="ISO-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
- href="{translate(concat($g_root, '/events/', @room, '-', @date, '-', @time, '.html'), ' ', '_')}">
+ href="{translate(concat($g_outdir, @room, '-', @date, '-', @time, '.html'), ' ', '_')}">
<html>
<head>
<title><xsl:value-of select="@title" /></title>
<xsl:result-document method="xml" encoding="ISO-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
- href="{translate(concat($g_root, '/events/old-', csc:term(@date), '.html'), ' ', '_')}">
+ href="{translate(concat($g_outdir, 'old-', csc:term(@date), '.html'), ' ', '_')}">
<html>
<head>
<title>Events for <xsl:value-of select="csc:term(@date)" /></title>
--- /dev/null
+<?xml version='1.0'?>
+
+<xsl:stylesheet version="2.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:fn="http://www.w3.org/2005/xpath-functions"
+ xmlns:csc="http://csclub.uwaterloo.ca/xslt">
+
+<xsl:param name="g_date" required="yes" />
+<xsl:param name="g_time" required="yes" />
+<xsl:param name="g_pwd" required="yes" />
+<xsl:param name="g_root" required="yes" />
+<xsl:param name="g_outdir" required="yes" />
+
+<!--
+
+ Set global "g_pre" variable based on /cscpage/@pre, which represents the
+ relative path needed to get to the root. If you do not include a "pre"
+ attribute on cscpage then the "pre" attribute will default to "../".
+
+-->
+<xsl:variable name="g_pre">
+ <xsl:choose>
+ <xsl:when test="/cscpage/@pre"><xsl:value-of select="/cscpage/@pre" /></xsl:when>
+ <xsl:otherwise>../</xsl:otherwise>
+ </xsl:choose>
+</xsl:variable>
+
+<!-- mirror variables -->
+<xsl:variable name="g_mirror_csc">http://csclub.uwaterloo.ca/files/</xsl:variable>
+<xsl:variable name="g_mirror_cs">http://mirror.cs.uwaterloo.ca/csclub/</xsl:variable>
+
+<xsl:output method="xml" encoding="ISO-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
+
+<!-- include additional style sheets -->
+<xsl:include href="functions.xsl" />
+<xsl:include href="common.xsl" />
+<xsl:include href="directory.xsl" />
+<xsl:include href="menu.xsl" />
+<xsl:include href="exec.xsl" />
+<xsl:include href="members.xsl" />
+<xsl:include href="events.xsl" />
+<xsl:include href="news.xsl" />
+<xsl:include href="media.xsl" />
+
+<xsl:template match="*">
+ <xsl:copy>
+ <xsl:copy-of select="@*" />
+ <xsl:apply-templates />
+ </xsl:copy>
+</xsl:template>
+
+</xsl:stylesheet>
<xsl:template match="flvfile">
<xsl:param name="mirror" />
- <script type="text/javascript" src="flash/swfobject.js"><xsl:text> </xsl:text></script>
+ <script type="text/javascript" src="../flash/swfobject.js"><xsl:text> </xsl:text></script>
<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">
Get the Flash Player</a> to see this video using Flash Player.</p>
<script type="text/javascript">
- var s1 = new SWFObject("flash/flvplayer.swf","single","400","300","7");
+ var s1 = new SWFObject("../flash/flvplayer.swf","single","400","300","7");
s1.addParam("allowfullscreen","true");
s1.addVariable("file","<xsl:value-of select="$mirror" /><xsl:value-of select="@file" />");
<xsl:if test="@preview">
<xsl:result-document method="xml" encoding="ISO-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
- href="{concat($g_root, '/media/', @title, $suffix, '.html')}">
+ href="{concat($g_outdir, @title, $suffix, '.html')}">
<html>
<head>
<title><xsl:value-of select="@title" /></title>
<xsl:template match="members-this-term">
<p>The members for <xsl:value-of select="csc:term($g_date)" /> are
listed here. We currently have
- <xsl:value-of select="count(document(concat($g_root, '/members.xml'))/memberlist/member)" />
+ <xsl:value-of select="count(document(concat($g_outdir, 'members.xml'))/memberlist/member)" />
members.</p>
<table>
<tr>
<th>Program</th>
<th>Userid</th>
</tr>
- <xsl:for-each select="document(concat($g_root, '/members.xml'))/memberlist/member">
+ <xsl:for-each select="document(concat($g_outdir, 'members.xml'))/memberlist/member">
<xsl:variable name="class">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">members1</xsl:when>
<xsl:result-document method="xml" encoding="ISO-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
- href="{translate(concat($g_root, '/news/old-', csc:term(@date), '.html'), ' ', '_')}">
+ href="{translate(concat($g_outdir, 'old-', csc:term(@date), '.html'), ' ', '_')}">
<html>
<head>
<title>News for <xsl:value-of select="csc:term(@date)" /></title>