website: Makefile.am: wrap Guix commands instead of targets.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Acked-by: Adrien Bourmault <neox@gnu.org>
This commit is contained in:
parent
e50f311c45
commit
b9eb8071f8
|
@ -28,8 +28,8 @@ index.html: index.html.tmpl
|
||||||
sed -e "s#WEBSITE_PREFIX#$(WEBSITE_PREFIX)#g" "$^" > "$@"
|
sed -e "s#WEBSITE_PREFIX#$(WEBSITE_PREFIX)#g" "$^" > "$@"
|
||||||
|
|
||||||
if WANT_GUIX
|
if WANT_GUIX
|
||||||
history/git-history.jpg: history/git-history.dot
|
DOT_CMD = \
|
||||||
guix time-machine \
|
guix time-machine \
|
||||||
--commit=$(GUIX_REVISION) \
|
--commit=$(GUIX_REVISION) \
|
||||||
-- \
|
-- \
|
||||||
shell \
|
shell \
|
||||||
|
@ -37,12 +37,14 @@ history/git-history.jpg: history/git-history.dot
|
||||||
--container \
|
--container \
|
||||||
graphviz \
|
graphviz \
|
||||||
-- \
|
-- \
|
||||||
dot -T jpg history/git-history.dot > "$@"
|
dot
|
||||||
else
|
else
|
||||||
history/git-history.jpg: history/git-history.dot
|
DOT_CMD = dot
|
||||||
dot -T jpg history/git-history.dot > "$@"
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
history/git-history.jpg: history/git-history.dot
|
||||||
|
$(DOT_CMD) -T jpg history/git-history.dot > "$@"
|
||||||
|
|
||||||
# We need force the regeneration of the page because if only the git
|
# We need force the regeneration of the page because if only the git
|
||||||
# commit changes, there is no way to know about it. In addition the
|
# commit changes, there is no way to know about it. In addition the
|
||||||
# full website is regenerated each time the build target is run, so
|
# full website is regenerated each time the build target is run, so
|
||||||
|
@ -72,8 +74,8 @@ site.cfg: site.cfg.tmpl
|
||||||
sed -e "s#WEBSITE_PREFIX#$(WEBSITE_PREFIX)#g" "$^" > "$@"
|
sed -e "s#WEBSITE_PREFIX#$(WEBSITE_PREFIX)#g" "$^" > "$@"
|
||||||
|
|
||||||
if WANT_GUIX
|
if WANT_GUIX
|
||||||
build: site.cfg pages/footer.include
|
BUILD_SH_CMD = \
|
||||||
guix time-machine \
|
guix time-machine \
|
||||||
--commit=c15a1cd88f80a90437f4b0159f22dfc84b9e6851 \
|
--commit=c15a1cd88f80a90437f4b0159f22dfc84b9e6851 \
|
||||||
-- shell \
|
-- shell \
|
||||||
--container \
|
--container \
|
||||||
|
@ -89,42 +91,41 @@ build: site.cfg pages/footer.include
|
||||||
pandoc \
|
pandoc \
|
||||||
sed \
|
sed \
|
||||||
-- \
|
-- \
|
||||||
./build.sh $(BUILD_OPTIONS)
|
./build.sh
|
||||||
else
|
else
|
||||||
build: site.cfg pages/footer.include
|
BUILD_SH_CMD = ./build.sh
|
||||||
./build.sh $(BUILD_OPTIONS)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
build: site.cfg pages/footer.include
|
||||||
|
$(BUILD_SH_CMD) $(BUILD_OPTIONS)
|
||||||
|
|
||||||
if WANT_GUIX
|
if WANT_GUIX
|
||||||
check: build website.tar.gz index.html history/git-history.jpg
|
CHECK_SH_CMD = \
|
||||||
rm -rf site/
|
guix shell \
|
||||||
mkdir -p site/$(WEBSITE_PREFIX)
|
--container \
|
||||||
tar xf website.tar.gz -C site/$(WEBSITE_PREFIX)
|
--network \
|
||||||
|
--emulate-fhs \
|
||||||
guix shell \
|
bash \
|
||||||
--container \
|
coreutils \
|
||||||
--network \
|
findutils \
|
||||||
--emulate-fhs \
|
grep \
|
||||||
bash \
|
gzip \
|
||||||
coreutils \
|
sed \
|
||||||
findutils \
|
tar \
|
||||||
grep \
|
-- \
|
||||||
gzip \
|
./check.sh
|
||||||
sed \
|
|
||||||
tar \
|
|
||||||
-- \
|
|
||||||
./check.sh --website-prefix $(WEBSITE_PREFIX) \
|
|
||||||
--directory site && \
|
|
||||||
./check.sh --website-prefix $(WEBSITE_PREFIX) \
|
|
||||||
--tarball website.tar.gz
|
|
||||||
else
|
else
|
||||||
|
CHECK_SH_CMD = ./check.sh
|
||||||
|
endif
|
||||||
|
|
||||||
check: build website.tar.gz index.html history/git-history.jpg
|
check: build website.tar.gz index.html history/git-history.jpg
|
||||||
rm -rf site/
|
rm -rf site/
|
||||||
mkdir -p site/$(WEBSITE_PREFIX)
|
mkdir -p site/$(WEBSITE_PREFIX)
|
||||||
tar xf website.tar.gz -C site/$(WEBSITE_PREFIX)
|
tar xf website.tar.gz -C site/$(WEBSITE_PREFIX)
|
||||||
./check.sh --website-prefix $(WEBSITE_PREFIX) --directory site
|
$(CHECK_SH_CMD) --website-prefix $(WEBSITE_PREFIX) \
|
||||||
./check.sh --website-prefix $(WEBSITE_PREFIX) --tarball website.tar.gz
|
--directory site
|
||||||
endif
|
$(CHECK_SH_CMD) --website-prefix $(WEBSITE_PREFIX) \
|
||||||
|
--tarball website.tar.gz
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@printf "%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n" \
|
@printf "%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n" \
|
||||||
|
@ -137,32 +138,33 @@ help:
|
||||||
"website.tar.gz # Create a tarball of the website"
|
"website.tar.gz # Create a tarball of the website"
|
||||||
|
|
||||||
if WANT_GUIX
|
if WANT_GUIX
|
||||||
serve: website.tar.gz
|
SERVE_SH_CMD = \
|
||||||
guix shell \
|
guix shell \
|
||||||
--container \
|
--container \
|
||||||
--network \
|
--network \
|
||||||
--emulate-fhs \
|
--emulate-fhs \
|
||||||
bash \
|
bash \
|
||||||
coreutils \
|
coreutils \
|
||||||
gzip \
|
gzip \
|
||||||
lighttpd \
|
lighttpd \
|
||||||
sed \
|
sed \
|
||||||
tar \
|
tar \
|
||||||
-- \
|
-- \
|
||||||
./serve.sh --website-prefix $(WEBSITE_PREFIX) \
|
./serve.sh
|
||||||
website.tar.gz $(LIGHTTPD_PORT)
|
|
||||||
else
|
|
||||||
if WANT_LIGHTTPD
|
|
||||||
serve: website.tar.gz
|
|
||||||
./serve.sh --website-prefix $(WEBSITE_PREFIX) \
|
|
||||||
website.tar.gz $(LIGHTTPD_PORT)
|
|
||||||
else
|
else
|
||||||
|
SERVE_SH_CMD = ./serve.sh
|
||||||
|
endif
|
||||||
|
|
||||||
|
if ! WANT_LIGHTTPD
|
||||||
serve:
|
serve:
|
||||||
@printf "%s %s\n" \
|
@printf "%s %s\n" \
|
||||||
"The $@ target is disabled." \
|
"The $@ target is disabled." \
|
||||||
"To enable it, run './configure --enable-lighttpd'."
|
"To enable it, run './configure --enable-lighttpd'."
|
||||||
@false
|
@false
|
||||||
endif
|
else
|
||||||
|
serve: website.tar.gz
|
||||||
|
$(SERVE_SH_CMD) --website-prefix $(WEBSITE_PREFIX) \
|
||||||
|
website.tar.gz $(LIGHTTPD_PORT)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
RSYNC_OPTIONS := -av --progress --delete
|
RSYNC_OPTIONS := -av --progress --delete
|
||||||
|
|
Loading…
Reference in New Issue