meso-web

Sources of the |Méso|Star> website
git clone git://git.meso-star.fr/meso-web.git
Log | Files | Refs | README | LICENSE

commit c82c23f61b8267ab6dc56532b8d5dc937a724e4f
parent 9cefb8896c8ce34f668c679a246a7f1654e2fa87
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 23 Feb 2022 19:00:09 +0100

Merge branch 'feature_posix_build'

Diffstat:
M.gitignore | 41++++-------------------------------------
MMakefile | 63+++++++++++++++++++++++++++++++++++++++++++++++----------------
Aart/.gitignore | 7+++++++
Mart/Makefile | 146+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------
Dart/art.sh | 131-------------------------------------------------------------------------------
Aart/art_build.sh | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mbuild_htaccess.sh | 87++++++++++++++++++++++++++++++++++++++-----------------------------------------
Acheck_html.sh | 27+++++++++++++++++++++++++++
Aconfig.mk | 17+++++++++++++++++
Aconfigure.sh | 43+++++++++++++++++++++++++++++++++++++++++++
Aconfigure_targets.sh | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aconvert_man.sh | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ahtrdr/.gitignore | 6++++++
Mhtrdr/Makefile | 234++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------
Mhtrdr/htrdr.html.in | 2+-
Dhtrdr/htrdr.sh | 386-------------------------------------------------------------------------------
Ahtrdr/htrdr_build.sh | 255+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mmeso-menu.sh | 673+++++++++++++++++++++++++++++++++++++++----------------------------------------
Amisc/.gitignore | 5+++++
Mmisc/Makefile | 73+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
Mmisc/about-en.html.in | 3---
Mmisc/about-fr.html.in | 3---
Amisc/misc_build.sh | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Aschiff/.gitignore | 3+++
Mschiff/Makefile | 102+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
Mschiff/schiff.html.in | 5-----
Dschiff/schiff.sh | 134-------------------------------------------------------------------------------
Aschiff/schiff_build.sh | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Asolstice/.gitignore | 7+++++++
Msolstice/Makefile | 175++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------
Msolstice/downloads/Solstice-ABG.pdf | 4++--
Msolstice/solstice-abg.html.in | 6+++---
Msolstice/solstice-pp.html.in | 12++++++------
Msolstice/solstice.html.in | 14++++++--------
Dsolstice/solstice.sh | 200-------------------------------------------------------------------------------
Asolstice/solstice_build.sh | 99+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Astar-engine/.gitignore | 11+++++++++++
Mstar-engine/Makefile | 247+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------
Mstar-engine/downloads/Star-Engine-0.14.0-GNU-Linux64.tar.gz | 4++--
Mstar-engine/downloads/Star-Engine-0.14.0-Sources.zip | 4++--
Dstar-engine/star-engine.sh | 163-------------------------------------------------------------------------------
Mstar-engine/star-vx.html.in | 2+-
Astar-engine/star_engine_build.sh | 128+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Astardis/.gitignore | 10++++++++++
Mstardis/Makefile | 210+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------
Mstardis/stardis.html.in | 6+++---
Dstardis/stardis.sh | 251-------------------------------------------------------------------------------
Astardis/stardis_build.sh | 167+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
48 files changed, 2543 insertions(+), 1938 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,44 +1,11 @@ -art.html -consortium*.html -hr_ppart.html -karine.html -kdistribution.html -ppart_lw.html -ppart_sw.html -kspectrum.html -schiff.html -schiff-downloads.html -stardis.html -stardis-downloads.html -about-en.html -about-fr.html -legal-en.html -legal-fr.html -htrdr.html -htrdr-docs.html -starter-pack.html -htrdr-atmosphere-spk.html -htrdr-combustion-spk.html -pgp_signatures.html -solstice.html -solstice-downloads.html -solstice-resources.html -solstice-release-notes.html.in -solstice-pp-release-notes.html.in -star-engine.html -star-engine-downloads.html -star-engine-release-notes.html.in -star-2d.html -star-3d.html -star-geom.html -star-sf.html -star-sp.html -star-uvm.html -star-vx.html .htaccess *.sw[po] *.[ao] *.sig +*.err *~ +.chk +.man +.sig tags man diff --git a/Makefile b/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2021 |Meso|Star> (contact@meso-star.com) +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,24 +12,55 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +.POSIX: -REMOTE=OVH:www/projects -REMOTE_DIR=/$(shell basename ${REMOTE}) -SUBDIRS=art schiff solstice star-engine stardis misc htrdr +include config.mk -.PHONY: default all publish -default: all +SUBDIRS=art htrdr misc schiff solstice star-engine stardis -all: - @for subdir in ${SUBDIRS}; do make -C $$subdir; echo ""; done +SCRIPTS=\ + build_htaccess.sh\ + check_html.sh\ + configure.sh\ + configure_targets.sh\ + convert_man.sh\ + meso-menu.sh + +build: + @for subdir in $(SUBDIRS); do \ + printf "\e[1m>>> %s\e[0m\n" $$subdir; \ + $(MAKE) -C $${subdir}; echo ""; done + +distclean: + @echo "Removing .htaccess" + @rm -f .htaccess && echo "" + @for subdir in $(SUBDIRS); do \ + printf "\e[1m>>> %s\e[0m\n" $$subdir; \ + $(MAKE) -C $${subdir} $@; echo ""; done -.htaccess: build_htaccess.sh - @bash build_htaccess.sh ${REMOTE_DIR} - clean: - @for subdir in ${SUBDIRS}; do make -C $$subdir clean; done - @rm .htaccess + @echo "Removing .htaccess" + @rm -f .htaccess && echo "" + @for subdir in $(SUBDIRS); do \ + printf "\e[1m>>> %s\e[0m\n" $$subdir; \ + $(MAKE) -C $${subdir} $@; echo ""; done -publish: .htaccess - @for subdir in ${SUBDIRS}; do REMOTE=${REMOTE} make -C $$subdir publish; done - rsync -avz solstice.html .htaccess fonts meso.css ${REMOTE} +check: + @for i in $(SCRIPTS); do \ + printf "Checking %s\n" "$${i}"; \ + shellcheck -o all -x "$${i}"; done + @echo "" + @for subdir in $(SUBDIRS); do \ + printf "\e[1m>>> %s\e[0m\n" $$subdir; \ + $(MAKE) -C $${subdir} $@; echo ""; done + +install: .htaccess + @for subdir in $(SUBDIRS); do \ + printf "\e[1m>>> %s\e[0m\n" $$subdir; \ + $(MAKE) -C $$subdir $@; echo ""; done + @rsync -avzrR --delete-after --progress\ + solstice.html .htaccess fonts meso.css ${PREFIX} + +.htaccess: build_htaccess.sh + @echo "Building $@" + @sh build_htaccess.sh /$$(basename "$(PREFIX)") > $@ diff --git a/art/.gitignore b/art/.gitignore @@ -0,0 +1,7 @@ +art.html +hr_ppart.html +karine.html +kdistribution.html +ppart_lw.html +ppart_sw.html +kspectrum.html diff --git a/art/Makefile b/art/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2021 |Meso|Star> (contact@meso-star.com) +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,41 +12,113 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +.POSIX: -KSPECTRUM-VERSION=1.3 -KDISTRIBUTION-VERSION=1.1.1 -KARINE-VERSION=3.5 - -SRC = \ - art.html.in \ - kspectrum.html.in \ - kdistribution.html.in \ - hr_ppart.html.in \ - ppart_lw.html.in \ - ppart_sw.html.in \ - karine.html.in -HTML-FILES=$(patsubst %.html.in,%.html,${SRC}) - -IMG = \ - k001.svg \ - tau_cumulated_1180-1200.svg \ - emission_altitude_500-505.svg \ - Te_signal_500-505.svg \ - Tb.svg \ - si_flux.svg \ - pne_mls_cs.svg \ - pne_mls_ac.svg \ - venus_ner.svg - -.PHONY: all clean default publish -default: all - -all: ${SRC} ${IMG} - @bash art.sh ${KSPECTRUM-VERSION} ${KDISTRIBUTION-VERSION} ${KARINE-VERSION} - -clean: - rm ${HTML-FILES} downloads/*.sig - -publish: - rsync -arvz ${HTML-FILES} ${IMG} downloads ${REMOTE}/art/ +include ../config.mk +KSPECTRUM_VERSION=1.3 +KDISTRIBUTION_VERSION=1.1.1 +KARINE_VERSION=3.5 + +ART_PKG=\ + downloads/kspectrum$(KSPECTRUM_VERSION).tgz\ + downloads/kdistribution_light$(KDISTRIBUTION_VERSION).tgz\ + downloads/hr_ppart.tgz\ + downloads/ppart_lw.tgz\ + downloads/ppart_sw.tgz\ + downloads/karine$(KARINE_VERSION).tgz +ART_SIG=$(ART_PKG:=.sig) + +ART_FILES=\ + downloads/install_kspectrum$(KSPECTRUM_VERSION).bash\ + downloads/kspectrum$(KSPECTRUM_VERSION)_manual.pdf\ + downloads/install_kdistribution_light$(KDISTRIBUTION_VERSION).bash\ + downloads/kdistribution_light$(KDISTRIBUTION_VERSION)_manual.pdf\ + downloads/karine$(KARINE_VERSION)_manual.pdf + +KSPECTRUM_IMG=k001.svg tau_cumulated_1180-1200.svg +HR_PPART_IMG=emission_altitude_500-505.svg Te_signal_500-505.svg +KARINE_IMG=pne_mls_cs.svg pne_mls_ac.svg venus_ner.svg +IMG=$(KSPECTRUM_IMG) $(HR_PPART_IMG) $(KARINE_IMG) Tb.svg si_flux.svg + +HTML=\ + art.html\ + kspectrum.html\ + kdistribution.html\ + hr_ppart.html\ + ppart_lw.html\ + ppart_sw.html\ + karine.html + +build: .sig + @$(MAKE) -fMakefile -f .sig build_all + +build_all: $(ART_SIG) $(HTML) + +clean: + @echo "Cleaning generated files" + @rm -f $(HTML) $(HTML:=.err) .sig .chk + +distclean: clean + @echo "Cleaning PGP signatures" + @rm -f $(ART_SIG) + +install: build + @rsync -avzrR --delete-after --progress \ + $(HTML) $(IMG) $(ART_FILES) $(ART_PKG) $(ART_SIG) $(PREFIX)/art/ + +art_build.sh: ../meso-menu.sh + @touch art_build.sh + +################################################################################ +# html +################################################################################ +art.html: art.html.in art_build.sh + @echo "Building $@" + @sh art_build.sh overview > $@ + +kspectrum.html: kspectrum.html.in art_build.sh Makefile $(KSPECTRUM_IMG) + @echo "Building $@" + @sh art_build.sh kspectrum $(KSPECTRUM_VERSION) > $@ + +kdistribution.html: kdistribution.html.in art_build.sh Makefile + @echo "Building $@" + @sh art_build.sh kdistribution $(KDISTRIBUTION_VERSION) > $@ + +hr_ppart.html: hr_ppart.html.in art_build.sh $(HR_PPART_IMG) + @echo "Building $@" + @sh art_build.sh hr_ppart > $@ + +ppart_lw.html: ppart_lw.html.in Tb.svg art_build.sh + @echo "Building $@" + @sh art_build.sh ppart_lw > $@ + +ppart_sw.html: ppart_sw.html.in si_flux.svg art_build.sh + @echo "Building $@" + @sh art_build.sh ppart_sw > $@ + +karine.html: karine.html.in art_build.sh Makefile $(KARINE_IMG) + @echo "Building $@" + @sh art_build.sh karine $(KARINE_VERSION) > $@ + +################################################################################ +# Check files +################################################################################ +check: build .chk + @$(MAKE) -fMakefile -f .chk check_all + +check_all: check_shells $(HTML:=.chk) + +check_shells: + @echo "Checking art_build.sh" && shellcheck -o all -x art_build.sh + +################################################################################ +# Miscellaneous targets +################################################################################ +.sig: Makefile ../configure_targets.sh + @echo "Setup .sig" + @sh ../configure_targets.sh sig $(ART_PKG) > .sig + +.chk: Makefile ../configure_targets.sh + @echo "Setup .chk" + @sh ../configure_targets.sh chk $(HTML) > .chk diff --git a/art/art.sh b/art/art.sh @@ -1,131 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -set -e - -source ../meso-menu.sh - -if [ $# -lt 3 ]; then - echo "Usage: $0 KSPECTRUM-VERSION KDISTRIBUTION-VERSION KARINE-VERSION" - exit 1 -fi - -required_files=( - "./downloads/kspectrum$1.tgz" - "./downloads/install_kspectrum$1.bash" - "./downloads/kspectrum$1_manual.pdf" - "./downloads/kdistribution_light$2.tgz" - "./downloads/install_kdistribution_light$2.bash" - "./downloads/kdistribution_light$2_manual.pdf" - "./downloads/hr_ppart.tgz" - "./downloads/ppart_lw.tgz" - "./downloads/ppart_sw.tgz" - "./downloads/karine$3.tgz" - "./downloads/karine$3_manual.pdf" -) - -# Check files -for((i=0; i < ${#required_files[@]}; ++i)); do - if [ ! -f "${required_files[$i]}" ]; then - echo "$0:$LINENO: Cannot find ${required_files[$i]}" - exit 1 - fi -done - -################################################################################ -# Sign the tarballs -################################################################################ -tput bold; echo ">>> A.R.T. tarballs"; tput sgr0 - -archs=( - "./downloads/kspectrum$1.tgz" - "./downloads/kdistribution_light$2.tgz" - "./downloads/hr_ppart.tgz" - "./downloads/ppart_lw.tgz" - "./downloads/ppart_sw.tgz" - "./downloads/karine$3.tgz" -) - -sign_something=0 -for((i=0; i < ${#archs[@]}; ++i)); do - if [ ! -f "${archs[$i]}.sig" ]; then - echo "Sign ${archs[$i]}" - gpg -a -o ${archs[$i]}.sig --detach-sign ${archs[$i]} - sign_something=1 - fi -done - -if [ $sign_something == 0 ]; then - echo "Nothing to do" -fi - -echo "" - -################################################################################ -# Generate the Kspectrum page -################################################################################ -tput bold; echo ">>> A.R.T. web pages"; tput sgr0 - -echo "Write art.html" -{ - print_header ART Overview - cat art.html.in - print_footer -} > art.html - -echo "Write kspectrum.html" -{ - print_header ART Kspectrum - VERSION=$1 envsubst < kspectrum.html.in - print_footer -} > kspectrum.html - -echo "Write kdistribution.html" -{ - print_header ART Kdistribution - VERSION=$2 envsubst < kdistribution.html.in - print_footer -} > kdistribution.html - -echo "Write hr_ppart.html" -{ - print_header ART HR_PPart - cat hr_ppart.html.in - print_footer -} > hr_ppart.html - -echo "Write ppart_lw.html" -{ - print_header ART PPart_LW - cat ppart_lw.html.in - print_footer -} > ppart_lw.html - -echo "Write ppart_sw.html" -{ - print_header ART PPart_SW - cat ppart_sw.html.in - print_footer -} > ppart_sw.html - -echo "Write karine.html" -{ - print_header ART Karine - VERSION=$3 envsubst < karine.html.in - print_footer -} > karine.html - diff --git a/art/art_build.sh b/art/art_build.sh @@ -0,0 +1,84 @@ +#!/bin/sh -e + +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. ../meso-menu.sh + +overview() +{ + print_header ART Overview + cat art.html.in + print_footer +} + +kspectrum() +{ + if [ $# -lt 1 ]; then + printf "Usage: %s kspectrum <version>\n" "$0" >&2 + exit 1 + fi + + print_header ART Kspectrum + VERSION="$1" envsubst < kspectrum.html.in + print_footer +} + +kdistribution() +{ + if [ $# -lt 1 ]; then + printf "Usage: %s kdistribution <version>\n" "$0" >&2 + exit 1 + fi + + print_header ART Kdistribution + VERSION="$1" envsubst < kdistribution.html.in + print_footer +} + +hr_ppart() +{ + print_header ART HR_PPart + cat hr_ppart.html.in + print_footer +} + +ppart_lw() +{ + print_header ART PPart_LW + cat ppart_lw.html.in + print_footer +} + +ppart_sw() +{ + print_header ART PPart_SW + cat ppart_sw.html.in + print_footer +} + +karine() +{ + if [ $# -lt 1 ]; then + printf "Usage: %s karine <version>\n" "$0" >&2 + exit 1 + fi + + print_header ART Karine + VERSION="$1" envsubst < karine.html.in + print_footer +} + +"$@" diff --git a/build_htaccess.sh b/build_htaccess.sh @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -e -# Copyright (C) 2019-2021 |Meso|Star> (contact@meso-star.com) +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,53 +16,50 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. if [ $# -lt 1 ]; then - echo "Usage: $0 REMOTE_DIR" + printf "Usage: %s <remote-dir>\n" "$0" >&2 exit 1 fi -redirections=( - "index.html misc/about-fr.html" - "high-tune/high-tune.html htrdr/htrdr.html" - "high-tune/starter-pack.html htrdr/htrdr-atmosphere-spk.html" - "high-tune/downloads/gas_opt_prop_en.pdf htrdr/downloads/gas_opt_prop_en.pdf" - "high-tune/downloads/High-Tune-Starter-Pack-0.1.1.tar.gz htrdr/downloads/High-Tune-Starter-Pack-0.1.1.tar.gz" - "high-tune/downloads/High-Tune-Starter-Pack-0.1.1.tar.gz.sig htrdr/downloads/High-Tune-Starter-Pack-0.1.1.tar.gz.sig" - "high-tune/downloads/High-Tune-Starter-Pack-0.2.0.tar.gz htrdr/downloads/High-Tune-Starter-Pack-0.2.0.tar.gz" - "high-tune/downloads/High-Tune-Starter-Pack-0.2.0.tar.gz.sig htrdr/downloads/High-Tune-Starter-Pack-0.2.0.tar.gz.sig" - "high-tune/downloads/High-Tune-Starter-Pack-0.3.0.tar.gz htrdr/downloads/High-Tune-Starter-Pack-0.3.0.tar.gz" - "high-tune/downloads/High-Tune-Starter-Pack-0.3.0.tar.gz.sig htrdr/downloads/High-Tune-Starter-Pack-0.3.0.tar.gz.sig" - "high-tune/downloads/High-Tune-Starter-Pack-0.4.0.tar.gz htrdr/downloads/High-Tune-Starter-Pack-0.4.0.tar.gz" - "high-tune/downloads/High-Tune-Starter-Pack-0.4.0.tar.gz.sig htrdr/downloads/High-Tune-Starter-Pack-0.4.0.tar.gz.sig" - "high-tune/downloads/High-Tune-Starter-Pack-0.5.0.tar.gz htrdr/downloads/High-Tune-Starter-Pack-0.5.0.tar.gz" - "high-tune/downloads/High-Tune-Starter-Pack-0.5.0.tar.gz.sig htrdr/downloads/High-Tune-Starter-Pack-0.5.0.tar.gz.sig" - "high-tune/downloads/High-Tune-Starter-Pack-0.6.0.tar.gz htrdr/downloads/High-Tune-Starter-Pack-0.6.0.tar.gz" - "high-tune/downloads/High-Tune-Starter-Pack-0.6.0.tar.gz.sig htrdr/downloads/High-Tune-Starter-Pack-0.6.0.tar.gz.sig" - "high-tune/downloads/HRES_ARMCu.mp4 htrdr/downloads/HRES_ARMCu.mp4" - "high-tune/man/man1/htpp.1.html htrdr/man/man1/htpp.1.html" - "high-tune/man/man1/htrdr.1.html htrdr/man/man1/htrdr.1.html" - "high-tune/man/man1/htrdr-atmosphere.1.html htrdr/man/man1/htrdr-atmosphere.1.html" - "high-tune/man/man1/htrdr-combustion.1.html htrdr/man/man1/htrdr-combustion.1.html" - "high-tune/man/man1/les2htcp.1.html htrdr/man/man1/les2htcp.1.html" - "high-tune/man/man5/atrri.5.html htrdr/man/man5/atrri.5.html" - "high-tune/man/man5/atrtp.5.html htrdr/man/man5/atrtp.5.html" - "high-tune/man/man5/htcp.5.html htrdr/man/man5/htcp.5.html" - "high-tune/man/man5/htmie.5.html htrdr/man/man5/htmie.5.html" - "high-tune/man/man5/htrdr-image.5.html htrdr/man/man5/htrdr-image.5.html" - "high-tune/man/man5/htrdr-materials.5.html htrdr/man/man5/htrdr-materials.5.html" - "high-tune/man/man5/htrdr-obj.5.html htrdr/man/man5/htrdr-obj.5.html" - "high-tune/man/man5/mrumtl.5.html htrdr/man/man5/mrumtl.5.html" - "high-tune/man/man5/sth.5.html htrdr/man/man5/sth.5.html" -) +redirections="\ + index.html misc/about-fr.html + high-tune/high-tune.html htrdr/htrdr.html + high-tune/starter-pack.html htrdr/htrdr-atmosphere-spk.html + high-tune/downloads/gas_opt_prop_en.pdf htrdr/downloads/gas_opt_prop_en.pdf + high-tune/downloads/High-Tune-Starter-Pack-0.1.1.tar.gz htrdr/downloads/High-Tune-Starter-Pack-0.1.1.tar.gz + high-tune/downloads/High-Tune-Starter-Pack-0.1.1.tar.gz.sig htrdr/downloads/High-Tune-Starter-Pack-0.1.1.tar.gz.sig + high-tune/downloads/High-Tune-Starter-Pack-0.2.0.tar.gz htrdr/downloads/High-Tune-Starter-Pack-0.2.0.tar.gz + high-tune/downloads/High-Tune-Starter-Pack-0.2.0.tar.gz.sig htrdr/downloads/High-Tune-Starter-Pack-0.2.0.tar.gz.sig + high-tune/downloads/High-Tune-Starter-Pack-0.3.0.tar.gz htrdr/downloads/High-Tune-Starter-Pack-0.3.0.tar.gz + high-tune/downloads/High-Tune-Starter-Pack-0.3.0.tar.gz.sig htrdr/downloads/High-Tune-Starter-Pack-0.3.0.tar.gz.sig + high-tune/downloads/High-Tune-Starter-Pack-0.4.0.tar.gz htrdr/downloads/High-Tune-Starter-Pack-0.4.0.tar.gz + high-tune/downloads/High-Tune-Starter-Pack-0.4.0.tar.gz.sig htrdr/downloads/High-Tune-Starter-Pack-0.4.0.tar.gz.sig + high-tune/downloads/High-Tune-Starter-Pack-0.5.0.tar.gz htrdr/downloads/High-Tune-Starter-Pack-0.5.0.tar.gz + high-tune/downloads/High-Tune-Starter-Pack-0.5.0.tar.gz.sig htrdr/downloads/High-Tune-Starter-Pack-0.5.0.tar.gz.sig + high-tune/downloads/High-Tune-Starter-Pack-0.6.0.tar.gz htrdr/downloads/High-Tune-Starter-Pack-0.6.0.tar.gz + high-tune/downloads/High-Tune-Starter-Pack-0.6.0.tar.gz.sig htrdr/downloads/High-Tune-Starter-Pack-0.6.0.tar.gz.sig + high-tune/downloads/HRES_ARMCu.mp4 htrdr/downloads/HRES_ARMCu.mp4 + high-tune/man/man1/htpp.1.html htrdr/man/man1/htpp.1.html + high-tune/man/man1/htrdr.1.html htrdr/man/man1/htrdr.1.html + high-tune/man/man1/htrdr-atmosphere.1.html htrdr/man/man1/htrdr-atmosphere.1.html + high-tune/man/man1/htrdr-combustion.1.html htrdr/man/man1/htrdr-combustion.1.html + high-tune/man/man1/les2htcp.1.html htrdr/man/man1/les2htcp.1.html + high-tune/man/man5/atrri.5.html htrdr/man/man5/atrri.5.html + high-tune/man/man5/atrtp.5.html htrdr/man/man5/atrtp.5.html + high-tune/man/man5/htcp.5.html htrdr/man/man5/htcp.5.html + high-tune/man/man5/htmie.5.html htrdr/man/man5/htmie.5.html + high-tune/man/man5/htrdr-image.5.html htrdr/man/man5/htrdr-image.5.html + high-tune/man/man5/htrdr-materials.5.html htrdr/man/man5/htrdr-materials.5.html + high-tune/man/man5/htrdr-obj.5.html htrdr/man/man5/htrdr-obj.5.html + high-tune/man/man5/mrumtl.5.html htrdr/man/man5/mrumtl.5.html + high-tune/man/man5/sth.5.html htrdr/man/man5/sth.5.html" -REMOTE_DIR=$1 +remote_dir=$1 -echo "Options -Indexes" > .htaccess +echo "Options -Indexes" -tput bold; echo ">>> build the .htaccess file"; tput sgr0 -for((i=0; i<${#redirections[@]}; ++i)); do - entry=(${redirections[$i]}) - from=${entry[0]} - to=${entry[1]} - echo "Redirect ${REMOTE_DIR}/${from} ${REMOTE_DIR}/${to}" >> .htaccess +printf "%s\n" "${redirections}" | \ +while read -r i; do + from=$(printf "%s" "${i}" | awk '{print $1}') + to=$(printf "%s" "${i}" | awk '{print $2}') + printf "Redirect %s/%s %s/%s\n" "${remote_dir}" "${from}" "${remote_dir}" "${to}" done -echo "" diff --git a/check_html.sh b/check_html.sh @@ -0,0 +1,27 @@ +#!/bin/sh -e + +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +if [ $# -lt 1 ]; then + echo "Usage: $0 <html>" >&2 + exit 1 +fi + +if ! tidy --show-info no -f "$1.err" -e "$1"; then + printf "%s:\e[1;31merror\e[0m: report in %s.err\n" "$1" "$1" >&2 + cat "$1.err" >& 2 +fi diff --git a/config.mk b/config.mk @@ -0,0 +1,17 @@ +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Destination where to synchronise data +PREFIX=OVH:www/projects diff --git a/configure.sh b/configure.sh @@ -0,0 +1,43 @@ +#!/bin/sh -e + +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +# This script checks that the commands expected by the build process exist + +commands="\ + envsubst + gpg + man2html + rsync + shellcheck + tidy" + +printf "%s\n" "${commands}" | while read -r i; do + if ! command -v "${i}" > /dev/null; then + printf "\e[1;31mError\e[0m:%s: command not found\n" "${i}" + exit 1 + fi +done + +if ! command -v "markdown" > /dev/null \ +&& ! command -v "markdown2" > /dev/null \ +&& ! command -v "markdown_py" > /dev/null; then + printf "\e[1;31mError\e[0m: no valid 'markdown' command was found\n" + exit 1 +fi + +echo "configure done" diff --git a/configure_targets.sh b/configure_targets.sh @@ -0,0 +1,62 @@ +#!/bin/sh -e + +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +sig() +{ + for i in "$@"; do + printf "%s.sig: %s\n" "${i}" "${i}" + printf "\t@echo Signing %s\n" "${i}" + printf "\t@gpg --yes -a -o %s.sig --detach-sign %s\n" "${i}" "${i}" + done +} + +chk() +{ + dir=$(dirname "$0") + for i in "$@"; do + printf "%s.chk: %s %s/check_html.sh\n" "${i}" "${i}" "${dir}" + printf "\t@echo Checking %s\n" "${i}" + printf "\t@PATH+=:%s sh check_html.sh %s\n" "${dir}" "${i}" + done +} + +man() +{ + if [ $# -lt 2 ]; then + printf "Usage: %s <section> <version> [man...]" "$0" >&2 + exit 1 + fi + + section=$1 + version=$2 + dir=$(dirname "$0") + + shift 2 + for i in "$@"; do \ + man=${i#*share/}.html + printf "man: %s\n" "${man}" + printf "%s: %s %s/meso-menu.sh %s/convert_man.sh\n" \ + "${man}" "${i}" "${dir}" "${dir}" + printf "\t@echo \"Building %s\"\n" "${man}" + printf "\t@mkdir -p %s\n" "${man%/*}" + printf "\t@PATH+=:%s sh convert_man.sh %s %s %s %s\n" \ + "${dir}" "${section}" "${i}" "${man}" "${version}" + done +} + +"$@" + diff --git a/convert_man.sh b/convert_man.sh @@ -0,0 +1,68 @@ +#!/bin/sh -e + +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. meso-menu.sh + +if [ $# -lt 4 ]; then + echo "Usage: $0 <section> <input> <output> <version>" >&2 + exit 1 +fi + +section="$1" +input="$2" +output="$3" +version="$4" + +man_name=${input##*/} +man_name=${man_name%.*} +man_section=$(echo "${input}" \ + | sed 's/.*man\([[:digit:]]\{1\}[[:alpha:]]\{0,1\}\)\/.*/\1/g') + +{ + print_header "${section}" "man-${man_name}" + echo "<div style=\"font-variant: small-caps; float: right; color: #777777\">" + echo "${section} ${version}</div>"; + echo "<header>" + echo " <h1>${man_name}(${man_section})</h1>"; + echo "</header>" + man2html -r "${input}" \ + | tail -n +10 \ + | sed '/^<HR>$/,$d' \ + | sed '/\&nbsp;/d' \ + | sed 's/<DL COMPACT>/<DL>/g' + print_footer +} > "${output}" + +# Clean the html file generated by man2html and check it if necessary +tidy --show-info no -m "${output}" > /dev/null 2>&1 || sh check_html.sh "${output}" + +# Remove hyperlink on csplit, feh, gnuplot, sed, mmap and mpirun commands +sed -i 's/<B><A HREF="\.\.\/man1\/csplit\.1\.html">csplit<\/A><\/B>/csplit/g' "${output}" +sed -i 's/<B><A HREF="\.\.\/man1\/feh\.1\.html">feh<\/A><\/B>/feh/g' "${output}" +sed -i 's/<B><A HREF="\.\.\/man1\/gnuplot\.1\.html">gnuplot<\/A><\/B>/gnuplot/g' "${output}" +sed -i 's/<B><A HREF="\.\.\/man1\/sed\.1\.html">sed<\/A><\/B>/sed/g' "${output}" +sed -i 's/<B><A HREF="\.\.\/man1\/mpirun\.1\.html">mpirun<\/A><\/B>/mpirun/g' "${output}" +sed -i 's/<B><A HREF="\.\.\/man2\/mmap\.2\.html">mmap<\/A><\/B>/mmap/g' "${output}" + +# Fix the hyperlink toward the GPLv3+ license +sed -i 's/gpl\.html\.">\(.*\).<\/A>/gpl.html">\1<\/A>./g' "${output}" + +# Remove unexpected link on sqrt(2) +sed -i 's/<A HREF="\.\.\/man2\/sqrt\.2\.html">sqrt<\/A>/sqrt/g' "${output}" + +# Fix the man2html issues that translates the ' char in cq +sed -i "s/cq\([a-z]\)\>/'\1/g" "${output}" diff --git a/htrdr/.gitignore b/htrdr/.gitignore @@ -0,0 +1,6 @@ +htrdr.html +htrdr-docs.html +htrdr-atmosphere-spk.html +htrdr-combustion-spk.html +htrdr-*-GNU-Linux64/ +htrdr-*-Starter-Pack-*/ diff --git a/htrdr/Makefile b/htrdr/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2021 |Meso|Star> (contact@meso-star.com) +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,49 +12,197 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +.POSIX: -HTRDR-VERSION=0.8.1 -HTRDR-ATMOSPHERE-STARTER-PACK-VERSION=0.7.0 -HTRDR-COMBUSTION-STARTER-PACK-VERSION=0.0.0 - -SRC = htrdr.html.in htrdr-docs.html.in htrdr.sh -HTML = \ - htrdr.html \ - htrdr-atmosphere-spk.html \ - htrdr-combustion-spk.html \ - htrdr-docs.html -IMG = \ - city.jpg \ - city_thin_lens.jpg \ - CLEMENT.jpg \ - CLEMENT_lw_9000_10000.jpg \ - downward_flux_500x500x2048_lw_4000_100000_425.156.jpg \ - downward_flux_500x500x2048_sw_380_4000_879.349.jpg \ - dummy_medium.jpg \ - dummy_medium_clipped.jpg \ - DZVAR2.jpg \ - DZVAR.jpg \ - DZVAR_ortho.jpg \ - HRES_ARMCu.jpg \ - L12km_BOMEX.jpg \ - L25_Fire.jpg \ - valid_800x600x4096.gif \ - valid_800x600x4096_thumb.gif \ - valid_pview.gif \ - valid_pview_thumb.gif - -.PHONY: all clean default publish -default: all - -all: ${SRC} - @bash htrdr.sh \ - ${HTRDR-VERSION} \ - ${HTRDR-ATMOSPHERE-STARTER-PACK-VERSION} \ - ${HTRDR-COMBUSTION-STARTER-PACK-VERSION} - -publish: - rsync -avzr ${HTML} ${IMG} downloads man ${REMOTE}/htrdr/ +include ../config.mk + +HTRDR_VERSION=0.8.1 +HTRDR_DIR=htrdr-$(HTRDR_VERSION)-GNU-Linux64 +HTRDR_ARCH=downloads/$(HTRDR_DIR).tar.gz +HTRDR_README=$(HTRDR_DIR)/share/doc/htrdr/README.md + +ATMSPK_VERSION=0.7.0 +ATMSPK_DIR=htrdr-Atmosphere-Starter-Pack-$(ATMSPK_VERSION) +ATMSPK_ARCH=downloads/$(ATMSPK_DIR).tar.gz +ATMSPK_README=$(ATMSPK_DIR)/README.md +ATMSPK_PKG=\ + downloads/htrdr-Atmosphere-Starter-Pack-0.7.0.tar.gz\ + downloads/htrdr-Atmosphere-Starter-Pack-0.6.1.tar.gz\ + downloads/High-Tune-Starter-Pack-0.6.0.tar.gz\ + downloads/High-Tune-Starter-Pack-0.5.0.tar.gz\ + downloads/High-Tune-Starter-Pack-0.4.0.tar.gz\ + downloads/High-Tune-Starter-Pack-0.3.0.tar.gz\ + downloads/High-Tune-Starter-Pack-0.2.0.tar.gz\ + downloads/High-Tune-Starter-Pack-0.1.1.tar.gz +ATMSPK_SIG=$(ATMSPK_PKG:=.sig) + +COMSPK_VERSION=0.0.0 +COMSPK_DIR=htrdr-Combustion-Starter-Pack-$(COMSPK_VERSION) +COMSPK_ARCH=downloads/$(COMSPK_DIR).tar.gz +COMSPK_README=$(COMSPK_DIR)/README.md.in +COMSPK_PKG=\ + downloads/htrdr-Combustion-Starter-Pack-0.0.0.tar.gz +COMSPK_SIG=$(COMSPK_PKG:=.sig) + +MAN=\ + $(HTRDR_DIR)/share/man/man1/htpp.1\ + $(HTRDR_DIR)/share/man/man1/htrdr.1\ + $(HTRDR_DIR)/share/man/man1/htrdr-atmosphere.1\ + $(HTRDR_DIR)/share/man/man1/htrdr-combustion.1\ + $(HTRDR_DIR)/share/man/man1/les2htcp.1\ + $(HTRDR_DIR)/share/man/man5/atrri.5\ + $(HTRDR_DIR)/share/man/man5/atrtp.5\ + $(HTRDR_DIR)/share/man/man5/htmie.5\ + $(HTRDR_DIR)/share/man/man5/htcp.5\ + $(HTRDR_DIR)/share/man/man5/htrdr-image.5\ + $(HTRDR_DIR)/share/man/man5/htrdr-materials.5\ + $(HTRDR_DIR)/share/man/man5/htrdr-obj.5\ + $(HTRDR_DIR)/share/man/man5/mrumtl.5\ + $(HTRDR_DIR)/share/man/man5/sth.5 + +OVERVIEW_IMG=\ + CLEMENT.jpg\ + CLEMENT_lw_9000_10000.jpg\ + valid_800x600x4096.gif\ + valid_800x600x4096_thumb.gif\ + valid_pview.gif\ + valid_pview_thumb.gif\ + downward_flux_500x500x2048_sw_380_4000_879.349.jpg\ + downward_flux_500x500x2048_lw_4000_100000_425.156.jpg\ + downloads/HRES_ARMCu.mp4 + +ATMSPK_IMG=\ + DZVAR.jpg\ + DZVAR_ortho.jpg\ + DZVAR2.jpg\ + L12km_BOMEX.jpg\ + L25_Fire.jpg\ + city.jpg\ + city_thin_lens.jpg + +COMSPK_IMG=\ + dummy_medium.jpg\ + dummy_medium_clipped.jpg + +IMG=$(OVERVIEW_IMG) $(ATMSPK_IMG) $(COMSPK_IMG) +HTML=\ + htrdr.html\ + htrdr-atmosphere-spk.html\ + htrdr-combustion-spk.html\ + htrdr-docs.html + +build: .sig .man + @$(MAKE) -fMakefile -f .sig -f .man build_all + +build_all: $(HTML) man clean: - rm -rf ${HTML} downloads/*.sig man + @echo "Cleaning generated files" + @rm -rf man + @rm -f .sig .chk .man $(HTML) $(HTML:=.err) + +distclean: clean + @echo "Cleaning PGP signatures and extracted files" + @rm -f \ + $(ATMSPK_SIG) \ + $(ATMSPK_README) \ + $(COMSPK_SIG) \ + $(COMSPK_README) \ + $(HTRDR_README) \ + $(MAN) + + +install: build + @rsync -avzrR --delete-after --progress\ + downloads/gas_opt_prop_en.pdf\ + $(HTML)\ + $(IMG)\ + $$(find man -name "*.html")\ + $(ATMSPK_PKG)\ + $(ATMSPK_SIG)\ + $(COMSPK_PKG)\ + $(COMSPK_SIG)\ + $(PREFIX)/htrdr/ + +htrdr_build.sh: ../meso-menu.sh + @touch $@ + +################################################################################ +# Overview +################################################################################ +htrdr.html: \ + htrdr.html.in \ + $(HTRDR_README) \ + $(OVERVIEW_IMG) \ + htrdr_build.sh \ + Makefile + @echo "Building $@" + @sh htrdr_build.sh overview $(HTRDR_README) $(HTRDR_VERSION) > $@ + +$(HTRDR_README) $(MAN): + @echo "Extracting data from $(HTRDR_ARCH)" + @tar -xz -f $(HTRDR_ARCH) $(HTRDR_README) $(MAN) + +################################################################################ +# Reference documentations +################################################################################ +htrdr-docs.html: htrdr-docs.html.in + @echo "Building $@" + @sh htrdr_build.sh documentations > $@ + +################################################################################ +# Atmosphere Starter-Pack +################################################################################ +htrdr-atmosphere-spk.html: \ + $(ATMSPK_IMG) \ + $(ATMSPK_SIG) \ + $(ATMSPK_README) \ + htrdr_build.sh + @echo "Building $@" + @sh htrdr_build.sh atmspk $(ATMSPK_README) $(ATMSPK_VERSION) > $@ + +$(ATMSPK_README): + @echo "Extracting data from $(ATMSPK_ARCH)" + @tar -xz -f $(ATMSPK_ARCH) $(ATMSPK_README) + +################################################################################ +# Combustion Starter-Pack +################################################################################ +htrdr-combustion-spk.html: \ + $(COMSPK_IMG) \ + $(COMSPK_SIG) \ + $(COMSPK_README) \ + htrdr_build.sh + @echo "Building $@" + @sh htrdr_build.sh comspk $(COMSPK_README) $(COMSPK_VERSION) > $@ + +$(COMSPK_README): + @echo "Extracting data from $(COMSPK_ARCH)" + @tar -xz -f $(COMSPK_ARCH) $(COMSPK_README) + +################################################################################ +# Check files +################################################################################ +check: build .chk + @$(MAKE) -fMakefile -f .chk check_all + +check_all: check_shells $(HTML:=.chk) + +check_shells: + @echo "Checking htrdr_build.sh" && shellcheck -o all -x htrdr_build.sh + +################################################################################ +# Miscellaneous +################################################################################ +.sig: Makefile ../configure_targets.sh + @echo "Setup .sig" + @sh ../configure_targets.sh sig $(ATMSPK_PKG) $(COMSPK_PKG) > .sig + +.chk: Makefile ../configure_targets.sh + @echo "Setup .chk" + @sh ../configure_targets.sh chk $(HTML) > .chk + +.man: Makefile ../configure_targets.sh + @echo "Setup .man" + @sh ../configure_targets.sh man htrdr $(HTRDR_VERSION) $(MAN) > .man diff --git a/htrdr/htrdr.html.in b/htrdr/htrdr.html.in @@ -136,7 +136,7 @@ following research projects.</p> <ul> <li>In project <a - href="https://www.umr-cnrm.fr/spip.php?article1204&lang=en">ModRadUrb</a> the + href="https://www.umr-cnrm.fr/spip.php?article1204">ModRadUrb</a> the emphasis is put on taking into account the representation of <b>complex geometries</b> (detailled city scenes) using <b>spectral properties of a arbitrary number of materials</b>. The solver was extended to solve upward diff --git a/htrdr/htrdr.sh b/htrdr/htrdr.sh @@ -1,386 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -set -e - -source ../meso-menu.sh - -if [ $# -lt 3 ]; then - echo "Usage: $0 VERSION VERSION-ATMOSPHERE-SPK VERSION-COMBUSTION-SPK" - exit 1 -fi - -if [ ! -f "./downloads/htrdr-$1-GNU-Linux64.tar.gz" ]; then - echo "Cannot find ./downloads/htrdr-$1-GNU-Linux64.tar.gz" - exit 1 -fi - -dir_curr=$(pwd) # Current directory -dir_temp=$(mktemp -d) # Working directory - -################################################################################ -# Sign the package -################################################################################ -tput bold; echo ">>> htrdr packages"; tput sgr0 -archs=$(find "./downloads" -regex "^.*/High-Tune-.*[0-9]+\.[0-9]+\.[0-9]+.*tar.gz" \ - -o -regex "^.*/htrdr-.*[0-9]+\.[0-9]+\.[0-9]+.*tar.gz") - -sign_something=0 -for arch in $archs; do - if [ ! -f $arch.sig ]; then - echo "Sign $arch" - gpg -a -o $arch.sig --detach-sign $arch - sign_something=1 - fi -done - -if [ $sign_something == 0 ]; then - echo "Nothing to do" -fi - -echo "" - -################################################################################ -# Extract the current archive -################################################################################ -cd $dir_temp -arch=htrdr-$1-GNU-Linux64 -cp "$dir_curr/downloads/$arch.tar.gz" . -tar xzf $arch.tar.gz -htrdr_atmspk=htrdr-Atmosphere-Starter-Pack-$2 -tar xzf $dir_curr/downloads/$htrdr_atmspk.tar.gz $htrdr_atmspk/README.md -htrdr_comspk=htrdr-Combustion-Starter-Pack-$3 -tar xzf $dir_curr/downloads/$htrdr_comspk.tar.gz $htrdr_comspk/README.md.in -cd $dir_curr - -################################################################################ -# Generate the release note -################################################################################ -cd $dir_temp -release_notes=$($markdown $arch/share/doc/htrdr/README.md \ - | sed '/^<h2>Release notes<\/h2>/,$!d' \ - | sed '/^<h2>Copyright notice<\/h2>/,$d' \ - | sed 's/https:\/\/gitlab.com\/meso-star\/htrdr\/-\/blob\/master\/doc\/htrdr-materials\.5\.txt/man\/man5\/htrdr-materials.5.html/g' \ - | sed 's/https:\/\/gitlab.com\/meso-star\/htrdr\/-\/blob\/master\/doc\/htrdr-obj\.5\.txt/man\/man5\/htrdr-obj.5.html/g' \ - | sed 's/https:\/\/gitlab.com\/meso-star\/mrumtl\/-\/blob\/master\/doc\/mrumtl\.5\.txt/man\/man5\/mrumtl.5.html/g' \ - | sed 's/^<h2>Release notes/<h2 id=release_notes>Release notes/' \ - | sed 's/but introduce /but introduces /' \ - | sed 's/scracth/scratch/') # Misspelling -cd $dir_curr - -################################################################################ -# Generate the release note -################################################################################ -cd $dir_temp -copying=$($markdown $arch/share/doc/htrdr/README.md \ - | sed '/^<h2>Copyright notice<\/h2>/,$!d' \ - | sed 's/opyright (C)/opyright \&#169;/g') - -cd $dir_curr - -################################################################################ -# Generate the overview page -################################################################################ -tput bold; echo ">>> htrdr web pages"; tput sgr0 -echo "Write htrdr.html" -{ - print_header htrdr Overview - VERSION=$1 \ - RELEASE_NOTES="$release_notes" \ - COPYING=$copying \ - envsubst < htrdr.html.in; - print_footer -} > htrdr.html - -################################################################################ -# Generate the reference documentation page -################################################################################ -echo "Write htrdr-docs.html" -{ - print_header htrdr Documentations - cat htrdr-docs.html.in; - print_footer -} > htrdr-docs.html - - -################################################################################ -# Generate the starter pack -################################################################################ -echo "Write htrdr-atmosphere-spk.html" - -$markdown $dir_temp/$htrdr_atmspk/README.md \ - | sed 's/https:\/\/gitlab.com\/meso-star\/htgop.git/downloads\/gas_opt_prop_en.pdf/g' \ - | sed 's/https:\/\/www.meso-star.com\/projects\/htrdr\/man\//man\//g' \ - | sed 's/https:\/\/www.meso-star.com\/projects\/htrdr\/downloads\/gas_opt_prop_en.pdf/downloads\/gas_opt_prop_en.pdf/g' \ - | sed 's/https:\/\/gitlab.com\/meso-star\/htcp.git/man\/man5\/htcp.5.html/g' \ - | sed 's/https:\/\/gitlab.com\/meso-star\/htmie.git/man\/man5\/htmie.5.html/g' \ - | sed 's/https:\/\/gitlab.com\/meso-star\/htpp.git/man\/man1\/htpp.1.html/g' \ - | sed 's/https:\/\/gitlab.com\/meso-star\/htrdr.git/man\/man1\/htrdr.1.html/g' \ - > $dir_temp/$htrdr_atmspk/README.html - -intro=$(cat $dir_temp/$htrdr_atmspk/README.html \ - | sed 1d \ - | sed '/^<h2>Content<\/h2>/,$d') - -#content=$(cat $dir_temp/$htrdr_atmspk/README.html \ -# | sed '/^<h2>Content<\/h2>/,$!d' \ -# | sed 1d \ -# | sed '/^<h2>Quick start<\/h2>/,$d') - -content1=$(cat $dir_temp/$htrdr_atmspk/README.html \ - | sed '/^<h2>Content<\/h2>/,$!d' \ - | sed 1d \ - | sed '/^<h3>Geometries<\/h3>/,$d') - -content2=$(cat $dir_temp/$htrdr_atmspk/README.html \ - | sed '/^<h3>Geometries<\/h3>/,$!d' \ - | sed '/^<h3>Ground materials<\/h3>/,$d') - -content3=$(cat $dir_temp/$htrdr_atmspk/README.html \ - | sed '/^<h3>Ground materials<\/h3>/,$!d' \ - | sed '/^<h2>Quick start<\/h2>/,$d') - -release_notes=$(cat $dir_temp/$htrdr_atmspk/README.html \ - | sed '/^<h2>Release notes<\/h2>/,$!d' \ - | sed 1d \ - | sed 's/ gemetry / geometry /' \ - | sed '/^<h2>Copyright notice<\/h2>/,$d') - -copying=$(cat $dir_temp/$htrdr_atmspk/README.html \ - | sed '/^<h2>Copyright notice<\/h2>/,$!d' \ - | sed 's/from/from the/' \ - | sed 's/opyright (C)/opyright \&#169;/g') - -archs=$(find downloads -regex ".*/htrdr-Atmosphere-Starter-Pack.*\.tar.gz" | sort -r ) -archs+=" $(find downloads -regex ".*/High-Tune-Starter-Pack.*\.tar.gz" | sort -r )" - -{ - print_header htrdr Atmosphere-Starter-Pack - - echo "<header>" - echo " <h1>Atmosphere Starter Pack</h1>" - echo "</header>" - echo "<div class="news">" - echo " <p><b>Atmosphere Starter Pack $2</b></p>" - echo " <ul>" - echo " <li><a href=\"downloads/htrdr-Atmosphere-Starter-Pack-$2.tar.gz\">tarball</a> /" - echo " <a href=\"downloads/htrdr-Atmosphere-Starter-Pack-$2.tar.gz.sig\">pgp</a></li>" - echo " </ul>" - echo "</div>" - - echo $intro - - echo "<h2>Content</h2>" - echo "<div class=\"img\" style=\"padding-top:3em; width: 17em\">" - echo " <a href=\"DZVAR.jpg\"><img src=\"DZVAR.jpg\" alt=\"DZVAR\"></a>" - echo " <a href=\"DZVAR2.jpg\"><img src=\"DZVAR2.jpg\" alt=\"DZVAR2\"></a>" - echo " <a href=\"L12km_BOMEX.jpg\"><img src=\"L12km_BOMEX.jpg\" alt=\"L12_BOMEX\"></a>" - echo " <a href=\"L25_Fire.jpg\"><img src=\"L25_Fire.jpg\" alt=\"L25_Fire\"></a>" - echo " <a href=\"city.jpg\"><img src=\"city.jpg\" alt=\"city\"></a>" - echo " <div class=\"caption\">" - echo " Images of the DZVAR, DZVAR2, L12km_BOMEX, L25_Fire and city scenes" - echo " rendered with <code>htrdr-atmosphere</code>." - echo " </div>" - echo "</div>" - - echo $content1 - - echo "<div class=\"img\" style=\"margin-top:3em; width: 17em;\">" - echo " <a href=\"city_thin_lens.jpg\"><img src=\"city_thin_lens.jpg\" alt=\"city_thin_lens\"></a>" - echo " <div class=\"caption\">" - echo " The image of the scene city_thin_lens rendered with" - echo " <code>htrdr-atmosphere</code>. The thin lens camera used in this" - echo " rendering focuses on background elements; the foreground vegetation" - echo " is out of focus." - echo " </div>" - echo "</div>" - - echo $content2 - - echo "<div class=\"img\" style=\"margin-top:3em; width: 13em;\">" - echo " <a href=\"DZVAR_ortho.jpg\"><img src=\"DZVAR_ortho.jpg\" alt=\"DZVAR_ortho\"></a>" - echo " <div class=\"caption\">" - echo " Image of the DZVAR cloud field rendered from the top of the" - echo " atmosphere with an orthographic camera." - echo " </div>" - echo "</div>" - - echo $content3 - - echo "<h2>Install and run</h2>" - echo "" - echo "<p>Download the Atmosphere Starter-Pack archive and verify" - echo "its integrity against its <a href=\"../misc/pgp_signatures.html\">PGP" - echo "signature</a>. Then extract it. Assuming that <code>htrdr-atmosphere</code> is" - echo "installed and registered in the current shell, one can invoke a" - echo "<code>htrdr-atmosphere</code> rendering as bellow:" - echo "" - echo "<pre class=\"code\">" - echo "$ cd ~/htrdr-Atmosphere-Starter-Pack-$2" - echo "~/htrdr-Atmosphere-Starter-Pack-$2 $ bash htrdr-run.sh scenes/DZVAR2" - echo "</pre>" - echo "" - echo "<p>With <code>~/htrdr-Atmosphere-Starter-Pack-$2</code> the directory" - echo "where the Starter Pack is installed. The resulting image" - echo "<code>DZVAR2_1280x720x256.txt</code> is stored in the <a" - echo "href=\"man/man5/htrdr-image.5.html\">htrdr-image</a> file format. Use the <a" - echo "href=\"man/man1/htpp.1.html\">htpp</a> program to convert it in a regular PPM" - echo "file that can be then displayed with a regular image viewer." - echo "" - echo "<pre class=\"code\">" - echo "~/htrdr-Atmosphere-Starter-Pack-$2 $ htpp -o DZVAR2.ppm DZVAR2_1280x720x256.txt" - echo "</pre>" - - echo "<h2>Donwloads</h2>" - - echo "<table>" - echo " <tr>" - echo " <th>Version</th>" - echo " <th>Archive</th>" - echo " </tr>" - for i in $archs; do - version=$(echo $i | sed "s/.*Starter-Pack-\(.*\)\.tar.gz/\1/g") - echo " <tr>" - echo " <td>${version}</td>" - echo " <td>" - echo " [<a href='${i}'>tarball</a>]" - if [ -f $i.sig ]; then - echo " [<a href='$i.sig'>pgp</a>]" - fi - echo " </td>" - echo " </tr>" - done - echo "</table>" - - echo $release_notes - echo $copying - - print_footer - -} > htrdr-atmosphere-spk.html - -################################################################################ -# Generate the combustion starter pack -################################################################################ -echo "Write htrdr-combustion-spk.html" - -VERSION=$3 envsubst < $dir_temp/$htrdr_comspk/README.md.in \ - | $markdown \ - | sed 's/<pre><code>/<pre class=code>/g' \ - | sed 's/<\/code><\/pre>/<\/pre>/g' \ - > $dir_temp/$htrdr_comspk/README.html - -intro=$(cat $dir_temp/$htrdr_comspk/README.html \ - | sed 1d \ - | sed '0,/<code>htrdr<\/code>/s//<a href=man\/man1\/htrdr.1.html>htrdr<\/a>/' \ - | sed '0,/<code>htrdr-combustion<\/code>/s//<a href=man\/man1\/htrdr-combustion.1.html>htrdr-combustion<\/a>/' \ - | sed '/^<h2>Content<\/h2>/,$d') - -content=$(cat $dir_temp/$htrdr_comspk/README.html \ - | sed '/^<h2>Content<\/h2>/,$!d' \ - | sed 1d \ - | sed '0,/<code>htrdr<\/code>/s//<a href=man\/man1\/htrdr.1.html>htrdr<\/a>/' \ - | sed '0,/<code>htrdr-combustion<\/code>/s//<a href=man\/man1\/htrdr-combustion.1.html>htrdr-combustion<\/a>/' \ - | sed 's/PPM image than/PPM image that/' \ - | sed '/^<h2>Copyright notice<\/h2>/,$d') - -copying=$(cat $dir_temp/$htrdr_comspk/README.html \ - | sed '/^<h2>Copyright notice<\/h2>/,$!d') - -{ - print_header htrdr Combustion-Starter-Pack - - echo "<header>" - echo " <h1>Combustion Starter Pack</h1>" - echo "</header>" - echo "<div class="news">" - echo " <p><b>Combustion Starter Pack $3</b></p>" - echo " <ul>" - echo " <li><a href=\"downloads/htrdr-Combustion-Starter-Pack-$3.tar.gz\">tarball</a> /" - echo " <a href=\"downloads/htrdr-Combustion-Starter-Pack-$3.tar.gz.sig\">pgp</a></li>" - echo " </ul>" - echo "</div>" - - echo "$intro" - - echo '<h2>Content</h2>' - echo '<div class="img" style="width: 20em">' - echo ' <div style="width: 49.5%; float: left; padding-right: 1%" >' - echo ' <a href="dummy_medium.jpg">' - echo ' <img src="dummy_medium.jpg" alt="dummy_medium">' - echo ' </a>' - echo ' </div>' - echo ' <div style="width: 49.5%; float: left; padding-right: 0%">' - echo ' <a href="dummy_medium_clipped.jpg">' - echo ' <img src="dummy_medium_clipped.jpg" alt="dummy_medium_clipped">' - echo ' </a>' - echo ' </div>' - echo '' - echo ' <div class=caption>Illustration of the combustion medium provided in the' - echo ' Starter Pack. This medium is illuminated by a laser sheet whose surface of' - echo ' emission is here represented in red. The image on the left shows the' - echo ' entire medium. In the image on the right, the medium is clipped along the y axis' - echo ' to emphasize the axisymmetric profile of its soot volume fraction.</div>' - echo '</div>' - - echo "$content" - echo "$copying" - - print_footer - -} > htrdr-combustion-spk.html - -################################################################################ -# Generate the reference documentation -################################################################################ -cd $dir_temp -cp "$dir_curr/downloads/$arch.tar.gz" . -tar xzf $arch.tar.gz -cd $dir_curr - -for((i=0; i<${#htrdr_man_pages[@]}; ++i)); do - entry=(${htrdr_man_pages[$i]}) - man_name=${entry[0]} - man_num=${entry[1]} - man_path="$dir_temp/$arch/share/man/man${entry[1]}/$man_name.$man_num" - output="man/man${entry[1]}/$man_name.$man_num.html" - - if [ $man_name == "htgop" ]; then - continue - fi - convert_man_page htrdr "$man_path" "$output" $1 - - if [ "$man_name" == "les2htcp" ]; then - # Add spaces missing after the man2html conversion - sed -i 's/liquid vapor/liquid water/g' $output - sed -i 's/<\/I><B>or<\/B><I>/<\/I> <B>or<\/B> <I>/g' $output - sed -i 's/<\/I><B>and<\/B><I>/<\/I> <B>and<\/B> <I>/g' $output - fi - - if [ "$man_name" == "htrdr-combustion" ]; then - # Fix typos and misspellings - sed -i 's/\<spectrallyole\>/spectrally/g' $output - sed -i 's/Be default,/By default,/g' $output - fi - - if [ "$man_name" == "htrdr-atmosphere" ]; then - # Fix typos and misspellings - sed -i 's/\<spectrallyole\>/spectrally/g' $output - sed -i 's/Be default,/By default,/g' $output - fi -done - diff --git a/htrdr/htrdr_build.sh b/htrdr/htrdr_build.sh @@ -0,0 +1,255 @@ +#!/bin/sh -e + +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. ../meso-menu.sh + +overview() +{ + if [ $# -lt 2 ]; then + printf "Usage: %s overview <readme> <version>\n" "$0" >&2 + exit 1 + fi + + readme=$(${markdown} "$1") + release_notes=$(echo "${readme}" \ + | sed -n '/^<h2>Release notes<\/h2>/,/^<h2>Copyright notice<\/h2>/p' \ + | sed '$d' \ + | sed 's/https:\/\/gitlab.com\/meso-star\/htrdr\/-\/blob\/master\/doc\/htrdr-materials\.5\.txt/man\/man5\/htrdr-materials.5.html/g' \ + | sed 's/https:\/\/gitlab.com\/meso-star\/htrdr\/-\/blob\/master\/doc\/htrdr-obj\.5\.txt/man\/man5\/htrdr-obj.5.html/g' \ + | sed 's/https:\/\/gitlab.com\/meso-star\/mrumtl\/-\/blob\/master\/doc\/mrumtl\.5\.txt/man\/man5\/mrumtl.5.html/g' \ + | sed 's/^<h2>Release notes/<h2 id=release_notes>Release notes/' \ + | sed 's/but introduce /but introduces /' \ + | sed 's/scracth/scratch/') # Misspelling + + copying=$(echo "${readme}" \ + | sed -n '/^<h2>Copyright notice<\/h2>/,$p' \ + | sed 's/opyright (C)/opyright \&#169;/g') + + print_header htrdr Overview + VERSION=$2 RELEASE_NOTES="${release_notes}" COPYING="${copying}" envsubst < htrdr.html.in + print_footer +} + +documentations() +{ + print_header htrdr Documentations + cat htrdr-docs.html.in + print_footer +} + +atmspk() +{ + if [ $# -lt 2 ]; then + printf "Usage: %s atmspk <readme> <version>\n" "$0" >&2 + exit 1 + fi + + readme=$(${markdown} "$1" \ + | sed 's/https:\/\/gitlab.com\/meso-star\/htgop.git/downloads\/gas_opt_prop_en.pdf/g' \ + | sed 's/https:\/\/www.meso-star.com\/projects\/htrdr\/man\//man\//g' \ + | sed 's/https:\/\/www.meso-star.com\/projects\/htrdr\/downloads\/gas_opt_prop_en.pdf/downloads\/gas_opt_prop_en.pdf/g' \ + | sed 's/https:\/\/gitlab.com\/meso-star\/htcp.git/man\/man5\/htcp.5.html/g' \ + | sed 's/https:\/\/gitlab.com\/meso-star\/htmie.git/man\/man5\/htmie.5.html/g' \ + | sed 's/https:\/\/gitlab.com\/meso-star\/htpp.git/man\/man1\/htpp.1.html/g' \ + | sed 's/https:\/\/gitlab.com\/meso-star\/htrdr.git/man\/man1\/htrdr.1.html/g') + + intro=$(echo "${readme}" | sed -e '1d' -e '/^<h2>Content<\/h2>/,$d') + content1=$(echo "${readme}" \ + | sed -n '/^<h2>Content<\/h2>/,/^<h3>Geometries<\/h3>/p' \ + | sed -e '1d' -e '$d') + content2=$(echo "${readme}" \ + | sed -n '/^<h3>Geometries<\/h3>/,/^<h3>Ground materials<\/h3>/p' \ + | sed '$d') + content3=$(echo "${readme}" \ + | sed -n '/^<h3>Ground materials<\/h3>/,/^<h2>Quick start<\/h2>/p' \ + | sed '$d') + release_notes=$(echo "${readme}" \ + | sed -n '/^<h2>Release notes<\/h2>/,/^<h2>Copyright notice<\/h2>/p' \ + | sed -e '1d' -e '$d' -e 's/ gemetry / geometry /') + copying=$(echo "${readme}" \ + | sed -n '/^<h2>Copyright notice<\/h2>/,$p' \ + | sed -e 's/from/from the/' -e 's/opyright (C)/opyright \&#169;/') + + archs=$(find downloads -name "htrdr-Atmosphere-Starter-Pack*.tar.gz" | sort -r) + archs=$(echo "${archs}" && find downloads -name "High-Tune-Starter-Pack*.tar.gz" | sort -r ) + + print_header htrdr Atmosphere-Starter-Pack + + echo "<header>" + echo " <h1>Atmosphere Starter Pack</h1>" + echo "</header>" + echo "<div class=\"news\">" + echo " <p><b>Atmosphere Starter Pack $2</b></p>" + echo " <ul>" + echo " <li><a href=\"downloads/htrdr-Atmosphere-Starter-Pack-$2.tar.gz\">tarball</a> /" + echo " <a href=\"downloads/htrdr-Atmosphere-Starter-Pack-$2.tar.gz.sig\">pgp</a></li>" + echo " </ul>" + echo "</div>" + + echo "${intro}" + + echo "<h2>Content</h2>" + echo "<div class=\"img\" style=\"padding-top:3em; width: 17em\">" + echo " <a href=\"DZVAR.jpg\"><img src=\"DZVAR.jpg\" alt=\"DZVAR\"></a>" + echo " <a href=\"DZVAR2.jpg\"><img src=\"DZVAR2.jpg\" alt=\"DZVAR2\"></a>" + echo " <a href=\"L12km_BOMEX.jpg\"><img src=\"L12km_BOMEX.jpg\" alt=\"L12_BOMEX\"></a>" + echo " <a href=\"L25_Fire.jpg\"><img src=\"L25_Fire.jpg\" alt=\"L25_Fire\"></a>" + echo " <a href=\"city.jpg\"><img src=\"city.jpg\" alt=\"city\"></a>" + echo " <div class=\"caption\">" + echo " Images of the DZVAR, DZVAR2, L12km_BOMEX, L25_Fire and city scenes" + echo " rendered with <code>htrdr-atmosphere</code>." + echo " </div>" + echo "</div>" + + echo "${content1}" + + echo "<div class=\"img\" style=\"margin-top:3em; width: 17em;\">" + echo " <a href=\"city_thin_lens.jpg\"><img src=\"city_thin_lens.jpg\" alt=\"city_thin_lens\"></a>" + echo " <div class=\"caption\">" + echo " The image of the scene city_thin_lens rendered with" + echo " <code>htrdr-atmosphere</code>. The thin lens camera used in this" + echo " rendering focuses on background elements; the foreground vegetation" + echo " is out of focus." + echo " </div>" + echo "</div>" + + echo "${content2}" + + echo "<div class=\"img\" style=\"margin-top:3em; width: 13em;\">" + echo " <a href=\"DZVAR_ortho.jpg\"><img src=\"DZVAR_ortho.jpg\" alt=\"DZVAR_ortho\"></a>" + echo " <div class=\"caption\">" + echo " Image of the DZVAR cloud field rendered from the top of the" + echo " atmosphere with an orthographic camera." + echo " </div>" + echo "</div>" + + echo "${content3}" + + echo "<h2>Install and run</h2>" + echo "" + echo "<p>Download the Atmosphere Starter-Pack archive and verify" + echo "its integrity against its <a href=\"../misc/pgp_signatures.html\">PGP" + echo "signature</a>. Then extract it. Assuming that <code>htrdr-atmosphere</code> is" + echo "installed and registered in the current shell, one can invoke a" + echo "<code>htrdr-atmosphere</code> rendering as bellow:" + echo "" + echo "<pre class=\"code\">" + echo "$ cd &#126;/htrdr-Atmosphere-Starter-Pack-$2" + echo "&#126;/htrdr-Atmosphere-Starter-Pack-$2 $ bash htrdr-run.sh scenes/DZVAR2" + echo "</pre>" + echo "" + echo "<p>With <code>~/htrdr-Atmosphere-Starter-Pack-$2</code> the directory" + echo "where the Starter Pack is installed. The resulting image" + echo "<code>DZVAR2_1280x720x256.txt</code> is stored in the <a" + echo "href=\"man/man5/htrdr-image.5.html\">htrdr-image</a> file format. Use the <a" + echo "href=\"man/man1/htpp.1.html\">htpp</a> program to convert it in a regular PPM" + echo "file that can be then displayed with a regular image viewer." + echo "" + echo "<pre class=\"code\">" + echo "&#126;/htrdr-Atmosphere-Starter-Pack-$2 $ htpp -o DZVAR2.ppm DZVAR2_1280x720x256.txt" + echo "</pre>" + + echo "<h2>Donwloads</h2>" + + echo "<table>" + echo " <tr>" + echo " <th>Version</th>" + echo " <th>Archive</th>" + echo " </tr>" + + echo "${archs}" | + while read -r i ; do + version=$(echo "${i}" | sed "s/.*Starter-Pack-\(.*\)\.tar.gz/\1/g") + echo " <tr>" + echo " <td>${version}</td>" + echo " <td>" + echo " [<a href=\"${i}\">tarball</a>]" + if [ -f "${i}.sig" ]; then + echo " [<a href=\"${i}.sig\">pgp</a>]" + fi + echo " </td>" + echo " </tr>" + done + echo "</table>" + + echo "${release_notes}" + echo "${copying}" + + print_footer +} + +comspk() +{ + if [ $# -lt 2 ]; then + printf "Usage: %s comspk <readme> <version>\n" "$0" >&2 + exit 1 + fi + + readme=$(VERSION=$2 envsubst < "$1" | ${markdown}) + intro=$(echo "${readme}" | sed '/^<h2>Content<\/h2>/q' \ + | sed -e '1d' -e '$d' \ + | sed '0,/<code>htrdr<\/code>/s//<a href=man\/man1\/htrdr.1.html>htrdr<\/a>/' \ + | sed '0,/<code>htrdr-combustion<\/code>/s//<a href=man\/man1\/htrdr-combustion.1.html>htrdr-combustion<\/a>/') + content=$(echo "${readme}" \ + | sed -n '/^<h2>Content<\/h2>/,/^<h2>Copyright notice<\/h2>/p' \ + | sed -e '1d' -e '$d' -e 's/PPM image than/PPM image that/' \ + | sed '0,/<code>htrdr<\/code>/s//<a href=man\/man1\/htrdr.1.html>htrdr<\/a>/' \ + | sed '0,/<code>htrdr-combustion<\/code>/s//<a href=man\/man1\/htrdr-combustion.1.html>htrdr-combustion<\/a>/') + copying=$(echo "${readme}" | sed -n '/^<h2>Copyright notice<\/h2>/,$p') + + print_header htrdr Combustion-Starter-Pack + + echo "<header>" + echo " <h1>Combustion Starter Pack</h1>" + echo "</header>" + echo "<div class=\"news\">" + echo " <p><b>Combustion Starter Pack $2</b></p>" + echo " <ul>" + echo " <li><a href=\"downloads/htrdr-Combustion-Starter-Pack-$2.tar.gz\">tarball</a> /" + echo " <a href=\"downloads/htrdr-Combustion-Starter-Pack-$2.tar.gz.sig\">pgp</a></li>" + echo " </ul>" + echo "</div>" + + echo "${intro}" + + echo "<h2>Content</h2>" + echo "<div class=\"img\" style=\"width: 20em\">" + echo " <div style=\"width: 49.5%; float: left; padding-right: 1%\">" + echo " <a href=\"dummy_medium.jpg\">" + echo " <img src=\"dummy_medium.jpg\" alt=\"dummy_medium\">" + echo " </a>" + echo " </div>" + echo " <div style=\"width: 49.5%; float: left; padding-right: 0%\">" + echo " <a href=\"dummy_medium_clipped.jpg\">" + echo " <img src=\"dummy_medium_clipped.jpg\" alt=\"dummy_medium_clipped\">" + echo " </a>" + echo " </div>" + echo "" + echo " <div class=\"caption\">Illustration of the combustion medium provided in the" + echo " Starter Pack. This medium is illuminated by a laser sheet whose surface of" + echo " emission is here represented in red. The image on the left shows the" + echo " entire medium. In the image on the right, the medium is clipped along the y axis" + echo " to emphasize the axisymmetric profile of its soot volume fraction.</div>" + echo "</div>" + + echo "${content}" + echo "${copying}" + + print_footer +} + +"$@" diff --git a/meso-menu.sh b/meso-menu.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -e # Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) # @@ -15,285 +15,268 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -set -e - -solstice_man_pages=( - "solstice 1" - "solstice-input 5" - "solstice-output 5" - "solstice-receiver 5" -) - -schiff_man_pages=( - "schiff 1" - "schiff-geometry 5" - "schiff-output 5" -) - -htrdr_man_pages=( - "atrri 5" - "atrtp 5" - "htmie 5" - "htcp 5" - "htgop 5" - "htpp 1" - "htrdr 1" - "htrdr-atmosphere 1" - "htrdr-combustion 1" - "htrdr-image 5" - "htrdr-materials 5" - "htrdr-obj 5" - "les2htcp 1" - "mrumtl 5" - "sth 5" -) - -stardis_man_pages=( - "stardis 1" - "stardis-input 5" - "stardis-output 5" - "sgreen 1" - "sgreen-input 5" - "sgreen-output 5" -) +export solstice_man_pages="\ + solstice 1 + solstice-input 5 + solstice-output 5 + solstice-receiver 5" + +export schiff_man_pages="\ + schiff 1 + schiff-geometry 5 + schiff-output 5" + +export stardis_man_pages="\ + stardis 1 + stardis-input 5 + stardis-output 5 + sgreen 1 + sgreen-input 5 + sgreen-output 5" print_home_sub_menu() { - local root=$1 - local name=$2 + root=$1 + name=$2 - echo ' <div id=sub-menu>' - echo ' <ul>' - if [ "$name" == "About" ]; then - echo ' <li id=cur>About</li>' + echo " <div id=\"sub-menu\">" + echo " <ul>" + if [ "${name}" = "About" ]; then + echo " <li id=\"cur\">About</li>" else - echo " <li><a href=${root}misc/about-fr.html>About</a></li>" + echo " <li><a href=\"${root}misc/about-fr.html\">About</a></li>" fi - if [ "$name" == "PGP" ]; then - echo ' <li id=cur>PGP signatures</li>' + if [ "${name}" = "PGP" ]; then + echo " <li id=\"cur\">PGP signatures</li>" else - echo " <li><a href=${root}misc/pgp_signatures.html>PGP signatures</a></li>" + echo " <li><a href=\"${root}misc/pgp_signatures.html\">PGP signatures</a></li>" fi - if [ "$name" == "Legal" ]; then - echo ' <li id=cur>Legal notices</li>' + if [ "${name}" = "Legal" ]; then + echo " <li id=\"cur\">Legal notices</li>" else - echo " <li><a href=${root}misc/legal-fr.html>Legal notices</a></li>" + echo " <li><a href=\"${root}misc/legal-fr.html\">Legal notices</a></li>" fi - echo ' </ul>' - echo ' </div>' + echo " </ul>" + echo " </div>" } print_art_sub_menu() { - local root=$1 - local name=$2 + root=$1 + name=$2 - echo ' <div id=sub-menu>' - echo ' <ul>' - if [ "$name" == "Overview" ]; then + echo " <div id=\"sub-menu\">" + echo " <ul>" + if [ "${name}" = "Overview" ]; then echo ' <li id=cur>Overview</li>' else - echo " <li><a href=${root}art/art.html>Overview</a></li>" + echo " <li><a href=\"${root}art/art.html\">Overview</a></li>" fi - echo ' <li>Codes</li>' - echo ' <li><ul class=lvl2>' - if [ "$name" == "Kspectrum" ]; then - echo ' <li id=cur>Kspectrum</li>' + echo " <li>Codes</li>" + echo " <li><ul class=\"lvl2\">" + if [ "${name}" = "Kspectrum" ]; then + echo " <li id=\"cur\">Kspectrum</li>" else - echo " <li><a href=${root}art/kspectrum.html>Kspectrum</a></li>" + echo " <li><a href=\"${root}art/kspectrum.html\">Kspectrum</a></li>" fi - if [ "$name" == "Kdistribution" ]; then - echo ' <li id=cur>Kdistribution</li>' + if [ "${name}" = "Kdistribution" ]; then + echo " <li id=\"cur\">Kdistribution</li>" else - echo " <li><a href=${root}art/kdistribution.html>Kdistribution</a></li>" + echo " <li><a href=\"${root}art/kdistribution.html\">Kdistribution</a></li>" fi - if [ "$name" == "HR_PPart" ]; then - echo ' <li id=cur>HR_PPart</li>' + if [ "${name}" = "HR_PPart" ]; then + echo " <li id=\"cur\">HR_PPart</li>" else - echo " <li><a href=${root}art/hr_ppart.html>HR_PPart</a></li>" + echo " <li><a href=\"${root}art/hr_ppart.html\">HR_PPart</a></li>" fi - if [ "$name" == "PPart_LW" ]; then - echo ' <li id=cur>PPart_LW</li>' + if [ "${name}" = "PPart_LW" ]; then + echo " <li id=\"cur\">PPart_LW</li>" else - echo " <li><a href=${root}art/ppart_lw.html>PPart_LW</a></li>" + echo " <li><a href=\"${root}art/ppart_lw.html\">PPart_LW</a></li>" fi - if [ "$name" == "PPart_SW" ]; then - echo ' <li id=cur>PPart_SW</li>' + if [ "${name}" = "PPart_SW" ]; then + echo " <li id=\"cur\">PPart_SW</li>" else - echo " <li><a href=${root}art/ppart_sw.html>PPart_SW</a></li>" + echo " <li><a href=\"${root}art/ppart_sw.html\">PPart_SW</a></li>" fi - if [ "$name" == "Karine" ]; then - echo ' <li id=cur>Karine</li>' + if [ "${name}" = "Karine" ]; then + echo " <li id=\"cur\">Karine</li>" else - echo " <li><a href=${root}art/karine.html>Karine</a></li>" + echo " <li><a href=\"${root}art/karine.html\">Karine</a></li>" fi - echo ' </ul></li>' - echo ' </ul>' - echo ' </div>' + echo " </ul></li>" + echo " </ul>" + echo " </div>" } print_htrdr_sub_menu() { - local root=$1 - local name=$2 + root=$1 + name=$2 - echo ' <div id=sub-menu>' - echo ' <ul>' - if [ "$name" == "Overview" ]; then - echo ' <li id=cur>Overview</li>' + echo " <div id=\"sub-menu\">" + echo " <ul>" + if [ "${name}" = "Overview" ]; then + echo " <li id=\"cur\">Overview</li>" else - echo " <li><a href=${root}htrdr/htrdr.html>Overview</a></li>" + echo " <li><a href=\"${root}htrdr/htrdr.html\">Overview</a></li>" fi - if [ "$name" == "Documentations" ]; then - echo ' <li id=cur>Reference documentation</li>' + if [ "${name}" = "Documentations" ]; then + echo " <li id=\"cur\">Reference documentation</li>" else - echo " <li><a href=${root}htrdr/htrdr-docs.html>Reference documentation</a></li>" + echo " <li><a href=\"${root}htrdr/htrdr-docs.html\">Reference documentation</a></li>" fi echo " <li>Starter Pack</li>" - echo " <li><ul class=lvl2>" - if [ "$name" == "Atmosphere-Starter-Pack" ]; then - echo " <li id=cur>Atmosphere</li>" + echo " <li><ul class=\"lvl2\">" + if [ "${name}" = "Atmosphere-Starter-Pack" ]; then + echo " <li id=\"cur\">Atmosphere</li>" else - echo " <li><a href=${root}htrdr/htrdr-atmosphere-spk.html>Atmosphere</a></li>" + echo " <li><a href=\"${root}htrdr/htrdr-atmosphere-spk.html\">Atmosphere</a></li>" fi - if [ "$name" == "Combustion-Starter-Pack" ]; then - echo " <li id=cur>Combustion</li>" + if [ "${name}" = "Combustion-Starter-Pack" ]; then + echo " <li id=\"cur\">Combustion</li>" else - echo " <li><a href=${root}htrdr/htrdr-combustion-spk.html>Combustion</a></li>" + echo " <li><a href=\"${root}htrdr/htrdr-combustion-spk.html\">Combustion</a></li>" fi echo " </ul></li>" - echo " <li><a href=https://gitlab.com/meso-star/htrdr>Git repository</a></li>" - echo ' </ul>' - echo ' <div id="info">' - echo ' <p> htrdr was funded by the <a' - echo ' href=https://anr.fr/Project-ANR-18-CE05-0015>ANR Astoria</a> from 2018 to' - echo ' 2022. |Méso|Star&gt; was sub-contractor of the project.</p>' - echo ' <p>htrdr was funded by the <a href=https://www.ademe.fr/>ADEME</a>' - echo ' (MODEVAL-URBA-2019) from 2019 to 2022. |Méso|Star&gt; was partner of the' - echo ' project with <a href="https://www.umr-cnrm.fr/">CNRM</a>.</p>' - echo ' <p>htrdr was funded by the <a' - echo ' href=https://anr.fr/Project-ANR-16-CE01-0010>ANR High-Tune</a> from' - echo ' 2016 to 2019. |Méso|Star&gt; was sub-contractor of the project. Visit' - echo ' the <a href="http://www.umr-cnrm.fr/high-tune/?lang=en"> High-Tune' - echo ' project web site</a>.</p>' - echo ' </div>' - echo ' </div>' + echo " <li><a href=\"https://gitlab.com/meso-star/htrdr\">Git repository</a></li>" + echo " </ul>" + echo " <div id=\"info\">" + echo " <p> htrdr was funded by the <a" + echo " href=\"https://anr.fr/Project-ANR-18-CE05-0015\">ANR Astoria</a> from 2018 to" + echo " 2022. |Méso|Star&gt; was sub-contractor of the project.</p>" + echo " <p>htrdr was funded by the <a href=\"https://www.ademe.fr/\">ADEME</a>" + echo " (MODEVAL-URBA-2019) from 2019 to 2022. |Méso|Star&gt; was partner of the" + echo " project with <a href=\"https://www.umr-cnrm.fr/\">CNRM</a>.</p>" + echo " <p>htrdr was funded by the <a" + echo " href=\"https://anr.fr/Project-ANR-16-CE01-0010\">ANR High-Tune</a> from" + echo " 2016 to 2019. |Méso|Star&gt; was sub-contractor of the project. Visit" + echo " the <a href=\"http://www.umr-cnrm.fr/high-tune/?lang=en\"> High-Tune" + echo " project web site</a>.</p>" + echo " </div>" + echo " </div>" } print_schiff_sub_menu() { - local root=$1 - local name=$2 - - echo ' <div id=sub-menu>' - echo ' <ul>' - if [ "$name" == "Overview" ]; then - echo ' <li id=cur>Overview</li>' - else - echo " <li><a href=${root}schiff/schiff.html>Overview</a></li>" - fi - echo ' <li>Reference documentation</li>' - echo ' <li><ul class=lvl2>' - local i - for((i=0; i < ${#schiff_man_pages[@]}; ++i)); do - local entry=(${schiff_man_pages[$i]}) - if [ "$name" == "${entry[0]}" ]; then - echo " <li id=cur>$name</li>" + root=$1 + name=$2 + + echo " <div id=\"sub-menu\">" + echo " <ul>" + if [ "${name}" = "Overview" ]; then + echo " <li id=\"cur\">Overview</li>" + else + echo " <li><a href=\"${root}schiff/schiff.html\">Overview</a></li>" + fi + echo " <li>Reference documentation</li>" + echo " <li><ul class=\"lvl2\">" + printf "%s\n" "${schiff_man_pages}" | \ + while read -r i; do + man=$(printf "%s" "${i}" | awk '{print $1}') + section=$(printf "%s" "${i}" | awk '{print $2}') + if [ "${name}" = "${man}" ]; then + echo " <li id=\"cur\">${name}</li>" else - local link_path="${root}schiff/man/man${entry[1]}/${entry[0]}.${entry[1]}.html" - echo " <li><a href=\"$link_path\">${entry[0]}</a></li>" + link_path="${root}schiff/man/man${section}/${man}.${section}.html" + echo " <li><a href=\"${link_path}\">${man}</a></li>" fi done - echo ' </ul></li>' - if [ "$name" == "Downloads" ]; then - echo ' <li id=cur>Downloads</li>' + echo " </ul></li>" + if [ "${name}" = "Downloads" ]; then + echo " <li id=\"cur\">Downloads</li>" else - echo " <li><a href=${root}schiff/schiff-downloads.html>Downloads</a></li>" + echo " <li><a href=\"${root}schiff/schiff-downloads.html\">Downloads</a></li>" fi - echo " <li><a href=https://gitlab.com/meso-star/schiff>Git repository</a></li>" - echo ' </ul>' - echo ' </div>' + echo " <li><a href=\"https://gitlab.com/meso-star/schiff\">Git repository</a></li>" + echo " </ul>" + echo " </div>" } print_solstice_sub_menu() { - local root=$1 - local name=$2 + root=$1 + name=$2 - echo ' <div id=sub-menu>' - echo ' <ul>' - if [ "$name" == "Overview" ]; then - echo ' <li id=cur>Overview</li>' + echo " <div id=\"sub-menu\">" + echo " <ul>" + if [ "${name}" = "Overview" ]; then + echo " <li id=\"cur\">Overview</li>" else - echo " <li><a href=${root}solstice/solstice.html>Overview</a></li>" + echo " <li><a href=\"${root}solstice/solstice.html\">Overview</a></li>" fi - echo ' <li>Reference documentation</li>' - echo ' <li><ul class=lvl2>' - local i - for((i=0; i < ${#solstice_man_pages[@]}; ++i)); do - local entry=(${solstice_man_pages[$i]}) - if [ "$name" == "${entry[0]}" ]; then - echo " <li id=cur>$name</li>" + echo " <li>Reference documentation</li>" + echo " <li><ul class=\"lvl2\">" + + printf "%s\n" "${solstice_man_pages}" | \ + while read -r i; do + man=$(printf "%s" "${i}" | awk '{print $1}') + section=$(printf "%s" "${i}" | awk '{print $2}') + if [ "${name}" = "${man}" ]; then + echo " <li id=\"cur\">${name}</li>" else - local link_path="${root}solstice/man/man${entry[1]}/${entry[0]}.${entry[1]}.html" - echo " <li><a href=\"$link_path\">${entry[0]}</a></li>" + link_path="${root}solstice/man/man${section}/${man}.${section}.html" + echo " <li><a href=\"${link_path}\">${man}</a></li>" fi done - echo ' </ul></li>' - if [ "$name" == "Downloads" ]; then - echo ' <li id=cur>Downloads</li>' + + echo " </ul></li>" + if [ "${name}" = "Downloads" ]; then + echo " <li id=\"cur\">Downloads</li>" else - echo " <li><a href=${root}solstice/solstice-downloads.html>Downloads</a></li>" + echo " <li><a href=\"${root}solstice/solstice-downloads.html\">Downloads</a></li>" fi - if [ "$name" == "Resources" ]; then - echo ' <li id=cur>Additional resources</li>' + if [ "${name}" = "Resources" ]; then + echo " <li id=\"cur\">Additional resources</li>" else - echo " <li><a href=${root}solstice/solstice-resources.html>Additional resources</a></li>" + echo " <li><a href=\"${root}solstice/solstice-resources.html\">Additional resources</a></li>" fi - echo " <li><a href=https://gitlab.com/meso-star/solstice>Git repository</a></li>" - echo ' </ul>' - echo ' <div id="info">' - echo ' <p>Solstice was funded by the LABEX Solstice from 2016 to 2017.' - echo ' Visit the <a href="https://www.labex-solstice.fr/solstice-software">' - echo ' LABEX Solstice web page</a> for complementary informations and examples.</p>' - echo ' </div>' - echo ' </div>' + echo " <li><a href=\"https://gitlab.com/meso-star/solstice\">Git repository</a></li>" + echo " </ul>" + echo " <div id=\"info\">" + echo " <p>Solstice was funded by the LABEX Solstice from 2016 to 2017." + echo " Visit the <a href=\"https://www.labex-solstice.fr/solstice-software\">" + echo " LABEX Solstice web page</a> for complementary informations and examples.</p>" + echo " </div>" + echo " </div>" } print_stardis_sub_menu() { - local root=$1 - local name=$2 + root=$1 + name=$2 - echo ' <div id=sub-menu>' - echo ' <ul>' - if [ "$name" == "Overview" ]; then - echo ' <li id=cur>Overview</li>' + echo " <div id=\"sub-menu\">" + echo " <ul>" + if [ "${name}" = "Overview" ]; then + echo " <li id=\"cur\">Overview</li>" else - echo " <li><a href=${root}stardis/stardis.html>Overview</a></li>" + echo " <li><a href=\"${root}stardis/stardis.html\">Overview</a></li>" fi - if [ "$name" == "Consortium" ]; then - echo " <li id=cur>Consortium</li>" + if [ "${name}" = "Consortium" ]; then + echo " <li id=\"cur\">Consortium</li>" else - echo " <li><a href=${root}stardis/consortium-fr.html>Consortium</a></li>" + echo " <li><a href=\"${root}stardis/consortium-fr.html\">Consortium</a></li>" fi - echo ' <li>Reference documentation</li>' - echo ' <li><ul class=lvl2>' - local i - for((i=0; i < ${#stardis_man_pages[@]}; ++i)); do - local entry=(${stardis_man_pages[$i]}) - if [ "$name" == "${entry[0]}" ]; then - echo " <li id=cur>$name</li>" + echo " <li>Reference documentation</li>" + echo " <li><ul class=lvl2>" + + printf "%s\n" "${stardis_man_pages}" | \ + while read -r i; do + man=$(printf "%s" "${i}" | awk '{print $1}') + section=$(printf "%s" "${i}" | awk '{print $2}') + if [ "${name}" = "${man}" ]; then + echo " <li id=cur>${name}</li>" else - local link_path="${root}stardis/man/man${entry[1]}/${entry[0]}.${entry[1]}.html" - echo " <li><a href=\"$link_path\">${entry[0]}</a></li>" + link_path="${root}stardis/man/man${section}/${man}.${section}.html" + echo " <li><a href=\"${link_path}\">${man}</a></li>" fi done echo ' </ul></li>' - if [ "$name" == "Starter-Pack" ]; then + if [ "${name}" = "Starter-Pack" ]; then echo " <li id=cur>Starter Pack</li>" else echo " <li><a href=${root}stardis/starter-pack.html>Starter Pack</a></li>" fi - if [ "$name" == "Downloads" ]; then + if [ "${name}" = "Downloads" ]; then echo " <li id=cur>Downloads</li>" else echo " <li><a href=${root}stardis/stardis-downloads.html>Downloads</a></li>" @@ -310,37 +293,42 @@ print_stardis_sub_menu() { } print_star_engine_sub_menu() { - local root=$1 - local name=$2 - local components=( - "Star-Geom Geometric&nbsp;data" - "Star-2D Star-2D" - "Star-3D Star-3D" - "Star-SP Star-SamPling" - "Star-SF Star-ScatteringFunctions" - "Star-UVM Star-UVM" - "Star-VX Star-VoXel") + root=$1 + name=$2 + components="\ + Star-Geom Geometric&nbsp;data + Star-2D Star-2D + Star-3D Star-3D + Star-SP Star-SamPling + Star-SF Star-ScatteringFunctions + Star-UVM Star-UVM + Star-VX Star-VoXel" echo ' <div id=sub-menu>' echo ' <ul>' - if [ "$name" == "Overview" ]; then + if [ "${name}" = "Overview" ]; then echo ' <li id=cur>Overview</li>' else echo " <li><a href=${root}star-engine/star-engine.html>Overview</a></li>" fi echo ' <li>Components</li>' echo ' <li><ul class=lvl2>' - local i - for((i=0; i < ${#components[@]}; ++i)); do - local entry=(${components[$i]}) - if [ "$name" == "${entry[0]}" ]; then - echo " <li id=cur>${entry[1]}</li>" + + printf "%s\n" "${components}" | \ + while read -r i; do + page=$(printf "%s" "${i}" | awk '{print $1}') + section=$(printf "%s" "${i}" | awk '{print $2}') + if [ "${name}" = "${page}" ]; then + echo " <li id=cur>${section}</li>" else - echo " <li><a href=${root}star-engine/$(echo ${entry[0]} | tr '[:upper:]' '[:lower:]').html>${entry[1]}</a></li>" + page_low=$(echo "${page}" | tr '[:upper:]' '[:lower:]') + printf " <li><a href=%sstar-engine/%s.html>%s</a></li>" \ + "${root}" "${page_low}" "${section}" fi done + echo ' </ul></li>' - if [ "$name" == "Downloads" ]; then + if [ "${name}" = "Downloads" ]; then echo ' <li id=cur>Downloads</li>' else echo " <li><a href=${root}star-engine/star-engine-downloads.html>Downloads</a></li>" @@ -358,85 +346,85 @@ print_star_engine_sub_menu() { } print_header() { - local section=$1 - local full_name=$2 - local lang=$([[ $# -ge 3 ]] && echo $3 || echo "en") - local name=${full_name#man-} - local is_man=$([[ $full_name =~ ^man- ]] && echo 1 || echo 0) - local root=$([[ $is_man == 1 ]] && echo "../../../" || echo "../") - - echo '<!DOCTYPE html>' - echo '' - echo "<html lang=$lang>" - echo '<head>' - echo ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8">' - echo ' <meta name="viewport" content="width=device-width, initial-scale=1">' - echo " <title>|M|S&gt; $section</title>" + section=$1 + full_name=$2 + lang=$([ $# -ge 3 ] && echo "$3" || echo "en") + name=${full_name#man-} + is_man=$([ "${full_name}" != "${name}" ] && echo 1 || echo 0) + root=$([ "${is_man}" = 1 ] && echo "../../../" || echo "../") + + echo "<!DOCTYPE html>" + echo "" + echo "<html lang=\"${lang}\">" + echo "<head>" + echo " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">" + echo " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">" + echo " <title>|M|S&gt; ${section}</title>" echo " <link rel=\"stylesheet\" title=\"default\" href=\"${root}meso.css\">" echo '</head>' - echo '' - echo '<body>' - echo '<div id="menu">' - if [ "$section" == "Home" ]; then - echo ' <h2>Home</h2>' - print_home_sub_menu ${root} ${name} + echo "" + echo "<body>" + echo "<div id=\"menu\">" + if [ "${section}" = "Home" ]; then + echo " <h2>Home</h2>" + print_home_sub_menu "${root}" "${name}" else - echo " <h2><a href=${root}misc/about-fr.html>Home</a></h2>" + echo " <h2><a href=\"${root}misc/about-fr.html\">Home</a></h2>" fi - if [ "$section" == "ART" ]; then + if [ "${section}" = "ART" ]; then echo " <h2>A.R.T.</h2>" - print_art_sub_menu ${root} ${name} + print_art_sub_menu "${root}" "${name}" else - echo " <h2><a href=${root}art/art.html>A.R.T.</a></h2>" + echo " <h2><a href=\"${root}art/art.html\">A.R.T.</a></h2>" fi - if [ "$section" == "htrdr" ]; then - echo " <h2 style='font-variant: none'><code style='color: black'>htrdr</code></h2>" - print_htrdr_sub_menu ${root} ${name} + if [ "${section}" = "htrdr" ]; then + echo " <h2 style=\"font-variant: none\"><code style=\"color: black\">htrdr</code></h2>" + print_htrdr_sub_menu "${root}" "${name}" else - echo " <h2 style='font-variant: none'><code><a href=${root}htrdr/htrdr.html>htrdr</a></code></h2>" + echo " <h2 style=\"font-variant: none\"><code><a href=\"${root}htrdr/htrdr.html\">htrdr</a></code></h2>" fi - if [ "$section" == "Schiff" ]; then + if [ "${section}" = "Schiff" ]; then echo ' <h2>Schiff</h2>' - print_schiff_sub_menu ${root} ${name} + print_schiff_sub_menu "${root}" "${name}" else - echo " <h2><a href=${root}schiff/schiff.html>Schiff</a></h2>" + echo " <h2><a href=\"${root}schiff/schiff.html\">Schiff</a></h2>" fi - if [ "$section" == "Solstice" ]; then - echo ' <h2>Solstice</h2>' - print_solstice_sub_menu ${root} ${name} + if [ "${section}" = "Solstice" ]; then + echo " <h2>Solstice</h2>" + print_solstice_sub_menu "${root}" "${name}" else - echo " <h2><a href=${root}solstice/solstice.html>Solstice</a></h2>" + echo " <h2><a href=\"${root}solstice/solstice.html\">Solstice</a></h2>" fi - if [ "$section" == "Stardis" ]; then - echo ' <h2>Stardis</h2>' - print_stardis_sub_menu ${root} ${name} + if [ "${section}" = "Stardis" ]; then + echo " <h2>Stardis</h2>" + print_stardis_sub_menu "${root}" "${name}" else - echo " <h2><a href=${root}stardis/stardis.html>Stardis</a></h2>" + echo " <h2><a href=\"${root}stardis/stardis.html\">Stardis</a></h2>" fi - if [ "$section" == "Star-Engine" ]; then - echo ' <h2>Star-Engine</h2>' - print_star_engine_sub_menu ${root} ${name} + if [ "${section}" = "Star-Engine" ]; then + echo " <h2>Star-Engine</h2>" + print_star_engine_sub_menu "${root}" "${name}" else - echo " <h2><a href=${root}star-engine/star-engine.html>Star-Engine</a></h2>" + echo " <h2><a href=\"${root}star-engine/star-engine.html\">Star-Engine</a></h2>" fi - echo '<br>' # Enable CSS overflow here - echo '</div>' - echo '<div id=content>' + echo "<br>" # Enable CSS overflow here + echo "</div>" + echo "<div id=\"content\">" } print_footer() { - echo '</div>' # content - echo '<div id=footer>' - echo ' - <a rel="license" href="http://creativecommons.org/licenses/by-nd/4.0/"> - <img alt="Creative Commons License" style="border-width:0; float: left; margin-right: 1em" - src="https://i.creativecommons.org/l/by-nd/4.0/88x31.png" /> - </a>' - echo 'Copyright &#169; 2015-2022 <a href="mailto:contact@meso-star.com">|Méso|Star&gt;</a>' - echo '<br />' - echo 'This page is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nd/4.0/">Creative Commons Attribution-NoDerivatives 4.0 International License</a>.' + echo "</div>" # content + echo "<div id=\"footer\">" + echo " + <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nd/4.0/\"> + <img alt=\"Creative Commons License\" style=\"border-width:0; float: left; margin-right: 1em\" + src=\"https://i.creativecommons.org/l/by-nd/4.0/88x31.png\" /> + </a>" + echo "Copyright &#169; 2015-2022 <a href=\"mailto:contact@meso-star.com\">|Méso|Star&gt;</a>" + echo "<br>" + echo "This page is licensed under a <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nd/4.0/\">Creative Commons Attribution-NoDerivatives 4.0 International License</a>." echo "</div>" - echo '</body>' + echo "</body>" } print_downloads() { @@ -445,64 +433,69 @@ print_downloads() { windows=1 linux=1 else - windows=$([[ $2 == *Windows* ]] && echo 1 || echo 0) - linux=$([[ $2 == *Linux* ]] && echo 1 || echo 0) - fi - - echo '<table>' - echo ' <tr>' - echo ' <th>Version</th>' - [[ ! "$linux" -eq 0 ]] && echo ' <th>GNU/Linux 64-bits</th>' - [[ ! "$windows" -eq 0 ]] && echo ' <th>Windows 64-bits</th>' - echo ' <th>Sources</th>' - echo ' </tr>' - - local archs=$(find downloads/ -regex ".*/$prefix-[0-9]+.[0-9]+.[0-9]+\(-r[0-9]+\)?-[^\(Sources\)].*tar.gz" | sort -Vr ) - local arch; - for arch in $archs; do - local version=$(echo $arch | sed "s/.*${prefix}-\([0-9]\+\.[0-9]\+\.[0-9]\+\(-r[0-9]\+\)\{0,1\}\)-.*/\1/g") - local dl_files=() - - if [ "$dl_files" == *Sources* ]; then - continue + windows=0 + linux=0 + case "$2" in + Windows) windows=1;; + Linux) linux=1;; + *) ;; + esac + fi + + echo "<table>" + echo " <tr>" + echo " <th>Version</th>" + [ ! "${linux}" -eq 0 ] && echo " <th>GNU/Linux 64-bits</th>" + [ ! "${windows}" -eq 0 ] && echo " <th>Windows 64-bits</th>" + echo " <th>Sources</th>" + echo " </tr>" + + find downloads/ -regex ".*/${prefix}-[0-9]+.[0-9]+.[0-9]+\(-r[0-9]+\)?-[^\(Sources\)].*tar.gz" | sort -Vr | \ + while read -r arch; do + version=$(echo "${arch}" | sed "s/.*${prefix}-\([0-9]\+\.[0-9]\+\.[0-9]\+\(-r[0-9]\+\)\{0,1\}\)-.*/\1/g") + dl_files="" + + case "${dl_files}" in + *Sources*) continue;; + *) ;; + esac + + if [ ! "${linux}" -eq 0 ]; then + dl_files="${dl_files} downloads/${prefix}-${version}-GNU-Linux64.tar.gz" fi - - if [ ! "$linux" -eq 0 ]; then - dl_files[${#dl_files[@]}]="downloads/${prefix}-${version}-GNU-Linux64.tar.gz" - fi - if [ ! "$windows" -eq 0 ]; then - dl_files[${#dl_files[@]}]="downloads/${prefix}-${version}-Win64.zip" + if [ ! "${windows}" -eq 0 ]; then + dl_files="${dl_files} downloads/${prefix}-${version}-Win64.zip" fi if [ -f "downloads/${prefix}-${version}-Sources.zip" ]; then - dl_files[${#dl_files[@]}]="downloads/${prefix}-${version}-Sources.zip" + dl_files="${dl_files} downloads/${prefix}-${version}-Sources.zip" elif [ -f "downloads/${prefix}-${version}-Source.zip" ]; then - dl_files[${#dl_files[@]}]="downloads/${prefix}-${version}-Source.zip" + dl_files="${dl_files} downloads/${prefix}-${version}-Source.zip" elif [ -f "downloads/${prefix}-${version}-Sources.tar.gz" ]; then - dl_files[${#dl_files[@]}]="downloads/${prefix}-${version}-Sources.tar.gz" - else - dl_files[${#dl_files[@]}]="downloads/${prefix}-${version}-Source.tar.gz" + dl_files="${dl_files} downloads/${prefix}-${version}-Sources.tar.gz" + else + dl_files="${dl_files} downloads/${prefix}-${version}-Source.tar.gz" fi echo " <tr>" echo " <td>${version}</td>" - for((i=0; i < ${#dl_files[@]}; ++i)); do - local dl_file=${dl_files[$i]} + for i in $(printf "%s" "${dl_files}"); do + dl_file="${i}" echo " <td>" - if [ -f ${dl_file} ]; then - echo -n " [<a href='${dl_file}'>" - [[ "${dl_file#*tar.gz}" != "${dl_file}" ]] && echo -n "tarball" || echo -n "zip" + if [ -f "${dl_file}" ]; then + printf " [<a href=\"%s\">" "${dl_file}" + [ "${dl_file#*tar.gz}" != "${dl_file}" ] && printf "tarball" || printf "zip" echo "</a>]" fi - if [ -f ${dl_files[$i]}.sig ]; then - echo " [<a href='${dl_files[$i]}.sig'>pgp</a>]" + if [ -f "${dl_file}.sig" ]; then + echo " [<a href=\"${dl_file}.sig\">pgp</a>]" fi echo " </td>" done echo " </tr>" done - echo '</table>' + echo "</table>" } convert_man_page() { @@ -510,65 +503,65 @@ convert_man_page() { input=$2 output=$3 version=$4 - output_dir=$(dirname $output) - man_file=$(basename $input) - man_name=$(echo $man_file | sed 's/\(.*\)\.[0-7]/\1/') - man_num=$(echo $man_file | sed 's/.*\.\([0-7]\)/\1/') + output_dir=$(dirname "${output}") + man_file=$(basename "${input}") + man_name=$(echo "${man_file}" | sed 's/\(.*\)\.[0-7]/\1/') + man_num=$(echo "${man_file}" | sed 's/.*\.\([0-7]\)/\1/') - if [ ! -f "$input" ]; then - echo "Cannot find the '$input' man page." - continue + if [ ! -f "${input}" ]; then + echo "Cannot find the '${input}' man page." + return fi mkdir -p "${output_dir}" # Generate the man page - echo "Write $output" + echo "Write ${output}" { - print_header ${section} man-${man_name} - echo -n "<div style=\"font-variant: small-caps; float: right; color: #777777\">" - [ $section == "htrdr" ] \ - && echo "<code style='font-variant:none'>$section</code> $version</div>" \ - || echo "$section $version</div>"; + print_header "${section}" "man-${man_name}" + printf "<div style=\"font-variant: small-caps; float: right; color: #777777\">" + [ "${section}" = "htrdr" ] \ + && echo "<code style=\"font-variant:none\">${section}</code> ${version}</div>" \ + || echo "${section} ${version}</div>"; echo "<header>" echo " <h1>${man_name}(${man_num})</h1>"; echo "</header>" - } > $output + } > "${output}" - man2html -r $input \ + man2html -r "${input}" \ | tail -n +10 \ | sed '/^<HR>$/,$d' \ | sed '/\&nbsp;/d' \ | sed 's/<DL COMPACT>/<DL>/g' \ - >> $output + >> "${output}" - print_footer >> $output + print_footer >> "${output}" # Remove hyperlink on csplit, feh, gnuplot, sed, mmap and mpirun commands - sed -i 's/<B><A HREF="\.\.\/man1\/csplit\.1\.html">csplit<\/A><\/B>/csplit/g' $output - sed -i 's/<B><A HREF="\.\.\/man1\/feh\.1\.html">feh<\/A><\/B>/feh/g' $output - sed -i 's/<B><A HREF="\.\.\/man1\/gnuplot\.1\.html">gnuplot<\/A><\/B>/gnuplot/g' $output - sed -i 's/<B><A HREF="\.\.\/man1\/sed\.1\.html">sed<\/A><\/B>/sed/g' $output - sed -i 's/<B><A HREF="\.\.\/man1\/mpirun\.1\.html">mpirun<\/A><\/B>/mpirun/g' $output - sed -i 's/<B><A HREF="\.\.\/man2\/mmap\.2\.html">mmap<\/A><\/B>/mmap/g' $output + sed -i 's/<B><A HREF="\.\.\/man1\/csplit\.1\.html">csplit<\/A><\/B>/csplit/g' "${output}" + sed -i 's/<B><A HREF="\.\.\/man1\/feh\.1\.html">feh<\/A><\/B>/feh/g' "${output}" + sed -i 's/<B><A HREF="\.\.\/man1\/gnuplot\.1\.html">gnuplot<\/A><\/B>/gnuplot/g' "${output}" + sed -i 's/<B><A HREF="\.\.\/man1\/sed\.1\.html">sed<\/A><\/B>/sed/g' "${output}" + sed -i 's/<B><A HREF="\.\.\/man1\/mpirun\.1\.html">mpirun<\/A><\/B>/mpirun/g' "${output}" + sed -i 's/<B><A HREF="\.\.\/man2\/mmap\.2\.html">mmap<\/A><\/B>/mmap/g' "${output}" # Fix the hyperlink toward the GPLv3+ license - sed -i 's/gpl\.html\.">\(.*\).<\/A>/gpl.html">\1<\/A>./g' $output + sed -i 's/gpl\.html\.">\(.*\).<\/A>/gpl.html">\1<\/A>./g' "${output}" # Remove unexpected link on sqrt(2) - sed -i 's/<A HREF="\.\.\/man2\/sqrt\.2\.html">sqrt<\/A>/sqrt/g' $output + sed -i 's/<A HREF="\.\.\/man2\/sqrt\.2\.html">sqrt<\/A>/sqrt/g' "${output}" # Fix the man2html issues that translates the ' char in cq - sed -i "s/cq\([a-z]\)\>/'\1/g" $output + sed -i "s/cq\([a-z]\)\>/'\1/g" "${output}" } set +e if hash markdown 2> /dev/null; then - markdown=markdown + export markdown=markdown elif hash markdown2 2> /dev/null; then - markdown=markdown2 + export markdown=markdown2 elif hash markdown_py 2> /dev/null; then - markdown=markdown_py + export markdown=markdown_py else echo "Cannot find the markdown[2|_py] command" exit 1 diff --git a/misc/.gitignore b/misc/.gitignore @@ -0,0 +1,5 @@ +about-en.html +about-fr.html +legal-en.html +legal-fr.html +pgp_signatures.html diff --git a/misc/Makefile b/misc/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2021 |Meso|Star> (contact@meso-star.com) +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,18 +12,71 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +.POSIX: -SRC = pgp_signatures.html.in about-en.html.in about-fr.html.in legal-en.html.in legal-fr.html.in +include ../config.mk -.PHONY: all clean default publish -default: all +HTML=\ + about-en.html\ + about-fr.html\ + legal-en.html\ + legal-fr.html\ + pgp_signatures.html -all: ${SRC} - @bash misc.sh - -publish: - rsync -avz about.html about-fr.html about-en.html legal-fr.html legal-en.html pgp_signatures.html ${REMOTE}/misc/ +build: $(HTML) clean: - rm -rf about-en.html about-fr.html legal-en.html legal-fr.html pgp_signatures.html + @echo "Cleaning generated files" + @rm -f .chk\ + about-en.html\ + about-fr.html\ + legal-en.html\ + legal-fr.html\ + pgp_signatures.html\ + $(HTML:=.err) + +distclean: clean + +install: build + @rsync -avzrR --delete-after --progress $(HTML) $(PREFIX)/misc/ + +misc_build.sh: ../meso-menu.sh + @touch $@ + +################################################################################ +# html +################################################################################ +about-en.html: about-en.html.in misc_build.sh + @echo "Building $@" + @sh misc_build.sh about en > $@ + +about-fr.html: about-fr.html.in misc_build.sh + @echo "Building $@" + @sh misc_build.sh about fr > $@ + +legal-en.html: legal-en.html.in misc_build.sh + @echo "Building $@" + @sh misc_build.sh legal en > $@ + +legal-fr.html: legal-fr.html.in misc_build.sh + @echo "Building $@" + @sh misc_build.sh legal fr > $@ + +pgp_signatures.html: misc_build.sh + @echo "Building $@" + @sh misc_build.sh pgp > $@ + +################################################################################ +# Check files +################################################################################ +check: build .chk + @$(MAKE) -fMakefile -f .chk check_all + +check_all: check_shells $(HTML:=.chk) + +check_shells: + @echo "Checking misc_build.sh" && shellcheck -o all -x misc_build.sh +.chk: Makefile ../configure_targets.sh + @echo "Setup .chk" + @sh ../configure_targets.sh chk $(HTML) > .chk diff --git a/misc/about-en.html.in b/misc/about-en.html.in @@ -3,9 +3,6 @@ / <a href=about-fr.html>Fran&ccedil;ais</a> </div> -<header> -</header> - <div id=title> <h1>|Méso|Star&gt;</h1> <div style="font-size: 10pt">Understanding complex systems</div> diff --git a/misc/about-fr.html.in b/misc/about-fr.html.in @@ -3,9 +3,6 @@ / <span style="color: #f44d27;">Fran&ccedil;ais</span> </div> -<header> -</header> - <div id=title> <h1>|Méso|Star&gt;</h1> <div style="font-size: 10pt">Understanding complex systems</div> diff --git a/misc/misc_build.sh b/misc/misc_build.sh @@ -0,0 +1,51 @@ +#!/bin/sh -e + +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. ../meso-menu.sh + +about() +{ + if [ $# -lt 1 ]; then + printf "Usage: %s about <fr|en>\n" "$0" >&2 + exit 1 + fi + + print_header Home About "$1" + cat "about-$1.html.in" + print_footer +} + +legal() +{ + if [ $# -lt 1 ]; then + printf "Usage: %s lang <fr|en>\n" "$0" >&2 + exit 1 + fi + + print_header Home Legal "$1" + cat "legal-$1.html.in" + print_footer +} + +pgp() +{ + print_header Home PGP + cat pgp_signatures.html.in + print_footer +} + +"$@" diff --git a/schiff/.gitignore b/schiff/.gitignore @@ -0,0 +1,3 @@ +schiff.html +schiff-downloads.html +Schiff-*-GNU-Linux64/ diff --git a/schiff/Makefile b/schiff/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2021 |Meso|Star> (contact@meso-star.com) +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,22 +12,100 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +.POSIX: -SCHIFF-VERSION=0.4.2 -SCHIFF-SCRIPTS=~/code/meso-star/schiff-scripts/src/ +include ../config.mk -SRC = schiff.html.in schiff.sh -IMG = particles.png +SCHIFF_VERSION=0.4.2 +SCHIFF_DIR=Schiff-$(SCHIFF_VERSION)-GNU-Linux64 +SCHIFF_ARCH=downloads/$(SCHIFF_DIR).tar.gz +SCHIFF_README=$(SCHIFF_DIR)/share/doc/schiff/README.md +SCHIFF_PKG=\ + downloads/Schiff-0.4.2-Sources.tar.gz\ + downloads/Schiff-0.4.2-GNU-Linux64.tar.gz\ + downloads/Schiff-0.4.1-Source.tar.gz\ + downloads/Schiff-0.4.1-GNU-Linux64.tar.gz\ + downloads/Schiff-0.4.0-Source.tar.gz\ + downloads/Schiff-0.4.0-GNU-Linux64.tar.gz\ + downloads/Schiff-0.3.1-Sources.tar.gz\ + downloads/Schiff-0.3.1-GNU-Linux64.tar.gz +SCHIFF_SIG=$(SCHIFF_PKG:=.sig) + +MAN=\ + $(SCHIFF_DIR)/share/man/man1/schiff.1\ + $(SCHIFF_DIR)/share/man/man5/schiff-geometry.5\ + $(SCHIFF_DIR)/share/man/man5/schiff-output.5 -.PHONY: all clean default publish -default: all +IMG = particles.png +HTML = schiff.html schiff-downloads.html -all: ${SRC} - @bash schiff.sh ${SCHIFF-VERSION} ${SCHIFF-SCRIPTS} +build: .sig .man + @$(MAKE) -fMakefile -f .sig -f .man build_all -publish: - rsync -avzr schiff.html schiff-downloads.html ${IMG} downloads man ${REMOTE}/schiff/ +build_all: $(HTML) man clean: - rm -rf schiff.html downloads/*.sig man + @echo "Cleaning generated files" + @rm -rf man + @rm -f .sig .chk .man $(HTML) $(HTML:=.err) + +distclean: clean + @echo "Cleaning PGP signatures and extracted files" + @rm -f $(MAN) $(SCHIFF_README) $(SCHIFF_SIG) + +install: build + @rsync -avzrR --delete-after --progress \ + downloads/schiff_pretty_results.sh\ + $(HTML)\ + $(IMG)\ + $$(find man -name "*.html")\ + $(SCHIFF_PKG)\ + $(SCHIFF_SIG)\ + $(PREFIX)/schiff/ + +schiff_build.sh: ../meso-menu.sh + @touch $@ + +################################################################################ +# Overview +################################################################################ +schiff.html: schiff.html.in $(IMG) schiff_build.sh + @echo "Building $@" + @sh schiff_build.sh overview $(SCHIFF_VERSION) > $@ + +################################################################################ +# Downloads +################################################################################ +schiff-downloads.html: $(SCHIFF_SIG) $(SCHIFF_README) schiff_build.sh + @echo "Building $@" + @sh schiff_build.sh downloads $(SCHIFF_README) > $@ + +$(SCHIFF_README) $(MAN): + @echo "Extracting data from $(SCHIFF_ARCH)" + @tar -xz -f $(SCHIFF_ARCH) $(SCHIFF_README) $(MAN) + +################################################################################ +# Check files +################################################################################ +check: build .chk .sig + @$(MAKE) -fMakefile -f .chk -f .sig check_all + +check_all: check_shells $(HTML:=.chk) + +check_shells: + @echo "Checking schiff_build.sh" && shellcheck -o all -x schiff_build.sh + +################################################################################ +# Miscellaneous +################################################################################ +.sig: Makefile ../configure_targets.sh + @echo "Setup .sig" + @sh ../configure_targets.sh sig $(SCHIFF_PKG)> .sig + +.chk: Makefile ../configure_targets.sh + @echo "Setup .chk" + @sh ../configure_targets.sh chk $(HTML) > .chk +.man: Makefile ../configure_targets.sh + @echo "Setup .man" + @sh ../configure_targets.sh man Schiff $(SCHIFF_VERSION) $(MAN) > .man diff --git a/schiff/schiff.html.in b/schiff/schiff.html.in @@ -40,11 +40,6 @@ distribution describes the main shapes of the particles (sphere, cylinder, helical pipe, <i>etc.</i>) and their statistical variation according to the distribution of their parameters (gaussian, lognormal, <i>etc.</i>).</p> -<p>Schiff makes intensive use of ray-tracing. While this feature is part of -the StarEngine <a href=https://gitlab.com/meso-star/star-3d>Star3D</a> library, -it is internally powered by <a href=https://software.intel.com/sdvis>Intel® -Rendering Framework</a>: <a href=http://embree.github.io/>Embree</a>.</p> - <h2>A straight interface</h2> <div class="img" style="width: 16em"> diff --git a/schiff/schiff.sh b/schiff/schiff.sh @@ -1,134 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -set -e - -source ../meso-menu.sh - -if [ $# -lt 2 ]; then - echo "Usage: $0 VERSION SCRIPTS-PATH" - exit 1 -fi - -if [ ! -f "./downloads/Schiff-$1-GNU-Linux64.tar.gz" ]; then - echo "Cannot find .//downloads/Schiff-$1-GNU-Linux64.tar.gz" - exit 1 -fi - -dir_curr=$(pwd) # Current directory -dir_temp=$(mktemp -d) # Working directory - -################################################################################ -# Sign the package -################################################################################ -tput bold; echo ">>> Schiff packages"; tput sgr0 -archs=$(find "./downloads" -regex "^.*/Schiff-[0-9]+\.[0-9]+\.[0-9]+-.*tar.gz") - -sign_something=0 -for arch in $archs; do - if [ ! -f $arch.sig ]; then - echo "Sign $arch" - gpg -a -o $arch.sig --detach-sign $arch - sign_something=1 - fi -done - -if [ $sign_something == 0 ]; then - echo "Nothing to do" -fi - -echo "" - -################################################################################ -# Extract the current archive -################################################################################ -cd $dir_temp -arch=Schiff-$1-GNU-Linux64 -cp "$dir_curr/downloads/$arch.tar.gz" . -tar xzf $arch.tar.gz -cd $dir_curr - -################################################################################ -# Generate the release note -################################################################################ -cd $dir_temp -release_notes=$($markdown $arch/share/doc/schiff/README.md \ - | sed '/^<h2>Release notes<\/h2>/,$!d' \ - | sed '/^<h2>License<\/h2>/,$d') -cd $dir_curr - -################################################################################ -# Copy the post-process script -################################################################################ -tput bold; echo ">>> Schiff Post-Processes"; tput sgr0 -do_something=0 -if [ ! -f "./downloads/schiff_pretty_results.sh" ]; then - echo "RSync $2/schiff_pretty_results.sh" - if [ ! -f "$2/schiff_pretty_results.sh" ]; then - echo "Cannot found $2/schiff_pretty_results.sh script." - exit 1 - fi - rsync $2/schiff_pretty_results.sh "./downloads/" -fi - -if [ $do_something == 0 ]; then - echo "Nothing to do" -fi - -echo "" - -################################################################################ -# Generate the overview page -################################################################################ -tput bold; echo ">>> Schiff web pages"; tput sgr0 -echo "Write schiff.html" -{ - print_header Schiff Overview - VERSION=$1 RELEASE_NOTES="$release_notes" envsubst < schiff.html.in; - print_footer -} > schiff.html - -# Generate the Downloads page -################################################################################ -echo "Write schiff-downloads.html" -{ - print_header Schiff Downloads; - echo '<header><h1>Download Schiff</h1></header>'; - - print_downloads Schiff "Linux"; - echo $release_notes - print_footer; -} > schiff-downloads.html; - - -################################################################################ -# Generate the reference documentation -################################################################################ -cd $dir_temp -arch=Schiff-$1-GNU-Linux64 -cp "$dir_curr/downloads/$arch.tar.gz" . -tar xzf $arch.tar.gz -cd $dir_curr - -for((i=0; i<${#schiff_man_pages[@]}; ++i)); do - entry=(${schiff_man_pages[$i]}) - man_name=${entry[0]} - man_num=${entry[1]} - man_path="$dir_temp/$arch/share/man/man${entry[1]}/$man_name.$man_num" - output="man/man${entry[1]}/$man_name.$man_num.html" - convert_man_page Schiff "$man_path" "$output" $1 -done diff --git a/schiff/schiff_build.sh b/schiff/schiff_build.sh @@ -0,0 +1,50 @@ +#!/bin/sh -e + +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. ../meso-menu.sh + +overview() +{ + if [ $# -lt 1 ]; then + printf "Usage: %s overview <version>\n" "$0" >&2 + exit 1 + fi + + print_header Schiff Overview + VERSION=$1 envsubst < schiff.html.in + print_footer +} + +downloads() +{ + if [ $# -lt 1 ]; then + printf "Usage: %s downloads <readme>\n" "$0" >&2 + exit 1 + fi + + release_notes=$(${markdown} "$1" \ + | sed -n '/^<h2>Release notes<\/h2>/,/^<h2>License<\/h2>/p' | sed '$d') + + print_header Schiff Downloads + echo "<header><h1>Download Schiff</h1></header>" + + print_downloads Schiff "Linux" + echo "${release_notes}" + print_footer +} + +"$@" diff --git a/solstice/.gitignore b/solstice/.gitignore @@ -0,0 +1,7 @@ +solstice.html +solstice-downloads.html +solstice-resources.html +solstice-release-notes.html.in +solstice-pp-release-notes.html.in +Solstice-*-GNU-Linux64/ +Solstice-PP-Sources-*/ diff --git a/solstice/Makefile b/solstice/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2021 |Meso|Star> (contact@meso-star.com) +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,39 +12,156 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +.POSIX: -SOLSTICE-VERSION=0.9.1 -SOLSTICE-ABG=~/Solstice-ABG/ +include ../config.mk -IMG = themis.png -SRC = \ - solstice.html.in \ - solstice-abg.html.in \ - solstice-pp.html.in \ - solstice.sh +# Main versions to publish +SOLSTICE_VERSION=0.9.1 +SOLPP_VERSION=0.3.1 -.PHONY: all clean default publish -default: all +SOLSTICE_ARCH=downloads/Solstice-$(SOLSTICE_VERSION)-GNU-Linux64.tar.gz +SOLSTICE_DIR=Solstice-$(SOLSTICE_VERSION)-GNU-Linux64 +SOLSTICE_README=$(SOLSTICE_DIR)/share/doc/solstice/README.md +SOLPP_ARCH=downloads/Solstice-PP-Sources-$(SOLPP_VERSION).tar.gz +SOLPP_README=Solstice-PP-Sources-$(SOLPP_VERSION)/README.md -all: ${SRC} - @bash solstice.sh ${SOLSTICE-VERSION} ${SOLSTICE-ABG} +SOLPP_PKG=\ + downloads/Solstice-PP-Sources-0.3.1.tar.gz\ + downloads/Solstice-PP-Sources-0.3.0.tar.gz\ + downloads/Solstice-PP-Sources-0.2.0.tar.gz\ + downloads/Solstice-PP-Sources-0.1.0.tar.gz +SOLPP_SIG=$(SOLPP_PKG:=.sig) -publish: - rsync -avzr \ - solstice.html \ - solstice-downloads.html \ - solstice-resources.html \ - ${IMG} \ - downloads \ - man \ - ${REMOTE}/solstice/ +SOLSTICE_PKG=\ + downloads/Solstice-0.9.1-Sources.zip\ + downloads/Solstice-0.9.1-GNU-Linux64.tar.gz\ + downloads/Solstice-0.9.0-Win64.zip\ + downloads/Solstice-0.9.0-Sources.zip\ + downloads/Solstice-0.9.0-GNU-Linux64.tar.gz\ + downloads/Solstice-0.8.2-Win64.zip\ + downloads/Solstice-0.8.2-Sources.zip\ + downloads/Solstice-0.8.2-GNU-Linux64.tar.gz\ + downloads/Solstice-0.8.1-Win64.zip\ + downloads/Solstice-0.8.1-Sources.zip\ + downloads/Solstice-0.8.1-GNU-Linux64.tar.gz\ + downloads/Solstice-0.7.1-Win64.zip\ + downloads/Solstice-0.7.1-Sources.zip\ + downloads/Solstice-0.7.1-GNU-Linux64.tar.gz\ + downloads/Solstice-0.6.1-Win64.zip\ + downloads/Solstice-0.6.1-Sources.zip\ + downloads/Solstice-0.6.1-GNU-Linux64.tar.gz\ + downloads/Solstice-0.5.0-Sources.zip\ + downloads/Solstice-0.5.0-GNU-Linux64.tar.gz\ + downloads/Solstice-0.4.1-Win64.zip\ + downloads/Solstice-0.4.1-Sources.zip\ + downloads/Solstice-0.4.1-GNU-Linux64.tar.gz\ + downloads/Solstice-0.4.0-Win64.zip\ + downloads/Solstice-0.4.0-Sources.zip\ + downloads/Solstice-0.4.0-GNU-Linux64.tar.gz +SOLSTICE_SIG=$(SOLSTICE_PKG:=.sig) + +MAN=\ + $(SOLSTICE_DIR)/share/man/man1/solstice.1\ + $(SOLSTICE_DIR)/share/man/man5/solstice-input.5\ + $(SOLSTICE_DIR)/share/man/man5/solstice-output.5\ + $(SOLSTICE_DIR)/share/man/man5/solstice-receiver.5 + +IMG=themis.png +HTML=\ + solstice.html\ + solstice-downloads.html\ + solstice-resources.html + +build: .sig .man + @$(MAKE) -fMakefile -f .sig -f .man build_all + +build_all: $(HTML) man clean: - rm -rf solstice.html \ - solstice-downloads.html \ - solstice-resources.html \ - solstice-release-notes.html.in \ - solstice-pp-release-notes.html.in \ - downloads/*.sig \ - man + @echo "Cleaning generated files" + @rm -rf man + @rm -f .sig .chk .man $(HTML) $(HTML:=.err) + +distclean: clean + @echo "Cleaning PGP signatures and extracted files" + @rm -f \ + $(SOLSTICE_SIG)\ + $(SOLPP_SIG) \ + $(MAN) \ + $(SOLPP_README) \ + $(SOLSTICE_README) + +install: build + @rsync -avzrR --delete-after --progress\ + $(HTML)\ + $(IMG)\ + $(SOLSTICE_PKG)\ + $(SOLSTICE_SIG)\ + $(SOLPP_PKG)\ + $(SOLPP_SIG)\ + downloads/Solstice-ABG.pdf\ + downloads/Solstice-ABG-rsrc.zip\ + $$(find man -name "*.html")\ + $(PREFIX)/solstice/ + +solstice_build.sh: ../meso-menu.sh + @touch $@ + +################################################################################ +# Overview web page +################################################################################ +solstice.html: solstice.html.in themis.png solstice_build.sh Makefile + @echo "Building $@" + @sh solstice_build.sh overview $(SOLSTICE_VERSION) > $@ + +################################################################################ +# Downloads web page +################################################################################ +solstice-downloads.html: $(SOLSTICE_SIG) $(SOLSTICE_README) solstice_build.sh + @echo "Building $@" + @sh solstice_build.sh downloads $(SOLSTICE_README) > $@ + +$(SOLSTICE_README) $(MAN): + @echo "Extracting data from $(SOLSTICE_ARCH)" + @tar -xz -f $(SOLSTICE_ARCH) $(SOLSTICE_README) $(MAN) + +################################################################################ +# Additional resources +################################################################################ +solstice-resources.html: $(SOLPP_SIG) $(SOLPP_README) \ + solstice-abg.html.in \ + solstice-pp.html.in \ + solstice_build.sh + @echo "Building $@" + @sh solstice_build.sh resources $(SOLPP_README) $(SOLPP_VERSION) > $@ + +$(SOLPP_README): + @echo "Extracting $@ from $(SOLPP_ARCH)" + @tar -xz -f $(SOLPP_ARCH) $(SOLPP_README) + +################################################################################ +# Check files +################################################################################ +check: build .chk + @$(MAKE) -fMakefile -f .chk check_all + +check_all: check_shells $(HTML:=.chk) + +check_shells: + @echo "Checking solstice_build.sh" && shellcheck -o all -x solstice_build.sh + +################################################################################ +# Miscellaneous targets +################################################################################ +.sig: Makefile ../configure_targets.sh + @echo "Setup .sig" + @sh ../configure_targets.sh sig $(SOLSTICE_PKG) $(SOLPP_PKG) > .sig + +.chk: Makefile ../configure_targets.sh + @echo "Setup .chk" + @sh ../configure_targets.sh chk $(HTML) > .chk +.man: Makefile ../configure_targets.sh + @echo "Setup .man" + @sh ../configure_targets.sh man Solstice $(SOLSTICE_VERSION) $(MAN) > .man diff --git a/solstice/downloads/Solstice-ABG.pdf b/solstice/downloads/Solstice-ABG.pdf @@ -1 +1 @@ -#$# git-wad 96eac608c5168b9f27fbd2c04880f4bdda94ffaff926b76a83ffc0cb48f5b7cd 1008073 -\ No newline at end of file +#$# git-wad f81005149c82fd9295a58b70bdf050c770a881711a57d497603e957e8dfc9a38 1026702 +\ No newline at end of file diff --git a/solstice/solstice-abg.html.in b/solstice/solstice-abg.html.in @@ -1,4 +1,4 @@ -<h2 id=ABG>Beginner's guide</h2> +<h2 id="ABG">Beginner's guide</h2> <p> The <b>Solstice Absolute Beginner's Guide</b> is designed to introduce enough @@ -14,8 +14,8 @@ separate archive. <th>Resources</th> </tr> <tr> - <td>[<a href='downloads/Solstice-ABG.pdf'>pdf</a>]</td> - <td>[<a href='downloads/Solstice-ABG-rsrc.zip'>zip</a>]</td> + <td>[<a href="downloads/Solstice-ABG.pdf">pdf</a>]</td> + <td>[<a href="downloads/Solstice-ABG-rsrc.zip">zip</a>]</td> </tr> </table> diff --git a/solstice/solstice-pp.html.in b/solstice/solstice-pp.html.in @@ -22,16 +22,16 @@ certain conditions; refer to the <a href="https://www.gnu.org/licenses/gpl.html">license</a> for details.</p> <p>To use these tools, download the provided archive and verify its integrity -against its <a href=pgp_signatures.html>PGP signature</a>. This archive -contains the sources of the program and a GNU/Makefile to simplify the build -process on GNU/Linux and on Windows through <a +against its <a href="../misc/pgp_signatures.html">PGP signature</a>. This +archive contains the sources of the program and a GNU/Makefile to simplify the +build process on GNU/Linux and on Windows through <a href="http://www.mingw.org/">MinGW</a>. Extract it and run <code>make</code> to build the programs. Note that even though this archive targets GNU-compliant systems, the provided sources can be compiled by any C compiler that supports the C99 standard.</p> <pre class="code"> -$ tar xzvf Solstice-PP-Sources-$VERSION.tar.gz +$ tar xzvf Solstice-PP-Sources-${VERSION}.tar.gz $ cd Solstice-PP-Sources $ make </pre> @@ -74,7 +74,7 @@ regular Solstice simulation. These data are read from a file or from standard input whether a filename is provided as an argument or not, respectively. <code>solmaps</code> extracts the maps of incoming flux computed by Solstice for the receivers whose <code>per_primitive</code> flag is enabled (see <a -href=man/man5/solstice-receiver.5.html>solstice-receiver</a>(5) for more +href="man/man5/solstice-receiver.5.html">solstice-receiver</a>(5) for more informations). Each map is then saved in a specific <a href="http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf">VTK</a> file.</p> @@ -127,7 +127,7 @@ simulation results; for instance their respective cosine factor or the amount of flux that reaches a receiver and comes from them. The second output file, is another VTK file that stores the geometry of the receivers and their simulation results as their incoming flux or their efficiency. Finally, the third -file is an <a HREF="http://www.martinreddy.net/gfx/3d/OBJ.spec">OBJ</a> file +file is an <a href="http://www.martinreddy.net/gfx/3d/OBJ.spec">OBJ</a> file that stores the meshes of the miscellaneous geometries, i.e. the geometries that are neither receivers nor primary geometries. These files can then be visualised and analysed in <a href="https://www.paraview.org">Paraview</a>.</p> diff --git a/solstice/solstice.html.in b/solstice/solstice.html.in @@ -1,6 +1,6 @@ <header> <h1>Solstice - <span class=subtitle> + <span class="subtitle"> The solar plant simulation tool </span> </h1> @@ -12,9 +12,6 @@ <li>GNU/Linux: <a href="downloads/Solstice-${VERSION}-GNU-Linux64.tar.gz">tarball</a> / <a href="downloads/Solstice-${VERSION}-GNU-Linux64.tar.gz.sig">pgp</a></li> - <li>Windows: - <a href="downloads/Solstice-${VERSION}-Win64.zip">zip</a> / - <a href="downloads/Solstice-${VERSION}-Win64.zip.sig">pgp</a></li> </ul> <ul> <li>Sources: @@ -49,9 +46,10 @@ property, including the input solar spectrum and the absorption of the atmosphere, at any spectral resolution.</p> <p>Solstice makes intensive use of ray-tracing. While this feature is part of -the StarEngine <a href=https://gitlab.com/meso-star/star-3d>Star3D</a> library, -it is internally powered by <a href=https://software.intel.com/sdvis>Intel® -Rendering Framework</a>: <a href=http://embree.github.io/>Embree</a>.</p> +the StarEngine <a href="https://gitlab.com/meso-star/star-3d">Star3D</a> +library, it is internally powered by <a +href="https://software.intel.com/sdvis">Intel® Rendering Framework</a>: <a +href="http://embree.github.io/">Embree</a>.</p> <h2>A straight interface</h2> @@ -99,7 +97,7 @@ materials of the simulated solar plant.</p> <h2>Quick start</h2> <p>Get the desired archive of Solstice and verify its integrity against its <a -href=../misc/pgp_signatures.html>PGP signature</a>. Then extract it. On +href="../misc/pgp_signatures.html">PGP signature</a>. Then extract it. On Windows, open a command prompt into the Solstice bin directory and invoke the <code>solstice.exe</code> executable. You can alternatively register its directory into the <code>path</code> environment variable to expose the diff --git a/solstice/solstice.sh b/solstice/solstice.sh @@ -1,200 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -set -e - -source ../meso-menu.sh - -if [ $# -lt 2 ]; then - echo "Usage: $0 VERSION ABG-PATH" - exit 1 -fi - -if [ ! -f "./downloads/Solstice-$1-GNU-Linux64.tar.gz" ]; then - echo "Cannot find Solstice-$1-GNU-Linux64.tar.gz" - exit 1 -fi - -dir_curr=$(pwd) # Current directory -dir_temp=$(mktemp -d) # Working directory - -################################################################################ -# Generate the Solstice-ABG -################################################################################ -tput bold; echo ">>> Solstice Absolute Beginner's Guide"; tput sgr0 -do_something=0 -if [ ! -f downloads/Solstice-ABG.pdf ]; then - do_something=1 - ABG=guide - echo "Generate the Solstice Absolute Beginner's Guide" - if [ ! -f "$2/guide.tex" ]; then - echo "Cannot found the Latex sources of the Solstice ABG." - exit 1 - fi - cd $2 - { - pdflatex $ABG.tex; - bibtex $ABG; - pdflatex $ABG.tex; - pdflatex $ABG.tex; - } 1> /dev/null - cp $ABG.pdf $dir_curr/downloads/Solstice-ABG.pdf - cd $dir_curr -fi - -if [ ! -f downloads/Solstice-ABG-rsrc.zip ]; then - do_something=1 - echo "Archive the resources of the Solstice Absolute Beginner's Guide" - cd $2 - zip -r $dir_curr/downloads/Solstice-ABG-rsrc.zip source_files/* - cd $dir_curr -fi - -if [ $do_something == 0 ]; then - echo "Nothing to do" -fi - -echo "" - -################################################################################ -# Sign the package -################################################################################ -tput bold; echo ">>> Solstice packages"; tput sgr0 -archs=$(find downloads -regex "^.*/Solstice-[0-9]+\.[0-9]+\.[0-9]+-.*zip" \ - -o -regex "^.*/Solstice-[0-9]+\.[0-9]+\.[0-9]+-.*tar.gz" \ - -o -regex "^.*/Solstice-PP-Sources-.*\.tar.gz") -sign_something=0 -for arch in $archs; do - if [ ! -f $arch.sig ]; then - echo "Sign $arch" - gpg -a -o $arch.sig --detach-sign $arch - sign_something=1 - fi -done - -if [ $sign_something == 0 ]; then - echo "Nothing to do" -fi - -echo "" - -################################################################################ -# Generate the HTML code of the solstice release notes -################################################################################ -tput bold; echo ">>> Solstice web pages"; tput sgr0 -echo "Generate the release notes" -cd $dir_temp -arch=Solstice-$1-GNU-Linux64 -cp $dir_curr/downloads/$arch.tar.gz . -gunzip $arch.tar.gz -tar xf $arch.tar -$markdown $arch/share/doc/solstice/README.md \ - | sed '/^<h2>Release notes<\/h2>/,$!d' \ - | sed '/^<h2>License<\/h2>/,$d' \ - > $dir_curr/solstice-release-notes.html.in -cd $dir_curr - -################################################################################ -# Generate the overview page -################################################################################ -echo "Write solstice.html" -{ - print_header Solstice Overview; - VERSION=$1 envsubst < solstice.html.in; - print_footer; -} > solstice.html - -################################################################################ -# Generate the Downloads page -################################################################################ -echo "Write solstice-downloads.html" -{ - print_header Solstice Downloads; - echo '<header><h1>Download Solstice</h1></header>'; - print_downloads Solstice; - cat solstice-release-notes.html.in; - print_footer; -} > solstice-downloads.html; - -################################################################################ -# Generate he additionnal resources page -################################################################################ -print_pp_downloads() { - echo '<table>' - echo ' <tr>' - echo ' <th>Version</th>' - echo ' <th>Sources</th>' - echo ' </tr>' - - local archs=$(find downloads -regex ".*/Solstice-PP-Sources-.*\.tar.gz" | sort -r ) - local arch; - - for arch in $archs; do - local version=$(echo $arch | sed "s/.*Solstice-PP-Sources-\(.*\)\.tar.gz/\1/g") - - echo " <tr>" - echo " <td>${version}</td>" - echo " <td>" - echo " [<a href='${arch}'>tarball</a>]" - if [ -f $arch.sig ]; then - echo " [<a href='$arch.sig'>pgp</a>]" - fi - echo " </td>" - echo " </tr>" - done - echo '</table>' -} - -solpp_arch=$(cd downloads; find -regex ".*/Solstice-PP-Sources-.*\.tar.gz$" | sort -r | head -n 1) -solpp_prefix=$(echo $solpp_arch | sed 's/\.tar\.gz$//g') -solpp_version=$(echo $solpp_prefix | sed 's/.*\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/g') - -echo "Generate the release notes of the Solstice PP" -cd $dir_temp -cp $dir_curr/downloads/$solpp_arch ./ -tar xzf $solpp_arch -$markdown $solpp_prefix/README.md \ - | sed '/^<h2>Release notes<\/h2>/,$!d' \ - | sed '/^<h2>License<\/h2>/,$d' \ - | sed '/^<h2>Release notes<\/h2>/d' \ - | sed 's/\<h3\>/h4/g' \ - > $dir_curr/solstice-pp-release-notes.html.in -cd $dir_curr - -echo "Write solstice-resources.html" -{ - print_header Solstice Resources; - echo "<header><h1>Additional resources</h1></header>" - cat solstice-abg.html.in - VERSION=$solpp_version envsubst < solstice-pp.html.in - echo "<h3>Download Post-Processes</h3>" - print_pp_downloads - cat solstice-pp-release-notes.html.in - print_footer; -} > solstice-resources.html - -################################################################################ -# Generate the reference documentation -################################################################################ -for((i=0; i<${#solstice_man_pages[@]}; ++i)); do - entry=(${solstice_man_pages[$i]}) - man_name=${entry[0]} - man_num=${entry[1]} - man_path=$dir_temp/$arch/share/man/man${entry[1]}/$man_name.$man_num - output=man/man${entry[1]}/$man_name.$man_num.html - convert_man_page Solstice "$man_path" "$output" $1 -done diff --git a/solstice/solstice_build.sh b/solstice/solstice_build.sh @@ -0,0 +1,99 @@ +#!/bin/sh -e + +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. ../meso-menu.sh + +# Build the overview page +overview() +{ + if [ $# -lt 1 ]; then + printf "Usage: %s overview <version>\n" "$0" >&2 + exit 1 + fi + + print_header Solstice Overview + VERSION=$1 envsubst < solstice.html.in + print_footer +} + +# Build the downloads page +downloads() +{ + if [ $# -lt 1 ]; then + printf "Usage: %s downloads <readme>\n" "$0" >&2 + exit 1 + fi + + release_notes=$(${markdown} "$1" \ + | sed -n '/^<h2>Release notes<\/h2>/,/^<h2>License<\/h2>/p' | sed '$d') + + print_header Solstice Downloads + echo "<header><h1>Download Solstice</h1></header>" + print_downloads Solstice + echo "${release_notes}" + print_footer +} + +print_pp_downloads() +{ + echo "<table>" + echo " <tr>" + echo " <th>Version</th>" + echo " <th>Sources</th>" + echo " </tr>" + + + find downloads -regex ".*/Solstice-PP-Sources-.*\.tar.gz" | sort -r | \ + while read -r i; do + version=$(echo "${i}" | sed "s/.*Solstice-PP-Sources-\(.*\)\.tar.gz/\1/g") + + echo " <tr>" + echo " <td>${version}</td>" + echo " <td>" + echo " [<a href=\"${i}\">tarball</a>]" + if [ -f "${i}.sig" ]; then + echo " [<a href=\"${i}.sig\">pgp</a>]" + fi + echo " </td>" + echo " </tr>" + done + echo '</table>' +} + +# Build the resources page +resources() +{ + if [ $# -lt 2 ]; then + printf "Usage: %s resources <solpp-readme> <solpp-version>\n" "$0" >&2 + exit 1 + fi + + solpp_release_notes=$(${markdown} "$1" \ + | sed -n '/^<h2>Release notes<\/h2>/,/^<h2>License<\/h2>/p' \ + | sed -e '$d' -e 's/\<h3\>/h4/g') + + print_header Solstice Resources + echo "<header><h1>Additional resources</h1></header>" + cat solstice-abg.html.in + VERSION=$2 envsubst < solstice-pp.html.in + echo "<h3>Download Post-Processes</h3>" + print_pp_downloads + echo "${solpp_release_notes}" + print_footer +} + +"$@" diff --git a/star-engine/.gitignore b/star-engine/.gitignore @@ -0,0 +1,11 @@ +star-engine.html +star-engine-downloads.html +star-engine-release-notes.html.in +star-2d.html +star-3d.html +star-geom.html +star-sf.html +star-sp.html +star-uvm.html +star-vx.html +Star-Engine-*-GNU-Linux64/ diff --git a/star-engine/Makefile b/star-engine/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2021 |Meso|Star> (contact@meso-star.com) +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,41 +12,218 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +.POSIX: -STAR-ENGINE-VERSION=0.14.0 -STAR-ENGINE-README=~/code/star-engine/README.md - -SRC = star-engine.sh star-engine.html.in - -.PHONY: all clean default publish -default: all - -all: ${SRC} - @bash star-engine.sh $(STAR-ENGINE-VERSION) $(STAR-ENGINE-README) - -publish: - rsync -avzr \ - star-engine.html \ - star-engine-downloads.html \ - star-2d.html \ - star-3d.html \ - star-geom.html \ - star-sf.html \ - star-sp.html \ - star-uvm.html \ - star-vx.html \ - downloads \ - octree.jpg \ - polar.svg \ - cumulative.svg \ - super_shape.jpg \ - foam.jpg \ - ${REMOTE}/star-engine/ +include ../config.mk + +STAR_ENGINE_VERSION=0.14.0 +STAR_ENGINE_DIR=Star-Engine-$(STAR_ENGINE_VERSION)-GNU-Linux64 +STAR_ENGINE_ARCH=downloads/$(STAR_ENGINE_DIR).tar.gz + +STAR_2D_HEADER=$(STAR_ENGINE_DIR)/include/star/s2d_version.h +STAR_3D_HEADER=$(STAR_ENGINE_DIR)/include/star/s3d_version.h +STAR_SP_HEADER=$(STAR_ENGINE_DIR)/include/star/ssp_version.h +STAR_SF_HEADER=$(STAR_ENGINE_DIR)/include/star/ssf_version.h +STAR_VX_HEADER=$(STAR_ENGINE_DIR)/include/star/svx_version.h +STAR_UVM_HEADER=$(STAR_ENGINE_DIR)/include/star/suvm_version.h +STAR_GEOM_HEADER=\ + $(STAR_ENGINE_DIR)/include/aw_version.h\ + $(STAR_ENGINE_DIR)/include/star/s3daw_version.h\ + $(STAR_ENGINE_DIR)/include/star/s3dstl_version.h\ + $(STAR_ENGINE_DIR)/include/star/s3dut_version.h\ + $(STAR_ENGINE_DIR)/include/star/sstl_version.h +STAR_ENGINE_HEADERS=\ + $(STAR_2D_HEADER)\ + $(STAR_3D_HEADER)\ + $(STAR_SP_HEADER)\ + $(STAR_SF_HEADER)\ + $(STAR_VX_HEADER)\ + $(STAR_UVM_HEADER)\ + $(STAR_GEOM_HEADER) + +STAR_2D_README=$(STAR_ENGINE_DIR)/share/doc/star-2d/README.md +STAR_3D_README=$(STAR_ENGINE_DIR)/share/doc/star-3d/README.md +STAR_SP_README=$(STAR_ENGINE_DIR)/share/doc/star-sp/README.md +STAR_SF_README=$(STAR_ENGINE_DIR)/share/doc/star-sf/README.md +STAR_VX_README=$(STAR_ENGINE_DIR)/share/doc/star-vx/README.md +STAR_UVM_README=$(STAR_ENGINE_DIR)/share/doc/star-uvm/README.md +STAR_ENGINE_README=$(STAR_ENGINE_DIR)/share/doc/star-engine/README.md +STAR_ENGINE_READMES=\ + $(STAR_2D_README)\ + $(STAR_3D_README)\ + $(STAR_SP_README)\ + $(STAR_SF_README)\ + $(STAR_VX_README)\ + $(STAR_UVM_README)\ + $(STAR_ENGINE_README) + +STAR_ENGINE_PKG=\ + downloads/Star-Engine-0.14.0-Sources.zip\ + downloads/Star-Engine-0.14.0-GNU-Linux64.tar.gz\ + downloads/Star-Engine-0.13.0-Sources.zip\ + downloads/Star-Engine-0.13.0-GNU-Linux64.tar.gz\ + downloads/Star-Engine-0.12.0-Sources.zip\ + downloads/Star-Engine-0.12.0-GNU-Linux64.tar.gz\ + downloads/Star-Engine-0.11.0-Sources.zip\ + downloads/Star-Engine-0.11.0-GNU-Linux64.tar.gz\ + downloads/Star-Engine-0.10.0-Sources.zip\ + downloads/Star-Engine-0.10.0-GNU-Linux64.tar.gz\ + downloads/Star-Engine-0.9.0-Sources.zip\ + downloads/Star-Engine-0.9.0-GNU-Linux64.tar.gz\ + downloads/Star-Engine-0.8.1-Win64.zip\ + downloads/Star-Engine-0.8.1-Sources.zip\ + downloads/Star-Engine-0.8.1-GNU-Linux64.tar.gz\ + downloads/Star-Engine-0.8.0-Win64.zip\ + downloads/Star-Engine-0.8.0-Sources.zip\ + downloads/Star-Engine-0.8.0-GNU-Linux64.tar.gz\ + downloads/Star-Engine-0.7.0-Sources.zip\ + downloads/Star-Engine-0.7.0-GNU-Linux64.tar.gz\ + downloads/Star-Engine-0.6.0-Win64.zip\ + downloads/Star-Engine-0.6.0-Sources.zip\ + downloads/Star-Engine-0.6.0-GNU-Linux64.tar.gz\ + downloads/Star-Engine-0.5.1-Win64.zip\ + downloads/Star-Engine-0.5.1-Sources.zip\ + downloads/Star-Engine-0.5.1-GNU-Linux64.tar.gz +STAR_ENGINE_SIG=$(STAR_ENGINE_PKG:=.sig) + +IMG=\ + foam.jpg\ + cumulative.svg\ + polar.svg\ + octree.jpg\ + super_shape.jpg + +HTML=\ + star-engine.html\ + star-engine-downloads.html\ + star-2d.html\ + star-3d.html\ + star-sp.html\ + star-sf.html\ + star-vx.html\ + star-uvm.html\ + star-geom.html + +build: .sig + @$(MAKE) -fMakefile -f .sig build_all + +build_all: $(HTML) clean: - rm \ - star-engine.html \ - star-engine-downloads.html \ - star-engine-release-notes.html.in \ - downloads/*.sig + @echo "Cleaning generated files" + @rm -f $(HTML) $(HTML:=.err) .sig .chk + +distclean: clean + @echo "Cleaning PGP signatures" + @rm -f $(STAR_ENGINE_SIG) + +install: build + @rsync -avzrR --delete-after --progress \ + $(HTML)\ + $(IMG)\ + $(STAR_ENGINE_PKG)\ + $(STAR_ENGINE_SIG)\ + $(PREFIX)/star-engine/ + +star_engine_build.sh: ../meso-menu.sh + @touch "$@" + +################################################################################ +# html +################################################################################ +star-engine.html: star-engine.html.in star_engine_build.sh Makefile + @echo "Building $@" + @sh star_engine_build.sh overview $(STAR_ENGINE_VERSION) > $@ + +star-engine-downloads.html:\ + $(STAR_ENGINE_SIG)\ + $(STAR_ENGINE_README)\ + star_engine_build.sh + @echo "Building $@" + @sh star_engine_build.sh downloads $(STAR_ENGINE_README) > $@ + +star-2d.html:\ + star-2d.html.in\ + $(STAR_2D_HEADER)\ + $(STAR_2D_README)\ + star_engine_build.sh + @echo "Building $@" + @sh star_engine_build.sh component Star-2D $(STAR_2D_README) $(STAR_2D_HEADER) > $@ + +star-3d.html:\ + star-3d.html.in\ + $(STAR_3D_HEADER)\ + $(STAR_3D_README)\ + star_engine_build.sh\ + foam.jpg + @echo "Building $@" + @sh star_engine_build.sh component Star-3D $(STAR_3D_README) $(STAR_3D_HEADER) > $@ + +star-sp.html:\ + star-sp.html.in\ + $(STAR_SP_HEADER)\ + $(STAR_SP_README)\ + star_engine_build.sh \ + cumulative.svg + @echo "Building $@" + @sh star_engine_build.sh component Star-SP $(STAR_SP_README) $(STAR_SP_HEADER) > $@ + +star-sf.html:\ + star-sf.html.in\ + $(STAR_SF_HEADER)\ + $(STAR_SF_README)\ + star_engine_build.sh\ + polar.svg + @echo "Building $@" + @sh star_engine_build.sh component Star-SF $(STAR_SF_README) $(STAR_SF_HEADER) > $@ + +star-vx.html:\ + star-vx.html.in\ + $(STAR_VX_HEADER)\ + $(STAR_VX_README)\ + star_engine_build.sh\ + octree.jpg + @echo "Building $@" + @sh star_engine_build.sh component Star-VX $(STAR_VX_README) $(STAR_VX_HEADER) > $@ + +star-uvm.html:\ + star-uvm.html.in\ + $(STAR_UVM_HEADER)\ + $(STAR_2D_README)\ + star_engine_build.sh + @echo "Building $@" + @sh star_engine_build.sh component Star-UVM $(STAR_UVM_README) $(STAR_UVM_HEADER) > $@ + +star-geom.html:\ + star-geom.html.in\ + $(STAR_GEOM_HEADER)\ + star_engine_build.sh\ + super_shape.jpg + @echo "Building $@" + @sh star_engine_build.sh star_geom $(STAR_GEOM_HEADER) > $@ + +$(STAR_ENGINE_HEADERS) $(STAR_ENGINE_READMES): + @echo "Extracting data from $(STAR_ENGINE_ARCH)" + @tar -xz -f $(STAR_ENGINE_ARCH) $(STAR_ENGINE_HEADERS) $(STAR_ENGINE_READMES) + +################################################################################ +# Check files +################################################################################ +check: build .chk + @$(MAKE) -fMakefile -f .chk check_all + +check_all: check_shells $(HTML:=.chk) + +check_shells: + @echo "Checking star_engine_build.sh" && shellcheck -o all -x star_engine_build.sh + +################################################################################ +# Miscellaneous targets +################################################################################ +.sig: Makefile ../configure_targets.sh + @echo "Setup .sig" + @sh ../configure_targets.sh sig $(STAR_ENGINE_PKG) > .sig +.chk: Makefile ../configure_targets.sh + @echo "Setup .chk" + @sh ../configure_targets.sh chk $(HTML) > .chk diff --git a/star-engine/downloads/Star-Engine-0.14.0-GNU-Linux64.tar.gz b/star-engine/downloads/Star-Engine-0.14.0-GNU-Linux64.tar.gz @@ -1 +1 @@ -#$# git-wad 3879bd951081f4f9cd38017c09c7ad54cf244a4b8757e854caad3b07b59ba83f 20328503 -\ No newline at end of file +#$# git-wad 230fded72ef5c275e6db48633bc31778d639b827c74088bb95d9322fc292f725 20333681 +\ No newline at end of file diff --git a/star-engine/downloads/Star-Engine-0.14.0-Sources.zip b/star-engine/downloads/Star-Engine-0.14.0-Sources.zip @@ -1 +1 @@ -#$# git-wad a6115989e7ffde829bd9c40c7dd2a331ef715a1bbf47889f8068fd42ed90b9dc 1300014 -\ No newline at end of file +#$# git-wad 3c61de881aaff2f511b2c341c5b9eff547c796c687fcebe48e19a502615bc162 1300014 +\ No newline at end of file diff --git a/star-engine/star-engine.sh b/star-engine/star-engine.sh @@ -1,163 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -set -e - -source ../meso-menu.sh - -if [ $# -lt 2 ]; then - echo "Usage: $0 VERSION STAR-ENGINE-README" - exit 1 -fi - -if [ ! -f "./downloads/Star-Engine-$1-GNU-Linux64.tar.gz" ]; then - echo "Cannot find Star-Engine-$1-GNU-Linux64.tar.gz" - exit 1 -fi - -if [ ! -f "$2" ]; then - echo "Cannot find $2" - exit 1 -fi - -dir_curr=$(pwd) # Current directory -dir_temp=$(mktemp -d) # Working directory - -################################################################################ -# Sign the package -################################################################################ -tput bold; echo ">>> Star-Engine packages"; tput sgr0 -archs=$(find downloads -regex "^.*/Star-Engine-[0-9]+\.[0-9]+\.[0-9]+-.*zip" \ - -o -regex "^.*/Star-Engine-[0-9]+\.[0-9]+\.[0-9]+-.*tar.gz") - -sign_something=0 -for arch in $archs; do - if [ ! -f $arch.sig ]; then - echo "Sign $arch" - gpg -a -o $arch.sig --detach-sign $arch - sign_something=1 - fi -done - -if [ $sign_something == 0 ]; then - echo "Nothing to do" -fi - -echo "" - -################################################################################ -# Genrate the HTML code of the star-engine release notes -################################################################################ -tput bold; echo ">>> Star-Engine web pages"; tput sgr0 -echo "Generate the release notes" -$markdown $2 \ - | sed '/^<h2>Release notes<\/h2>/,$!d' \ - | sed '/^<h2>Licenses<\/h2>/,$d' \ - > star-engine-release-notes.html.in - -################################################################################ -# Extract the current archive -################################################################################ -cd $dir_temp -arch=Star-Engine-$1-GNU-Linux64 -cp "$dir_curr/downloads/$arch.tar.gz" . -tar xzf $arch.tar.gz -cd $dir_curr - -################################################################################ -# Generate the overview page -################################################################################ -unset win -if [ -f downloads/Star-Engine-$1-Win64.zip ]; then - win="<li>Windows: \ -<a href="downloads/Star-Engine-$1-Win64.zip">zip</a> / \ -<a href="downloads/Star-Engine-$1-Win64.zip.sig">pgp</a></li></ul><ul>" -fi - -echo "Write star-engine.html" -{ - print_header Star-Engine Overview - WINDOWS=$(echo $win) VERSION=$1 envsubst < star-engine.html.in - print_footer -} > star-engine.html - -################################################################################ -# Generate the components pages -################################################################################ -components=( - "Star-2D star/s2d_version.h" - "Star-3D star/s3d_version.h" - "Star-SP star/ssp_version.h" - "Star-SF star/ssf_version.h" - "Star-UVM star/suvm_version.h" - "Star-VX star/svx_version.h") - -print_version() { - local header=$1 - local major=$(cat $dir_temp/$arch/include/$header | sed -n 's/.*MAJOR \(.*\)$/\1/1p') - local minor=$(cat $dir_temp/$arch/include/$header | sed -n 's/.*MINOR \(.*\)$/\1/1p') - local patch=$(cat $dir_temp/$arch/include/$header | sed -n 's/.*PATCH \(.*\)$/\1/1p') - [[ $patch == "0" ]] && echo $major.$minor || echo $major.$minor.$patch -} - -for ((i=0; i< ${#components[@]}; ++i)); do - entry=(${components[$i]}) - entry_low=$(echo ${entry[0]} | tr '[:upper:]' '[:lower:]') - - release_notes=$($markdown $dir_temp/$arch/share/doc/$entry_low/README.md \ - | sed '/^<h2>Release notes<\/h2>/,$!d' \ - | sed 's/opyright (C)/opyright \&#169;/g') - version=$(print_version ${entry[1]}) - - echo "Write $entry_low.html" - { - print_header Star-Engine ${entry[0]} - VERSION=$version RELEASE_NOTES="$release_notes" LICENSE='$licence' envsubst < $entry_low.html.in; - print_footer - } > $entry_low.html -done - - -aw_version=$(print_version aw_version.h) -s3daw_version=$(print_version star/s3daw_version.h) -s3dstl_version=$(print_version star/s3dstl_version.h) -s3dut_version=$(print_version star/s3dut_version.h) -sstl_version=$(print_version star/sstl_version.h) - -echo "Write star-geom.html" -{ - print_header Star-Engine Star-Geom - AW_VERSION=$aw_version \ - S3DAW_VERSION=$s3daw_version \ - S3DSTL_VERSION=$s3dstl_version \ - S3DUT_VERSION=$s3dut_version \ - SSTL_VERSION=$sstl_version \ - envsubst < star-geom.html.in; - print_footer -} > star-geom.html - -################################################################################ -# Generate the Downloads page -################################################################################ -echo "Write star-engine-downloads.html" -{ - print_header Star-Engine Downloads; - echo '<header><h1>Download Star-Engine</h1></header>'; - print_downloads Star-Engine; - cat star-engine-release-notes.html.in; - print_footer; -} > star-engine-downloads.html; diff --git a/star-engine/star-vx.html.in b/star-engine/star-vx.html.in @@ -37,7 +37,7 @@ the leaf (the user data) to the root of the tree. </div> -The policies used to merge input data as well as the merge operator itself are +<p>The policies used to merge input data as well as the merge operator itself are defined by the caller; Star-VoXel settles for building the hierarchical structure only.</p> diff --git a/star-engine/star_engine_build.sh b/star-engine/star_engine_build.sh @@ -0,0 +1,128 @@ +#!/bin/sh -e + +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. ../meso-menu.sh + +overview() +{ + if [ $# -lt 1 ]; then + printf "Usage: %s overview <version>\n" "$0" + exit 1 + fi + + unset win + if [ -f "downloads/Star-Engine-$1-Win64.zip" ]; then + win="<li>Windows: \ + <a href=\"downloads/Star-Engine-$1-Win64.zip\">zip</a> / \ + <a href=\"downloads/Star-Engine-$1-Win64.zip.sig\">pgp</a></li></ul><ul>" + fi + + print_header Star-Engine Overview + WINDOWS="${win}" VERSION="$1" envsubst < star-engine.html.in + print_footer +} + +downloads() +{ + if [ $# -lt 1 ]; then + printf "Usage: %s downloads <readme>\n" "$0" + exit 1 + fi + + release_notes=$(${markdown} "$1" | \ + sed -n '/^<h2>Release notes<\/h2>/,/^<h2>Licenses<\/h2>/p' | sed '$d') + + print_header Star-Engine Downloads + echo "<header><h1>Download Star-Engine</h1></header>" + print_downloads Star-Engine + echo "${release_notes}" + print_footer +} + +header_version() +{ + header=$1 + major=$(sed -n 's/.*MAJOR \(.*\)$/\1/1p' < "${header}") + minor=$(sed -n 's/.*MINOR \(.*\)$/\1/1p' < "${header}") + patch=$(sed -n 's/.*PATCH \(.*\)$/\1/1p' < "${header}") + [ "${patch}" = "0" ] && echo "${major}.${minor}" || echo "${major}.${minor}.${patch}" +} + +component() +{ + if [ $# -lt 3 ]; then + printf "Usage: %s component <section> <readme> <header>\n" "$0" + exit 1 + fi + + section_lower=$(echo "$1" | tr "[:upper:]" "[:lower:]") + + release_notes=$(${markdown} "$2" \ + | sed -n '/^<h2>Release notes<\/h2>/,$p' \ + | sed 's/opyright (C)/opyright \&#169;/g') + + print_header Star-Engine "$1" + version=$(header_version "$3") + + VERSION="${version}" \ + RELEASE_NOTES="${release_notes}" \ + envsubst < "${section_lower}.html.in" + + print_footer +} + +star_geom() +{ + if [ $# -lt 5 ]; then + printf "Usage: %s star_geom <aw_version.h> <s3daw_version.h> \ + <s3dstl_version.h> <s3dut_version.h> <sstl_version.h>\n" "$0" + exit 1 + fi + + unset aw_version s3daw_version s3dstl_version s3dut_version sstl_version + for i in "$@"; do + case "${i}" in + *s3daw_version\.h) s3daw_version=$(header_version "${i}") ;; + *aw_version\.h) aw_version=$(header_version "${i}") ;; + *s3dstl_version\.h) s3dstl_version=$(header_version "${i}") ;; + *s3dut_version\.h) s3dut_version=$(header_version "${i}") ;; + *sstl_version\.h) sstl_version=$(header_version "${i}") ;; + *) printf "%s:star_geom: invalid argument \"%s\"" "$0" "${i}" >&2 ;; + esac + done + + if [ -z "${aw_version}" ] \ + || [ -z "${s3daw_version}" ] \ + || [ -z "${s3dstl_version}" ] \ + || [ -z "${s3dut_version}" ] \ + || [ -z "${sstl_version}" ]; then + printf "%s:star_geom: some submitted headers are invalid " "${0}" + echo "$@" + exit 1 + fi + + print_header Star-Engine Star-Geom + AW_VERSION="${aw_version}" \ + S3DAW_VERSION="${s3daw_version}" \ + S3DSTL_VERSION="${s3dstl_version}" \ + S3DUT_VERSION="${s3dut_version}" \ + SSTL_VERSION="${sstl_version}" \ + envsubst < star-geom.html.in; + print_footer +} + +"$@" diff --git a/stardis/.gitignore b/stardis/.gitignore @@ -0,0 +1,10 @@ +consortium*.html +stardis.html +stardis-downloads.html +starter-pack.html +stardis-release-notes.html.in +stardis-solver-release-notes.html.in +stardis-green-release-notes.html.in +starter-pack.html +Stardis-*-GNU-Linux64/ +Stardis-Starter-Pack-*/ diff --git a/stardis/Makefile b/stardis/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2021 |Meso|Star> (contact@meso-star.com) +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -12,36 +12,186 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +.POSIX: -STARDIS-VERSION=0.12.3 -STARDIS-STARTER-PACK-VERSION=0.1.0 - -SRC = stardis.html.in -IMG = \ - city.jpg \ - edf_logo.svg \ - foam.jpg \ - foam_path.jpg \ - heatsink.jpg \ - heatsinkx50.jpg \ - heatsink_anim.gif \ - heatsink_anim_thumb.gif \ - IR_animation_1080x720x32x128.gif \ - IR_animation_1080x720x32x128_thumb.gif \ - IR_city_640x480x1024_273-275.png \ - IR_rendering_1080x720x128.jpg \ - pulse.svg \ - sin.svg \ - step.svg - -.PHONY: all clean default publish -default: all - -all: ${SRC} - @bash stardis.sh ${STARDIS-VERSION} ${STARDIS-STARTER-PACK-VERSION} +include ../config.mk + +STARDIS_VERSION=0.12.3 +STARTER_PACK_VERSION=0.1.0 + +STARDIS_DIR=Stardis-$(STARDIS_VERSION)-GNU-Linux64 +STARDIS_ARCH=downloads/$(STARDIS_DIR).tar.gz +STARDIS_README=$(STARDIS_DIR)/share/doc/stardis/README.md +STARDIS_GREEN_README=$(STARDIS_DIR)/share/doc/sgreen/README.md +STARDIS_SOLVER_README=$(STARDIS_DIR)/share/doc/stardis-solver/README.md +STARDIS_PKG=\ + ./downloads/Stardis-0.11.0-r1-Sources.tar.gz\ + ./downloads/Stardis-0.11.0-r1-GNU-Linux64.tar.gz\ + ./downloads/Stardis-0.12.3-Sources.tar.gz\ + ./downloads/Stardis-0.12.3-GNU-Linux64.tar.gz +STARDIS_SIG=$(STARDIS_PKG:=.sig) + +STARTER_PACK_DIR=Stardis-Starter-Pack-$(STARTER_PACK_VERSION) +STARTER_PACK_ARCH=downloads/$(STARTER_PACK_DIR).tar.gz +STARTER_PACK_README=$(STARTER_PACK_DIR)/README.md +STARTER_PACK_PKG=\ + ./downloads/Stardis-Starter-Pack-0.1.0.tar.gz\ + ./downloads/Stardis-Starter-Pack-0.0.0.tar.gz +STARTER_PACK_SIG=$(STARTER_PACK_PKG:=.sig) + +MAN=\ + $(STARDIS_DIR)/share/man/man1/stardis.1\ + $(STARDIS_DIR)/share/man/man5/stardis-input.5\ + $(STARDIS_DIR)/share/man/man5/stardis-output.5\ + $(STARDIS_DIR)/share/man/man1/sgreen.1\ + $(STARDIS_DIR)/share/man/man5/sgreen-input.5\ + $(STARDIS_DIR)/share/man/man5/sgreen-output.5 +STARDIS_ARCH_FILES=\ + $(STARDIS_README)\ + $(STARDIS_GREEN_README)\ + $(STARDIS_SOLVER_README)\ + $(MAN) + +OVERVIEW_IMG=\ + foam_path.jpg\ + heatsink_anim.gif\ + heatsink_anim_thumb.gif\ + pulse.svg\ + sin.svg\ + step.svg + +STARTER_PACK_IMG=\ + city.jpg\ + foam.jpg\ + heatsink.jpg\ + heatsinkx50.jpg\ + IR_rendering_1080x720x128.jpg\ + IR_animation_1080x720x32x128.gif\ + IR_animation_1080x720x32x128_thumb.gif\ + IR_city_640x480x1024_273-275.png + +HTML=\ + consortium-fr.html\ + consortium-en.html\ + stardis.html\ + stardis-downloads.html\ + starter-pack.html + +build: .sig .man + @$(MAKE) -fMakefile -f .sig -f .man build_all + +build_all: $(HTML) man clean: - rm stardis.html + @echo "Cleaning generated files" + @rm -rf man + @rm -f .sig .man .chk\ + stardis-release-notes.html.in\ + stardis-green-release-notes.html.in\ + stardis-solver-release-notes.html.in\ + $(HTML)\ + $(HTML:=.err) + +distclean: clean + @echo "Cleaning PGP signatures and extracted files" + @rm -f \ + $(STARDIS_SIG)\ + $(STARTER_PACK_SIG)\ + $(STARDIS_ARCH_FILES)\ + $(STARTER_PACK_README) + +install: build + @rsync -avzrR --delete-after --progress\ + $(HTML)\ + $(OVERVIEW_IMG)\ + $(STARTER_PACK_IMG)\ + $(STARDIS_PKG)\ + $(STARDIS_SIG)\ + $(STARTER_PACK_PKG)\ + $(STARTER_PACK_SIG)\ + $$(find man -name "*.html")\ + $(PREFIX)/stardis/ + +stardis_build.sh: ../meso-menu.sh + @touch $@ + +################################################################################ +# Stardis web page +################################################################################ +stardis.html: \ + stardis.html.in \ + $(OVERVIEW_IMG) \ + stardis_build.sh \ + Makefile + @echo "Building $@" + @sh stardis_build.sh overview $(STARDIS_VERSION) > $@ + +################################################################################ +# Consortium web pages +################################################################################ +consortium-fr.html: consortium-fr.html.in edf_logo.svg stardis_build.sh + @echo "Building $@" + @sh stardis_build.sh consortium fr > $@ + +consortium-en.html: consortium-en.html.in edf_logo.svg stardis_build.sh + @echo "Building $@" + @sh stardis_build.sh consortium en > $@ + +################################################################################ +# Download web pages +################################################################################ +stardis-downloads.html:\ + $(STARDIS_SIG) \ + $(STARDIS_SOLVER_README) \ + $(STARDIS_README) \ + $(STARDIS_GREEN_README) \ + stardis_build.sh + @echo "Building $@" + @sh stardis_build.sh downloads $(STARDIS_SOLVER_README) $(STARDIS_README) \ + $(STARDIS_GREEN_README) > $@ + +$(STARDIS_ARCH_FILES): + @echo "Extracting data from $(STARDIS_ARCH)" + @tar -xz -f $(STARDIS_ARCH) $(STARDIS_ARCH_FILES) + +################################################################################ +# Starter pack web pages +################################################################################ +starter-pack.html: \ + $(STARTER_PACK_IMG) \ + $(STARTER_PACK_SIG) \ + $(STARTER_PACK_README) \ + stardis_build.sh \ + Makefile + @echo "Building $@" + @sh stardis_build.sh starter_pack $(STARTER_PACK_README) $(STARTER_PACK_VERSION) > $@ + +$(STARTER_PACK_README): + @echo "Extracting data from $(STARTER_PACK_ARCH)" + @tar -xz -f $(STARTER_PACK_ARCH) $(STARTER_PACK_README) + +################################################################################ +# Check files +################################################################################ +check: build .chk + @$(MAKE) -fMakefile -f .chk check_all + +check_all: check_shells $(HTML:=.chk) + +check_shells: + @echo "Checking stardis_build.sh" && shellcheck -o all -x stardis_build.sh + +################################################################################ +# Miscellaneous targets +################################################################################ +.sig: Makefile ../configure_targets.sh + @echo "Setup .sig" + @sh ../configure_targets.sh sig $(STARDIS_PKG) $(STARTER_PACK_PKG) > .sig + +.chk: Makefile ../configure_targets.sh + @echo "Setup .chk" + @sh ../configure_targets.sh chk $(HTML) > .chk -publish: - rsync -avz consortium-*.html stardis.html stardis-downloads.html starter-pack.html ${IMG} downloads man ${REMOTE}/stardis/ +.man: Makefile ../configure_targets.sh + @echo "Setup .man" + @sh ../configure_targets.sh man Stardis $(STARDIS_VERSION) $(MAN) > .man diff --git a/stardis/stardis.html.in b/stardis/stardis.html.in @@ -48,7 +48,7 @@ the complete source code according to their needs.</p> <p>Despite its specific advantages, Stardis is not meant to fully replace already well established and highly validated thermal simulation tools. Instead, it can be seen as an additional tool that can be useful for various -purposes:<p> +purposes:</p> <ul> <li><b>Probe computation</b>: Stardis will <u>not</u> compute the full @@ -96,7 +96,7 @@ href="#cli">Stardis application</a>, a command line tool that can be seen as a reference implementation of a complete workflow relying on Stardis-Solver, from input data describing the system to simulate (geometry, thermal properties, limit conditions, <i>etc.</i>) to heat transfer simulation and results -post-processing. See below for more information on each of these components.<p> +post-processing. See below for more information on each of these components.</p> <h2 id="solver">Stardis-Solver</h2> @@ -118,7 +118,7 @@ the thermal properties and the limit/boundary conditions, only the geometry defining the contours of the objects is necessary.</p> <p>The Stardis-Solver library is currently used in the two following -projects:<p> +projects:</p> <ul> <li><a href="#cli">Stardis application</a> is the reference implementation of a diff --git a/stardis/stardis.sh b/stardis/stardis.sh @@ -1,251 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -set -e - -source ../meso-menu.sh - -if [ $# -lt 2 ]; then - echo "Usage: $0 VERSION VERSION_PACK" - exit 1 -fi - -if [ ! -f "./downloads/Stardis-$1-GNU-Linux64.tar.gz" ]; then - echo "Cannot find ./downloads/Stardis-$1-GNU-Linux64.tar.gz" - exit 1 -fi - -dir_curr=$(pwd) # Current directory -dir_temp=$(mktemp -d) # Working directory - -################################################################################ -# Sign the package -################################################################################ -tput bold; echo ">>> Stardis packages"; tput sgr0 -archs=$(find "./downloads" -regex "^.*/Stardis-.*[0-9]+\.[0-9]+\.[0-9]+.*tar.gz") - -sign_something=0 -for arch in $archs; do - if [ ! -f $arch.sig ]; then - echo "Sign $arch" - gpg -a -o $arch.sig --detach-sign $arch - sign_something=1 - fi -done - -if [ $sign_something == 0 ]; then - echo "Nothing to do" -fi - -echo "" - -################################################################################ -# Extract the current archive -################################################################################ -cd $dir_temp -arch=Stardis-$1-GNU-Linux64 -cp "$dir_curr/downloads/$arch.tar.gz" . -tar xzf $arch.tar.gz -sdis_spk=Stardis-Starter-Pack-$2 -tar xzf $dir_curr/downloads/$sdis_spk.tar.gz $sdis_spk/README.md -cd $dir_curr - -################################################################################ -# Generate the release notes -################################################################################ -cd $dir_temp -solver_release_notes=$($markdown $arch/share/doc/stardis-solver/README.md \ - | sed '/^<h2>Release notes<\/h2>/,$!d' \ - | sed 1d \ - | sed '/^<h2>License<\/h2>/,$d') -stardis_release_notes=$($markdown $arch/share/doc/stardis/README.md \ - | sed '/^<h2>Release notes<\/h2>/,$!d' \ - | sed 1d \ - | sed '/^<h2>License<\/h2>/,$d') -sgreen_release_notes=$($markdown $arch/share/doc/sgreen/README.md \ - | sed '/^<h2>Release notes<\/h2>/,$!d' \ - | sed 1d \ - | sed '/^<h2>License<\/h2>/,$d') -cd $dir_curr - -################################################################################ -# Generate the overview page -################################################################################ -tput bold; echo ">>> Generate the Stardis web pages"; tput sgr0 -echo "Write stardis.html" -{ - print_header Stardis Overview; - VERSION=$1 envsubst < stardis.html.in; - print_footer; -} > stardis.html - -################################################################################ -# Generate the consortium page -################################################################################ -echo "Write consortium-fr.html" -{ - print_header Stardis Consortium fr; - cat consortium-fr.html.in; - print_footer; -} > consortium-fr.html - -echo "Write consortium-en.html" -{ - print_header Stardis Consortium; - cat consortium-en.html.in; - print_footer; -} > consortium-en.html - -################################################################################ -# Generate the Downloads page -################################################################################ -echo "Write stardis-downloads.html" -{ - print_header Stardis Downloads; - echo '<header><h1>Download Stardis</h1></header>'; - - echo '<p>The proposed archives contain precompiled version of the <a' - echo 'href=https://gitlab.com/meso-star/stardis-solver.git>Stardis-Solver</a>' - echo 'library and of the <a href="./man/man1/stardis.1.html">stardis</a>' - echo 'and <a href="./man/man1/sgreen.1.html">sgreen</a> command line' - echo 'tools. Refer below for their associated release notes. The version of' - echo 'the archive corresponds to the version number of the Stardis-Solver' - echo 'library packaged into the archive.</p>' - - print_downloads Stardis "Linux"; - echo "<h2>Stardis-Solver Library release notes</h2>" - echo $solver_release_notes - echo "<h2>Stardis CLI release notes</h2>" - echo $stardis_release_notes - echo "<h2>Stardis-Green CLI release notes</h2>" - echo $sgreen_release_notes - print_footer; -} > stardis-downloads.html; - -################################################################################ -# Generate the starter pack -################################################################################ -echo "Write starter-pack.html" - -$markdown $dir_temp/$sdis_spk/README.md \ - | sed 's/<pre><code>/<pre class=code>/g' \ - | sed 's/<\/code><\/pre>/\<\/pre\>/g' \ - > $dir_temp/$sdis_spk/README.html - -intro=$(cat $dir_temp/$sdis_spk/README.html \ - | sed 1d \ - | sed '/^<h2>Content<\/h2>/,$d') - -content1=$(cat $dir_temp/$sdis_spk/README.html \ - | sed '/^<h2>Content<\/h2>/,$!d' \ - | sed 1d \ - | sed '/^<h3>The porous medium<\/h3>/,$d') - -content2=$(cat $dir_temp/$sdis_spk/README.html \ - | sed '/^<h3>The porous medium<\/h3>/,$!d' \ - | sed '/^<h2>Copyright notice<\/h2>/,$d') - -license=$(cat $dir_temp/$sdis_spk/README.html \ - | sed '/^<h2>Copyright notice<\/h2>/,$!d' \ - | sed 's/opyright (C)/opyright \&#169;/g') - -{ - print_header Stardis Starter-Pack - - echo "<header>" - echo " <h1>Stardis: Starter Pack</h1>" - echo "</header>" - echo "<div class="news">" - echo " <p><b>Stardis: Starter Pack $2</b></p>" - echo " <ul>" - echo " <li><a href=\"downloads/Stardis-Starter-Pack-$2.tar.gz\">tarball</a> /" - echo " <a href=\"downloads/Stardis-Starter-Pack-$2.tar.gz.sig\">pgp</a></li>" - echo " </ul>" - echo "</div>" - - echo "$intro" - - echo "<h2>Content</h2>" - echo "<div class=\"img\" style=\"padding-top:3em; width: 17em\">" - echo " <a href=\"heatsink.jpg\"><img src=\"heatsink.jpg\" alt=\"heatsink\"></a>" - echo " <a href=\"heatsinkx50.jpg\"><img src=\"heatsinkx50.jpg\" alt=\"heatsinkx50\"></a>" - echo " <a href=\"foam.jpg\"><img src=\"foam.jpg\" alt=\"foam\"></a>" - echo " <a href=\"city.jpg\"><img src=\"city.jpg\" alt=\"city\"></a>" - echo " <div class=\"caption\">" - echo " Geometries of the heatsink, the multiple heatsinks, the foam, and the city" - echo " provided by the Starter Pack and used in its examples." - echo " </div>" - echo "</div>" - - echo "$content1" - - echo "<div class=\"img\" style=\"padding-top:3em; width: 16em\">" - echo " <a href=\"IR_rendering_1080x720x128.jpg\">" - echo " <img src=\"IR_rendering_1080x720x128.jpg\" alt=\"foam_ir\">" - echo " </a>" - echo " <a href=\"IR_animation_1080x720x32x128.gif\">" - echo " <img src=\"IR_animation_1080x720x32x128_thumb.gif\" alt=\"foam_anim\">" - echo " </a>" - echo " <div class=\"caption\">" - echo " Illustration of the infrared rendering of the porous example. The" - echo " color map displays the temperature in Kelvin." - echo " The bottom animation was produced by a simple" - echo " rotation of the camera around the center of the foam." - echo " Each one of the 32 frames is a full image produced by" - echo " a Stardis run." - echo " </div>" - echo "</div>" - - echo "<div class=\"img\" style=\"padding-top:3em; width: 16em\">" - echo " <a href=\"IR_city_640x480x1024_273-275.png\">" - echo " <img src=\"IR_city_640x480x1024_273-275.png\" alt=\"city_ir\">" - echo " </a>" - echo " <div class=\"caption\">" - echo " The infrared rendering of the city example. The color map displays the" - echo " temperature in Kelvin. The image consists of 640x480 independent" - echo " Monte-Carlo estimates (one per pixel, 1024 paths each)." - echo " </div>" - echo "</div>" - - echo "$content2" - echo "$license" - - print_footer -} > starter-pack.html - -################################################################################ -# Generate the reference documentation -################################################################################ -for((i=0; i<${#stardis_man_pages[@]}; ++i)); do - entry=(${stardis_man_pages[$i]}) - man_name=${entry[0]} - man_num=${entry[1]} - man_path="$dir_temp/$arch/share/man/man${entry[1]}/$man_name.$man_num" - output="man/man${entry[1]}/$man_name.$man_num.html" - convert_man_page Stardis "$man_path" "$output" $1 - - if [ "$man_name" == "stardis" ]; then - # Patch the htpp hyperlink - sed -i 's/<A HREF="\.\.\/man1\/htpp\.1\.html">/<A HREF="..\/..\/..\/high-tune\/man\/man1\/htpp.1.html">/g' $output - fi - if [ "$man_name" == "stardis-output" ]; then - # Patch the htrdr-image hyperlink - sed -i 's/<A HREF="\.\.\/man5\/htrdr-image\.5\.html">/<A HREF="..\/..\/..\/high-tune\/man\/man5\/htrdr-image.5.html">/g' $output - fi - -done - diff --git a/stardis/stardis_build.sh b/stardis/stardis_build.sh @@ -0,0 +1,167 @@ +#!/bin/sh -e + +# Copyright (C) 2017-2022 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. ../meso-menu.sh + +overview() +{ + if [ $# -lt 1 ]; then + printf "Usage: %s overview <version>\n" "$0" >&2 + exit 1 + fi + + print_header Stardis Overview + VERSION=$1 envsubst < stardis.html.in + print_footer +} + +consortium() +{ + if [ $# -lt 1 ]; then + printf "Usage: %s consortium <fr|en>\n" "$0" >&2 + exit 1 + fi + + print_header Stardis Consortium "$1" + cat "consortium-$1.html.in" + print_footer +} + +downloads() +{ + if [ $# -lt 3 ]; then + printf "Usage: %s downloads <stardis-solver-release-notes> \ +<stardis-release-notes> <stardis-green-release-notes>\n" "$0" >&2 + exit 1 + fi + + print_header Stardis Downloads + echo '<header><h1>Download Stardis</h1></header>' + + echo "<p>The proposed archives contain precompiled version of the <a" + echo "href=\"https://gitlab.com/meso-star/stardis-solver.git\">Stardis-Solver</a>" + echo "library and of the <a href=\"./man/man1/stardis.1.html\">stardis</a>" + echo "and <a href=\"./man/man1/sgreen.1.html\">sgreen</a> command line" + echo "tools. Refer below for their associated release notes. The version of" + echo "the archive corresponds to the version number of the Stardis-Solver" + echo "library packaged into the archive.</p>" + + solver_release_notes=$(${markdown} "$1" \ + | sed -n '/^<h2>Release notes<\/h2>/,/^<h2>License<\/h2>/p' \ + | sed -e '1d' -e '$d') + app_release_notes=$(${markdown} "$2" \ + | sed -n '/^<h2>Release notes<\/h2>/,/^<h2>License<\/h2>/p' \ + | sed -e '1d' -e '$d') + green_release_notes=$(${markdown} "$3" \ + | sed -n '/^<h2>Release notes<\/h2>/,/^<h2>License<\/h2>/p' \ + | sed -e '1d' -e '$d') + + print_downloads Stardis "Linux" + echo "<h2>Stardis-Solver Library release notes</h2>" + echo "${solver_release_notes}" + echo "<h2>Stardis CLI release notes</h2>" + echo "${app_release_notes}" + echo "<h2>Stardis-Green CLI release notes</h2>" + echo "${green_release_notes}" + print_footer +} + +starter_pack() +{ + if [ $# -lt 1 ]; then + printf "Usage: %s starter_pack <readme> <version>\n" "$0" >&2 + exit 1 + fi + + readme=$(${markdown} "$1") + intro=$(echo "${readme}" \ + | sed '/^<h2>Content<\/h2>/,$d' \ + | sed '1d') + content1=$(echo "${readme}" \ + | sed -n '/^<h2>Content<\/h2>/,/^<h3>The porous medium<\/h3>/p' \ + | sed -e '1d' -e '$d') + content2=$(echo "${readme}" \ + | sed -n '/^<h3>The porous medium<\/h3>/,/^<h2>Copyright notice<\/h2>/p' \ + | sed '$d') + license=$(echo "${readme}" \ + | sed -n '/^<h2>Copyright notice<\/h2>/,$p' \ + | sed 's/opyright (C)/opyright \&#169;/g') + + print_header Stardis Starter-Pack + + echo "<header>" + echo " <h1>Stardis: Starter Pack</h1>" + echo "</header>" + echo "<div class=\"news\">" + echo " <p><b>Stardis: Starter Pack $2</b></p>" + echo " <ul>" + echo " <li><a href=\"downloads/Stardis-Starter-Pack-$2.tar.gz\">tarball</a> /" + echo " <a href=\"downloads/Stardis-Starter-Pack-$2.tar.gz.sig\">pgp</a></li>" + echo " </ul>" + echo "</div>" + + echo "${intro}" + + echo "<h2>Content</h2>" + echo "<div class=\"img\" style=\"padding-top:3em; width: 17em\">" + echo " <a href=\"heatsink.jpg\"><img src=\"heatsink.jpg\" alt=\"heatsink\"></a>" + echo " <a href=\"heatsinkx50.jpg\"><img src=\"heatsinkx50.jpg\" alt=\"heatsinkx50\"></a>" + echo " <a href=\"foam.jpg\"><img src=\"foam.jpg\" alt=\"foam\"></a>" + echo " <a href=\"city.jpg\"><img src=\"city.jpg\" alt=\"city\"></a>" + echo " <div class=\"caption\">" + echo " Geometries of the heatsink, the multiple heatsinks, the foam, and the city" + echo " provided by the Starter Pack and used in its examples." + echo " </div>" + echo "</div>" + + echo "${content1}" + + echo "<div class=\"img\" style=\"padding-top:3em; width: 16em\">" + echo " <a href=\"IR_rendering_1080x720x128.jpg\">" + echo " <img src=\"IR_rendering_1080x720x128.jpg\" alt=\"foam_ir\">" + echo " </a>" + echo " <a href=\"IR_animation_1080x720x32x128.gif\">" + echo " <img src=\"IR_animation_1080x720x32x128_thumb.gif\" alt=\"foam_anim\">" + echo " </a>" + echo " <div class=\"caption\">" + echo " Illustration of the infrared rendering of the porous example. The" + echo " color map displays the temperature in Kelvin." + echo " The bottom animation was produced by a simple" + echo " rotation of the camera around the center of the foam." + echo " Each one of the 32 frames is a full image produced by" + echo " a Stardis run." + echo " </div>" + echo "</div>" + + echo "<div class=\"img\" style=\"padding-top:3em; width: 16em\">" + echo " <a href=\"IR_city_640x480x1024_273-275.png\">" + echo " <img src=\"IR_city_640x480x1024_273-275.png\" alt=\"city_ir\">" + echo " </a>" + echo " <div class=\"caption\">" + echo " The infrared rendering of the city example. The color map displays the" + echo " temperature in Kelvin. The image consists of 640x480 independent" + echo " Monte-Carlo estimates (one per pixel, 1024 paths each)." + echo " </div>" + echo "</div>" + + echo "${content2}" + echo "${license}" + + print_footer +} + +"$@"