* Website is now built in build/ by default * Build directory can be controlled via BUILDDIR environment variable * Build files are no longer accessible from the web pagenews-update
parent
7481af1666
commit
1f5b375820
@ -1,32 +1,20 @@ |
||||
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
|
||||
|
@ -1,7 +1,13 @@ |
||||
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>' >> $@
|
||||
|
@ -0,0 +1,5 @@ |
||||
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 |
@ -0,0 +1,50 @@ |
||||
|
||||
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 $< $@
|
@ -1,16 +0,0 @@ |
||||
|
||||
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=""||' $@
|
@ -1,6 +1,6 @@ |
||||
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
|
||||
|
@ -0,0 +1,3 @@ |
||||
FILES = flvplayer.swf swfobject.js
|
||||
RELDIR = flash/
|
||||
include ../common.mk |
@ -0,0 +1,3 @@ |
||||
FILES = acm_logo.gif csc_logo.gif csc_only.png csc_title.gif uw_logo.gif
|
||||
RELDIR = logos/
|
||||
include ../common.mk |
@ -1,7 +1,6 @@ |
||||
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
|
||||
|
@ -1 +0,0 @@ |
||||
Redirect /media/files/ http://www.csclub.uwaterloo.ca/files/ |
@ -1 +0,0 @@ |
||||
../flash/ |
@ -1,6 +1,6 @@ |
||||
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
|
||||
|
@ -1,3 +1,3 @@ |
||||
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 |
||||
|
@ -1,5 +1,4 @@ |
||||
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 |
||||
|
Loading…
Reference in new issue