commit 4b721b5fde003049827e937f458de14a707f1ab1
parent 07783674a0c6fe2be534ed37137e7fe39524fc38
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 21 Feb 2022 18:26:59 +0100
htrdr: full rewrite of the build process
Use POSIX shell/make
Diffstat:
7 files changed, 451 insertions(+), 451 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -12,10 +12,6 @@ about-en.html
about-fr.html
legal-en.html
legal-fr.html
-htrdr.html
-htrdr-docs.html
-htrdr-atmosphere-spk.html
-htrdr-combustion-spk.html
pgp_signatures.html
starter-pack.html
star-engine.html
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
@@ -12,49 +12,194 @@
#
# 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
+ rm -rf man
+ rm -f .sig .chk .man \
+ $(HTML)
+
+distclean: clean
+ rm -f \
+ $(ATMSPK_SIG) \
+ $(ATMSPK_README) \
+ $(COMSPK_SIG) \
+ $(COMSPK_README) \
+ $(HTRDR_README)
+
+publish: build
+ rsync -avzrR --delete-after \
+ downloads/gas_opt_prop_en.pdf\
+ $(HTML)\
+ $(IMG)\
+ $(find man -name "*.html")\
+ $(ATMSPK_PKG)\
+ $(ATMSPK_SIG)\
+ $(COMSPK_PKG)\
+ $(COMSPK_SIG)\
+ $(REMOTE)
+
+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 .sig
+ @$(MAKE) -fMakefile -f .chk -f .sig 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 \©/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 \©/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,256 @@
+#!/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 \©/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 notest<\/h2>/,/^<h2>Copyright notice<\/h2>/p' \
+ | sed -e '1d' -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 \©/')
+
+ 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 ~/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>"
+
+ 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
@@ -26,23 +26,6 @@ export schiff_man_pages="\
schiff-geometry 5
schiff-output 5"
-export 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"
-
export stardis_man_pages="\
stardis 1
stardis-input 5
@@ -160,7 +143,7 @@ print_htrdr_sub_menu() {
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> was sub-contractor of the project.</p>"
- echo " <p>htrdr was funded by the <a href=\"https://www.ademe.fr\"/>ADEME</a>"
+ 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> 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"