# # External stuff, i.e. stuff outside this directory # W=../../.. PYTHON=python2.4 CWM=$(PYTHON) $(W)/2000/10/swap/cwm.py CVS=cvs GZIP=gzip #SAXON=java -jar /usr/local/jre_lib_ext/saxon8.jar SAXON=saxon GEN=$(W)/Web/Tools/Generator/generator-ij UPDATE_FILE=/tmp/update TRDIR=TR RULEDIR=Web/fragments VIEWDIR=2006/07/home/wire/views HISTORYDIR=2006/07/home/wire/history TRCHECKPOINT=tr-20110921.rdf TOOLS=/2001/08/date-util.xslt /2001/10/str-util.xsl /2001/10/trdoc2rdf.xslt /2000/04/mem-news/date-util.xml /2001/07/pubrules-copyright.xml /2000/04/mem-news/public-groups.rdf /2006/07/home/wire/views/Makefile.views include $(W)/$(VIEWDIR)/Makefile.views GZIPOBJECTS=$(TRVIEWS:.html=.html.gz) #Note: This assumes the spec has been wrapped already! all: tr.rdf views historystatus # see also make supersede when superseding a spec ############# Update first ############# update: $(UPDATE_FILE) $(UPDATE_FILE): FORCE touch $@ $(CVS) -q update -@(cd $(W)/..; \ rm -rf $(addprefix WWW,$(TOOLS)); $(CVS) -q checkout $(addprefix WWW,$(TOOLS)); \ rm -rf $(addprefix WWW/TR/,$(TRVIEWS)); $(CVS) -q checkout $(addprefix WWW/TR/,$(TRVIEWS)); \ rm -rf $(addprefix WWW/TR/,$(GZIPOBJECTS)); $(CVS) -q checkout $(addprefix WWW/TR/,$(GZIPOBJECTS)); \ rm -rf WWW/2008/site/templates; $(CVS) -q checkout WWW/2008/site/templates; \ rm -rf WWW/standards/history; $(CVS) -q checkout WWW/standards/history; \ rm -rf WWW/standards/techs; $(CVS) -q checkout WWW/standards/techs; \ rm -rf WWW/Web/fragments; $(CVS) -q checkout WWW/Web/fragments; \ rm -rf WWW/$(VIEWDIR); $(CVS) -q checkout WWW/$(VIEWDIR); \ rm -rf WWW/$(HISTORYDIR); $(CVS) -q checkout WWW/$(HISTORYDIR); \ rm -rf WWW/standards/Overview.html; $(CVS) -q checkout WWW/standards/Overview.html; \ rm -rf $(addprefix WWW/$(RULEDIR)/,tr-views.xml tr-views-feeds.xml recent-fpwd.xml tr-histories.xml tr-techs.xml navigation-tr.xml); $(CVS) -q checkout $(addprefix WWW/$(RULEDIR)/,tr-views.xml tr-views-feeds.xml recent-fpwd.xml tr-histories.xml tr-techs.xml navigation-tr.xml); \ $(CVS) -q checkout WWW/Web/Tools/Generator WWW/Systems/lib/php) ############# Data ############# known-tr-editors.rdf: known-tr-editors.n3 $(CWM) known-tr-editors.n3 --rdf >$@ tr.rdf: $(TRCHECKPOINT) new-tr.rdf tr-process.n3 filter-trdata.n3 TRCHECKPOINT="http://www.w3.org/2002/01/tr-automation/$(TRCHECKPOINT)" $(CWM) --chatty=$(CHATTY) tr-process.n3 --think --rdf new-tr.rdf $(TRCHECKPOINT) --filter=filter-trdata.n3 --rdf > $@ CHATTY=0 tr.n3: tr.rdf $(CWM) --rdf tr.rdf --n3 >$@ ############# Views ############# views: FORCE ifdef USER (cd $(W)/$(VIEWDIR); make USER="$(USER)" PASSWORD='$(PASSWORD)' TRAUTO=$(W)/../../2002/01/tr-automation SAXON="$(SAXON)" install install-fpwd) else (cd $(W)/$(VIEWDIR); make TRAUTO=$(W)/2002/01/tr-automation SAXON="$(SAXON)" install install-fpwd) endif $(GEN) $(W)/$(RULEDIR)/tr-views.xml $(GEN) $(W)/$(RULEDIR)/tr-views-feeds.xml #compress the final versions (after running generator) $(MAKE) compress $(GEN) $(W)/$(RULEDIR)/recent-fpwd.xml ############# Compress ############# compress: FORCE $(MAKE) $(addprefix $(W)/TR/,$(GZIPOBJECTS)) ############# History and Status ############# historystatus: FORCE ifndef URI ifneq ($(shell cat $(UPDATE_FILE)),) override URI=$(shell cat $(UPDATE_FILE)) endif endif ifdef URI ifdef USER (cd $(W)/$(HISTORYDIR); make USER="$(USER)" PASSWORD='$(PASSWORD)' TRAUTO=$(W)/../../2002/01/tr-automation PYTHON="$(PYTHON)" SAXON="$(SAXON)" DOCURIS="$(URI)" installsome) else (cd $(W)/$(HISTORYDIR); make TRAUTO=$(W)/2002/01/tr-automation PYTHON="$(PYTHON)" SAXON="$(SAXON)" DOCURIS="$(URI)" installsome) endif $(GEN) $(W)/$(RULEDIR)/tr-histories.xml $(GEN) $(W)/$(RULEDIR)/tr-techs.xml $(GEN) $(W)/$(RULEDIR)/navigation-tr.xml else $(error URI parameter missing. Syntax: make historystatus URI=http://www.w3.org/TR/...) endif ############# Create new tr.rdf data ############# newtr: ifdef URI rm -f $(UPDATE_FILE) echo "$(URI)" >> $(UPDATE_FILE) ./mkNewTr $(URI) else $(error URI parameter missing. Syntax: make newtr URI=http://www.w3.org/TR/...) endif ############# Run Checks ############# check-validity: FORCE -@echo "Should check validity of all files" # ./checkValidity check-include: FORCE -@echo "Should check that all specs appear in all files" #ifndef URI #ifneq ($(shell cat $(UPDATE_FILE)),) #override URI=$(shell cat $(UPDATE_FILE)) #endif #endif #ifdef URI # ./checkInclude $(URI) #endif #### Special Activities for First and Supersede #### first: specgroups_add menus_add one_sentence supersede: specgroups_remove menus_remove update_history one_sentence: FORCE -@echo "Get 1-sentence descriptions for status pages; calculate where the sentence should appear by looking at latest version URI and which groups that is in in techs.rdf; store in /standards/techs/descs/shortname or /standards/techs/descs/(REC|NOTE)-shortname-YYYYMMDD" ############# Update menu tool ############# USETIDY=false menus_add: FORCE -@(cd $(W)/Web/Tools/MenuGenerator/; \ SHORTNAME=`echo "$(URI)" | sed -r "s;http://www.w3.org/TR/[0-9]{4}/[A-Z]{2,4}-(.+)-[0-9]{8}/?$$;\1;"`; \ TITLE=`saxon $(W)/Web/Tools/MenuGenerator/getTitle.xsl $(W)/Web/Tools/MenuGenerator/getTitle.xsl lvuris="http://cgi.w3.org/cgi-bin/tidy-if?docAddr=$(URI)" | cut -d' ' -f2- | sed 's/ //g'`; \ RES=`./generateMenus.sh "$(USER)" '$(PASSWORD)' add child /TR/Overview.html nomenu "/TR/$$SHORTNAME/" "$$TITLE"`; \ echo "$$RES" | tail -n+2; \ echo ++++++++++++++++++++; \ ./generateMenus.sh "$(USER)" '$(PASSWORD)' add child /TR/$$SHORTNAME/ nomenu "/standards/history/$$SHORTNAME.html" "$$TITLE%20Publication%20History%0A"; \ echo ====================; \ ./generateMenus.sh "$(USER)" '$(PASSWORD)' bake) -@echo "Update menu tool for (1) fpwd and history (2) new or deleted group in techs.rdf" menus_remove: FORCE -@(cd $(W)/Web/Tools/MenuGenerator/; \ SHORTNAME=`echo "$(URI)" | sed -r "s;http://www.w3.org/TR/[0-9]{4}/[A-Z]{2,4}-(.+)-[0-9]{8}/?$$;\1;"`; \ ./generateMenus.sh "$(USER)" '$(PASSWORD)' remove /standards/history/$$SHORTNAME.html; \ ./generateMenus.sh "$(USER)" '$(PASSWORD)' remove /TR/$$SHORTNAME; \ ./generateMenus.sh "$(USER)" '$(PASSWORD)' remove /TR/$$SHORTNAME/; \ ./generateMenus.sh "$(USER)" '$(PASSWORD)' bake) -@echo "Update menu tool superseded specs" ############# Update techs.rdf for new specs ############# specgroups_add: FORCE ifdef GROUPS # -@echo "If a FPWD, add $(URI) to techs.rdf" # -@echo "Run test here and exit unless URI in techs.rdf" $(SAXON) techs.rdf techs_add.xsl groups="$(GROUPS)" uri="$(URI)" > techs.rdf.tmp -@(if test "`echo "$(GROUPS)" | sed 's/,/\n/' | sort`" != "`$(SAXON) techs.rdf.tmp techs_count.xsl uri="$(URI)" 2> /dev/null | sort`"; \ then \ echo "$(URI) could not be added to some groups. Please check and fix techs.rdf.tmp and move it to techs.rdf"; \ exit 1; \ else \ mv techs.rdf.tmp techs.rdf; \ fi); endif specgroups_remove: FORCE # -@echo "If superseded, remove from techs.rdf" # -@echo "Run test here and exit unless URI not in techs.rdf" $(SAXON) techs.rdf techs_remove.xsl uri=$(URI) 2> /dev/null > techs.rdf.tmp -@if [ "a$($(SAXON) techs.rdf.tmp techs_count.xsl uri="$(URI)" 2> /dev/null)" != "a" ]; \ then \ echo "$(URI) could not be removed from some groups. Please check and fix techs.rdf.tmp and move it to techs.rdf"; \ exit 1; \ fi mv techs.rdf.tmp techs.rdf ############## History update after supersede ############## update_history: FORCE # -@echo "Redirect old history page to new history page when supersede" SHORTNAME=`echo "$(URI)" | sed -r 's;.*[A-Z]+-(.*)-[0-9]{8}/?$$;\1;'` -@(cd $(W)/..; \ $(CVS) checkout WWW/standards/history/{$(OLD_SHORTNAME).html,.htaccess}; \ cd WWW/standards/history; \ rm $(OLD_SHORTNAME).html; \ cvs remove $(OLD_SHORTNAME).html; \ echo -e "RewriteRule ^$(OLD_SHORTNAME)(\.html)?$$ http://www.w3.org/standards/history/$$SHORTNAME$$1 [L]" >> .htaccess; \ cvs commit -m "$(OLD_SHORTNAME) superseded by $(NEW_SHORTNAME)" .htaccess $(OLD_SHORTNAME).html) ############# Publish ############# publish: check-validity commit ifndef URI ifneq ($(shell cat $(UPDATE_FILE)),) override URI=$(shell cat $(UPDATE_FILE)) endif endif ifdef URI ifndef USER override USER=bertails endif (cd $(W); \ cvs ci -m"$(URI)" standards/Overview.html $(addprefix TR/,$(TRVIEWS)) $(addprefix TR/,$(GZIPOBJECTS)); \ cvs add standards/techs/*.html standards/history/*.html; \ cvs ci -m"$(URI)" standards/techs standards/history) ifdef OLD_SHORTNAME ssh -l $(USER) -A jay.w3.org /www.w3.org/2002/01/tr-automation/updateShortlink -o $(OLD_SHORTNAME) $(URI) else ssh -l $(USER) -A jay.w3.org /www.w3.org/2002/01/tr-automation/updateShortlink $(URI) ssh -l root -A birchibald.w3.org /root/WWW/Systems/SPARQL/load-graphs.sh endif else (cd $(W); \ cvs ci -m"new publications" standards/Overview.html $(addprefix TR/,$(TRVIEWS)) $(addprefix TR/,$(GZIPOBJECTS)); \ cvs add standards/techs/*.html standards/history/*.html; \ cvs ci -m"new publications" standards/techs standards/history) endif rm -f $(UPDATE_FILE) commit: check-include ifdef URI $(CVS) commit -m "$(URI)" else $(CVS) commit endif #### Compress %.html.gz: %.html -@echo "Compressing $@" $(GZIP) --stdout $^ > $@ #### Clean clean: FORCE rm -f tr.rdf $(TRVIEWS) $(GZIPOBJECTS) $(UPDATE_FILE) FORCE: