]> git.donarmstrong.com Git - lilypond.git/commitdiff
Web build: separate makefile for security + ease.
authorGraham Percival <graham@percival-music.ca>
Sat, 26 Dec 2009 01:12:34 +0000 (01:12 +0000)
committerGraham Percival <graham@percival-music.ca>
Sat, 26 Dec 2009 01:12:34 +0000 (01:12 +0000)
We can't rely on the normal makefile stuff, since that 1) involves
a lot of extra building on lilypond.org, and 2) it's a security
risk.  So anything that needs to be done for the automatic hourly
builds should be separated as much as possible, since I need to
manually look through any files used to check for security flaws.
I also need to do this whenever those files are updated.

Documentation/GNUmakefile
GNUmakefile.in
website.make [new file with mode: 0644]

index 133f09854a03b0c6d62fa0684a8fb521e9a808c0..24bd9663cb7d75b4dad47f76356e5d6307e099e9 100644 (file)
@@ -97,16 +97,6 @@ OUT_TXT_FILES = $(addprefix $(outdir)/, $(addsuffix .txt, $(README_TOP_FILES)))
 ### Web site idiosyncrases
 $(XREF_MAPS_DIR)/web.xref-map: XREF_MAP_FLAGS += --split=node
 
-ifeq ($(out),www)
-website: $(outdir)/web.texi $(XREF_MAPS_DIR)/web.xref-map $(outdir)/version.itexi $(outdir)/pictures/
-       mkdir -p $(outdir)/website/
-       $(TEXI2HTML) $(TEXI2HTML_SPLIT) $(TEXI2HTML_FLAGS) -D web_version \
-               --output=$(outdir)/website/ $(outdir)/web.texi
-       cp $(top-src-dir)/Documentation/css/*.css $(outdir)/website/
-       cd $(outdir)/website && ln -sf ../../pictures/$(outdir) pictures
-       cd $(outdir)/website && ln -sf ../../web/examples/$(outdir) examples
-endif
-
 
 ### bad hack for badly-integrated roadmap.
 $(outdir)/ROADMAP:
index 8e590cdb4e7b63710bcdfd2da575b2f7bb5188af..74c269d4e28397fcf90d4e9b8c37743f759a1493 100644 (file)
@@ -240,11 +240,6 @@ grand-replace:
        PATH=$(buildscript-dir):$(PATH) $(buildscript-dir)/grand-replace
 
 
-################################################################
-# website (without the rest of the docs)
-website:
-       $(MAKE) out=www -C Documentation website
-
 ################################################################
 # testing
 
@@ -293,3 +288,7 @@ snippets-clean:
 
 test-snippets-clean:
        rm -rf out/lybook-testdb
+
+# we want this separate for security; see CG 4.2.  -gp
+include $(top-src-dir)/website.make
+
diff --git a/website.make b/website.make
new file mode 100644 (file)
index 0000000..5d678b9
--- /dev/null
@@ -0,0 +1,53 @@
+################################################################
+# website (without the rest of the docs)
+
+#top-src-dir=$(HOME)/src/lilypond/
+EXTRACT_TEXI_FILENAMES=scripts/build/out/extract_texi_filenames
+CREATE_VERSION=$(top-src-dir)/scripts/build/create-version-itexi.py
+out=out-website
+EXAMPLES=$(HOME)/media/examples/
+PICTURES=$(HOME)/media/pictures
+
+
+# don't include web
+MANUALS=$(wildcard $(top-src-dir)/Documentation/*.tely)
+MANUALS+=$(top-src-dir)/Documentation/contributor.texi
+
+
+website-version:
+       mkdir -p $(out)
+       python $(CREATE_VERSION) > $(out)/version.itexi
+
+website-xrefs: website-version
+       $(EXTRACT_TEXI_FILENAMES) -I $(top-src-dir)/Documentation/ \
+               -I $(out) -o $(out) --split=node \
+               $(top-src-dir)/Documentation/web.texi
+       $(foreach manual, $(MANUALS), \
+               $(EXTRACT_TEXI_FILENAMES) -I $(top-src-dir)/Documentation/ \
+               -I $(out) -o $(out) $(manual) && ) :
+
+website-texinfo: website-version website-xrefs
+       SRC_DIR=$(top-src-dir)/Documentation/ \
+               PERL_UNICODE=SD texi2html --prefix=index \
+               --split=section \
+               --I=$(top-src-dir)/Documentation/ \
+               --I=$(out) \
+               --init-file=/home/gperciva/src/lilypond/Documentation/lilypond-texi2html.init \
+               -D web_version \
+               --output=$(out)/website/ \
+               $(top-src-dir)/Documentation/web.texi
+
+website-css:
+       cp $(top-src-dir)/Documentation/css/*.css $(out)/website/
+
+website-pictures:
+       cp -r $(PICTURES) $(out)/website/
+       ln -sf website/pictures $(out)/pictures
+
+website-examples:
+       cp -r $(EXAMPLES) $(out)/website/
+
+
+website: website-texinfo website-css website-pictures website-examples
+
+