From cc2c9af6dbd0ed5fa72170b300783f3e62c84e8b Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Sat, 26 Dec 2009 01:12:34 +0000 Subject: [PATCH] Web build: separate makefile for security + ease. 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 | 10 -------- GNUmakefile.in | 9 +++---- website.make | 53 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 website.make diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile index 133f09854a..24bd9663cb 100644 --- a/Documentation/GNUmakefile +++ b/Documentation/GNUmakefile @@ -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: diff --git a/GNUmakefile.in b/GNUmakefile.in index 8e590cdb4e..74c269d4e2 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -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 index 0000000000..5d678b95bb --- /dev/null +++ b/website.make @@ -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 + + -- 2.39.2