commit aa6c0d74369cc41edaed30a69f0aa9dfbff87cf8
parent 705ab407185dc8ba68259ebdeb0c55865f30372a
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 27 Sep 2017 14:45:25 +0200
Major update
Add an auto generated download section. Automatically sign the archive
contained into the downloads process. Full rewrite of the generation
scripts.
Diffstat:
| M | .gitignore | | | 4 | ++++ |
| M | Makefile | | | 13 | +++++++++---- |
| M | meso.css | | | 32 | +++++++++++++++++++++++++++++--- |
| A | pgp_signature.html.in | | | 70 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| D | solstice-gen.sh | | | 143 | ------------------------------------------------------------------------------- |
| A | solstice-menu.sh | | | 128 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| D | solstice.html | | | 173 | ------------------------------------------------------------------------------- |
| M | solstice.html.in | | | 81 | ++++++++++++++++++++++++------------------------------------------------------- |
| A | solstice.sh | | | 138 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
9 files changed, 402 insertions(+), 380 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1,3 +1,7 @@
+release_notes.html.in
+solstice.html
+solstice-downloads.html
+downloads/
*.sw[po]
*.[ao]
*~
diff --git a/Makefile b/Makefile
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-SOLSTICE-DIR=~/code/star-engine-solstice/local
+SOLSTICE-VERSION=0.6.0
.PHONY: default
default: all
@@ -24,10 +24,15 @@ all: solstice
.PHONY: solstice
solstice:
@tput bold
- @echo -e ">>> Generate Solstice web pages from '$(SOLSTICE-DIR)'"
+ @echo -e ">>> Generate Solstice web pages. Version: '$(SOLSTICE-VERSION)'"
@tput sgr0
- @sh ./solstice-gen.sh $(SOLSTICE-DIR)
+ @sh ./solstice.sh $(SOLSTICE-VERSION)
.PHONY: clean
clean:
- @rm -rf man solstice.html
+ @rm -rf \
+ man \
+ solstice.html \
+ solstice-downloads.html \
+ release_notes.html.in \
+ downloads/*.sig
diff --git a/meso.css b/meso.css
@@ -8,7 +8,7 @@ body {
max-width: 71em;
}
-h1 {
+h1 {
/*text-align: right; */
padding-bottom: 0.3em;
}
@@ -31,7 +31,7 @@ pre {
}
pre.code {
- padding-left: 2em;
+ padding-left: 1em;
display: block;
font-family: "Liberation Mono",monospace;
color: #666666
@@ -89,7 +89,7 @@ pre.code a {
color: #000000;
}
-#navcontainer a:hover {
+#navcontainer a:hover {
color: #777777
}
@@ -188,3 +188,29 @@ pre.code a {
color: #333333;
font-weight: normal;
}
+
+/*******************************************************************************
+ * Test
+ ******************************************************************************/
+td {
+ padding: 0em 2em 0em 2em;
+ margin: 0em;
+ text-align: center;
+}
+
+th {
+ font-variant: small-caps;
+ padding: 0.5em 2em 0.5em 2em;
+ margin: 0em;
+ text-align: center;
+ background-color: #ffffff;
+}
+
+tr#gray {
+ background-color: #ccc;
+}
+
+tr:nth-child(2n+1) {
+ background-color: #F7F6F1;
+}
+
diff --git a/pgp_signature.html.in b/pgp_signature.html.in
@@ -0,0 +1,70 @@
+<div id=pgp></div>
+<h2>PGP signatures</h2>
+
+
+<p>The Solstice archives are cryptographically signed using <a
+href="https://en.wikipedia.org/wiki/Pretty_Good_Privacy#How_PGP_encryption_works">
+OpenPGP</a>-compliant signatures. Everyone is encouraged to check the integrity
+of the downloaded content by verifying its corresponding signature. The signing
+and verification process ensures that the downloaded files were not modified or
+tampered since their creation and thus prevents anyone to use corrupted files.</p>
+
+<p>On GNU/Linux, the most common way for verifying the PGP signature is to use
+<a href=https://www.gnupg.org/>GnuPG</a>. First ensure that GnuPG is installed
+on your system. Then download the archive and its PGP signature and use the
+<code>gpg2</code> command to check the integrity of the archive against its
+signature.
+
+<pre class="code">
+$ wget https//www.meso-star.com/downloads/Solstice-${VERSION}-GNU-Linux.tar.gz
+$ wget https//www.meso-star.com/downloads/Solstice-${VERSION}-GNU-Linux.tar.gz.sig
+$ gpg2 --verify Solstice-${VERSION}-GNU-Linux.tar.gz.sig
+</pre>
+
+<p>The first time you may obtain the likely output:</p>
+
+<pre class="code">
+gpg: Signature made Wed 20 Sep 2017 08:28:35 AM CEST using RSA key 7322B68F7896C455
+gpg: Can't check signature: No public key
+</pre>
+
+<p>This means that you do not have the public part of the PGP key used to sign
+the Solstice archive. In the previous example the key identifier is
+<code>7322B68F7896C455</code>. Use <code>gpg2</code> to download this key from
+the PGP keyserver.</p>
+
+<pre class="code">
+$ gpg2 --keyserver hkps://hkps.pool.sks-keyservers.net --recv-keys 7322B68F7896C455
+</pre>
+
+<p>Now you can check the integrity of the archive with respect to the
+previously downloaded public-key.</p>
+
+<pre class="code">
+$ gpg2 --verify Solstice-${VERSION}-GNU-Linux.tar.gz.sig
+gpg: assuming signed data in 'Solstice-0.4.1-GNU-Linux64.tar.gz'
+gpg: Signature made Tue 26 Sep 2017 09:28:40 AM CEST
+gpg: using RSA key 1F494948BAA4F5F4A0AF82FF7322B68F7896C455
+gpg: Good signature from "Vincent Forest (http://www.meso-star.com)
+gpg: <vincent.forest@meso-star.com>" [ultimate]
+gpg: WARNING: This key is not certified with a trusted signature!
+gpg: There is no indication that the signature belongs to the owner.
+Primary key fingerprint: 20EB E4CF 3D9F 4B9A E55D 5F59 679F 2975 93B2 C8A2
+ Subkey fingerprint: 1F49 4948 BAA4 F5F4 A0AF 82FF 7322 B68F 7896 C455
+</pre>
+
+<p>Note that GnuPG warns that the key is not certified. In other words you
+cannot be sure that the key used to sign the archive really belongs to the
+owner. The best option is to meet the owner in real life and ask for him about
+the key validity. More simply, but also less secure, you could try to contact
+him by phone or e-mail, or review the list of signatures of the public key, and
+then make a decision whether you <a
+href="https://www.gnupg.org/gph/en/manual/x334.html">trust</a> that key or
+not.</p>
+
+<p>On Windows, you can use the <a href="https://www.gpg4win.org/">GPG4Win</a>
+tool to verify the archive signature. The process is roughly the same that on
+GNU/Linux: you first have to import the public key used to sign the archive
+before verifying its integrity and checking that the imported key really
+belongs to the owner.</p>
+
diff --git a/solstice-gen.sh b/solstice-gen.sh
@@ -1,143 +0,0 @@
-#!/bin/bash
-
-# Copyright (C) |Meso|Star> 2017
-#
-# 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
-
-if [ $# -lt 1 ]; then
- echo "Usage: $0 SOLSTIC-DIR"
- exit 1
-fi
-
-if [ ! -d $1 ]; then
- echo " '$1' is not a directory."
- exit 1
-fi
-
-if [ ! -f $1/bin/solstice ]; then
- echo "Cannot find the solstice program."
- exit 1
-fi
-
-version=$(echo `readlink $1/bin/solstice` | sed 's/solstice-\(.*\)/\1/g')
-
-if [ "$version" == "" ]; then
- echo "Cannot retrieve the solstice version."
- exit 1
-fi
-
-echo "Write solstice.html"
-version=$version envsubst < solstice.html.in > solstice.html
-
-man_pages=(
- "solstice 1"
- "solstice-input 5"
- "solstice-output 5"
- "solstice-receiver 5"
-)
-
-print_header() {
- local name=$1
- local num=$2
-
- echo '<!DOCTYPE html>'
- echo '<html lang=en>'
- 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>Solstice</title>'
- echo ' <link rel="stylesheet" title="default" href="../../meso.css">'
- echo '</head>'
- echo ''
- echo '<body>'
- echo ''
- echo '<div id="menu">'
- echo ' <h2>Solstice</h2>'
- echo ' <ul>'
- echo ' <li><a href="../../solstice.html">About</a></li>'
- echo ' <li>Reference documentation</li>'
- echo ' </ul>'
- echo ' <ul id=lvl2>'
-
- local i
- for((i=0; i < ${#man_pages[@]}; ++i)); do
- local entry=(${man_pages[$i]})
- if [ "$name" == ${entry[0]} ]; then
- echo " <li id=cur>$name</li>"
- else
- local link_path="../man${entry[1]}/${entry[0]}.${entry[1]}.html"
- echo " <li><a href=\"$link_path\">${entry[0]}</a></li>"
- fi
- done
- echo ' </ul>'
- echo ' <div id="info">'
- echo ' <p>Solstice is developped by <a'
- echo ' href="https://www.meso-star.com">|Méso|Star></a> in collaboration with'
- echo ' the <a href="http://www.labex-solstice.fr/">Laboratory of Excellence'
- echo ' Solstice</a> and the <a'
- echo ' href="http://www.promes.cnrs.fr/index.php?page=home-en">PROMES</a>'
- echo ' laboratory of the National Center for Scientific Research. It is copyright'
- echo ' © <a href="http://www.cnrs.fr/index.php">CNRS</a> 2016-2017.</p>'
- echo ' </div>'
- echo '</div>'
- echo '<div id=content>'
- echo "<div style=\"font-variant: small-caps; float: right; color: #777777\">Version $version</div>"
- echo '<header>'
- echo " <h1>$name($num)</h1>"
- echo '</header>'
-}
-
-print_footer() {
- echo '</div>'
- echo '</body>'
-}
-
-for((i=0; i<${#man_pages[@]}; ++i)); do
- entry=(${man_pages[$i]})
- man_name=${entry[0]}.${entry[1]}
- man_path=$1/share/man/man${entry[1]}/$man_name
- output=man/man${entry[1]}/$man_name.html
-
- if [ ! -f "$man_path" ]; then
- echo "Cannot find the '$man_path' man page."
- continue
- fi
-
- if [ ! -d man ]; then
- mkdir man
- fi
-
- if [ ! -d man/man${entry[1]} ]; then
- mkdir man/man${entry[1]}
- fi
-
- echo "Write $output"
- print_header ${entry[0]} ${entry[1]} > $output
- man2html -r $man_path | tail -n +30 | sed '/^<HR>$/,$d' | sed '/\ /d' | sed 's/<DL COMPACT>/<DL>/g' >> $output
- if [ "${entry[0]}" == "solstice" ]; then
- # Remove hyperlink on csplit, feh and sed 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\/sed\.1\.html">sed<\/A><\/B>/sed/g' $output
-
- # Fix the hyperlink toward the GPLv3+ license
- sed -i 's/gpl\.html\.">\(.*\).<\/A>/gpl.html">\1<\/A>./g' $output
- fi
- if [ "${entry[0]}" == "solstice-input" -o "${entry[0]}" == "solstice-receiver" ]; then
- sed -i "s/\<Aincqt\>/Ain't/g" $output
- fi
- print_footer ${entry[0]} ${entry[1]} >> $output
-done
diff --git a/solstice-menu.sh b/solstice-menu.sh
@@ -0,0 +1,128 @@
+#!/bin/bash
+
+# Copyright (C) |Meso|Star> 2017
+#
+# 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/>.
+
+man_pages=(
+ "solstice 1"
+ "solstice-input 5"
+ "solstice-output 5"
+ "solstice-receiver 5"
+)
+
+print_header() {
+ local name=${1#man-}
+ local root=$([[ "$1" != "$name" ]] && echo "../../" || echo "")
+
+ echo '<!DOCTYPE html>'
+ echo ''
+ echo '<html lang=en>'
+ 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>Solstice</title>'
+ echo " <link rel=\"stylesheet\" title=\"default\" href=\"${root}meso.css\">"
+ echo '</head>'
+ echo ''
+ echo '<body>'
+ echo '<div id="menu">'
+ echo ' <h2>Solstice</h2>'
+ echo ' <ul>'
+ if [ "$name" == "About" ]; then
+ echo ' <li id=cur>About</li>'
+ else
+ echo " <li><a href=${root}solstice.html>About</a></li>"
+ fi
+ echo ' <li>Reference documentation</li>'
+ echo ' </ul>'
+ echo ' <ul id=lvl2>'
+ local i
+ for((i=0; i < ${#man_pages[@]}; ++i)); do
+ local entry=(${man_pages[$i]})
+ if [ "$1" == "man-${entry[0]}" ]; then
+ echo " <li id=cur>$name</li>"
+ else
+ local link_path="${root}man/man${entry[1]}/${entry[0]}.${entry[1]}.html"
+ echo " <li><a href=\"$link_path\">${entry[0]}</a></li>"
+ fi
+ done
+ echo ' </ul>'
+ echo ' <ul>'
+ if [ "$name" == "Downloads" ]; then
+ echo ' <li id=cur>Downloads</li>'
+ else
+ echo " <li><a href=${root}solstice-downloads.html>Downloads</a></li>"
+ fi
+ echo ' </ul>'
+ echo ' <div id="info">'
+ echo ' <p>Solstice is developped by <a'
+ echo ' href="https://www.meso-star.com">|Méso|Star></a> in collaboration with'
+ echo ' the <a href="http://www.labex-solstice.fr/">Laboratory of Excellence'
+ echo ' Solstice</a> and the <a'
+ echo ' href="http://www.promes.cnrs.fr/index.php?page=home-en">PROMES</a>'
+ echo ' laboratory of the National Center for Scientific Research. It is copyright'
+ echo ' © <a href="http://www.cnrs.fr/index.php">CNRS</a> 2016-2017.</p>'
+ echo ' </div>'
+ echo '</div>'
+ echo '<div id=content>'
+}
+
+print_footer() {
+ echo '</div>' # content
+ echo '</body>'
+}
+
+print_downloads() {
+ echo '<table cellspacing=0>'
+ echo ' <tr>'
+ echo ' <th>Version</th>'
+ echo ' <th>GNU/Linux 64-bits</th>'
+ echo ' <th>Windows 64-bits</th>'
+ echo ' <th>Source</th>'
+ echo ' </tr>'
+
+ local archs=$(ls -r downloads/Solstice-*.tar.gz )
+ local arch;
+
+ for arch in $archs; do
+ local version=$(echo $arch | sed 's/.*Solstice-\([0-9]\+.[0-9]\+.[0-9]\+\)-.*/\1/g')
+ local dl_files=(
+ "downloads/Solstice-${version}-GNU-Linux64.tar.gz"
+ "downloads/Solstice-${version}-Win64.zip"
+ "downloads/Solstice-${version}-Source.zip"
+ )
+
+ echo " <tr>"
+ echo " <td>${version}</td>"
+ for((i=0; i < ${#dl_files[@]}; ++i)); do
+ local dl_file=${dl_files[$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"
+ echo "</a>]"
+ fi
+ if [ -f ${dl_files[$i]}.sig ]; then
+ echo " [<a href='${dl_files[$i]}.sig'>pgp</a>]"
+ fi
+ echo " </td>"
+ done
+ echo " </tr>"
+ done
+
+ echo '</table>'
+}
+
diff --git a/solstice.html b/solstice.html
@@ -1,173 +0,0 @@
-<!DOCTYPE html>
-
-<html lang=en>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Solstice</title>
- <link rel="stylesheet" title="default" href="meso.css">
-</head>
-
-<body>
-
-<div id="menu">
- <h2>Solstice</h2>
- <ul>
- <li id=cur>About</li>
- <li>Reference documentation</li>
- </ul>
- <ul id=lvl2>
- <li><a href="man/man1/solstice.1.html">solstice</a></li>
- <li><a href="man/man5/solstice-input.5.html">solstice-input</a></li>
- <li><a href="man/man5/solstice-output.5.html">solstice-output</a></li>
- <li><a href="man/man5/solstice-receiver.5.html">solstice-receiver</a></li>
- </ul>
-
- <div id="info">
- <p>Solstice is developped by <a
- href="https://www.meso-star.com">|Méso|Star></a> in collaboration with
- the <a href="http://www.labex-solstice.fr/">Laboratory of Excellence
- Solstice</a> and the <a
- href="http://www.promes.cnrs.fr/index.php?page=home-en">PROMES</a>
- laboratory of the National Center for Scientific Research. It is copyright
- © <a href="http://www.cnrs.fr/index.php">CNRS</a> 2016-2017.</p>
- </div>
-</div>
-
-<div id=content>
-<header>
- <h1>Solstice - The solar plant simulation tool</h1>
-</header>
-
-<div id="news">
- <p><b>Solstice 0.5.0 is available</b></p>
- <ul>
- <li> GNU/Linux: <a href="">tar.gz</a> / <a href="">md5</a></li>
- <li> Windows: <a href="">zip</a> / <a href="">md5</a></li>
- </ul>
- <ul><li>Sources: <a href="">zip</a> / <a href="">md5</a></li></ul>
-</div>
-
-<p>Solstice computes the <b>total power</b> collected by a concentrated solar
-plant, and evaluates various <b>efficiencies</b> for each primary reflector: it
-computes losses due to cosine effect, to shadowing and masking, to orientation
-and surface irregularities, to reflectivity and to atmospheric transmission.
-These data provides insightful informations when looking for the optimal design
-of a concentrated solar plant. Solstice is powered by a <b>Monte-Carlo
-solver</b>, which means that every of these results is provided with its
-<b>numerical accuracy</b>.
-
-<p>Solstice is specifically designed to handle <b>complex solar facilities</b>.
-A solar plant can be composed of any number of geometries of different types
-like hyperbolas, parabolas, cylindro-parabolas, planar polygons, cylinders,
-spheres, hemispheres and cuboids. Behind analytic shapes, one can also use any
-<b>external mesh</b> stored with respect to the STereo Lithography file
-format.
-
-<p>The orientation of the reflectors can be either defined manually or
-<b>automatically computed</b> by Solstice with respect to the sun direction and
-the animation constraints of the reflectors.
-
-<p>Mirror, matte and dielectric materials are supported. <b>Spectral effects</b>
-are also taken into account as long as the relevant physical properties are
-provided; it is possible to define the spectral distribution of any physical
-property, including the input solar spectrum and the absorption of the
-atmosphere, at any spectral resolution.</p>
-
-<p>Solstice is available on GNU/Linux and Microsoft Windows 7 or later. It is a
-free software released under the GPLv3+ license. You are welcome to
-redistribute it under certain conditions; refer to the <a
-href="https://www.gnu.org/licenses/gpl.html" onclick="window.open(this.href);
-return false;">license</a> for details.</p>
-
-<h2>A straight interface</h2>
-
-<p>The Solstice program is a <b>command-line tool</b> that consumes input data,
-performs computations, write results and that's all. It presumes nothing on how
-the input data are created excepted that it has to follow the expected file
-formats. The simulation results are also provided as is, in a raw ASCII file
-format.</p>
-
-<p>This thin interface is not only simple and powerful but is also particularly
-well suited to be <b>extended</b> and <b>integrated into any toolchain</b>.
-According to the user needs, the solar plant description can be manually
-written, generated by a script, exported from a content creation tool,
-<i>etc.</i> In the same way, the output data can be post-processed by any
-script to be transformed, compressed, sent over a network, displayed in a data
-analysis tool, <i>etc.</i>.</p>
-
-<h2>A framework for data analysis</h2>
-
-<div id="img" style="width: 18em">
- <a href="themis.png">
- <img src="themis.png" style="float: relative" alt="Themis in paraview">
- </a>
- <div id="caption">
- Post-processed Solstice outputs displayed in
- <a href="https://www.paraview.org" onclick='window.open(this.href);
- return false;'>Paraview</a>.
- </div>
-</div>
-
-<p>Beside the simulation process, Solstice can output data to help in the
-<b>analysis</b> of the simulation results: it can save the <b>radiative
-paths</b> sampled during a simulation, and export the solar plant
-<b>geometry</b> with respect to a regular geometric file format. Thanks to
-these data, the user can quickly assert that too many radiative paths are
-occluded or miss the target, or that the primary reflectors are not correctly
-oriented. One can also map the simulation results to the solar plant geometry
-in order to provide an efficient and interactive way to visualise, and thus
-analyse, the estimated data in the desired data analysis toolkit.</p>
-
-<p>Solstice provides also <b>offline rendering</b> capabilities. It implements
-an un-biased physically based rendering kernel that relies on the data and
-algorithmic tools used by the solver. This ensures that the drawn images give
-visual clues on how the light actually interacts with the geometry and the
-materials of the simulated solar plant.</p>
-
-<h2>Quick start</h2>
-
-<p>Get the desired archive of Solstice and check its MD5 checksum against its
-corresponding <code>md5</code> file. 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
-Solstice application to the system and allowing its invocation from
-anywhere.</p>
-
-<pre class="code">
-C:\Users\Meso-Star\Solstice-0.5.0-Win64\bin>solstice -h
-</pre>
-
-<p>On GNU/Linux, source the provided <code>solstice.profile</code> file to
-register the Solstice installation for the current shell priorly to the
-invocation of the <code>solstice</code> program.</p>
-
-<pre class="code">
-~ $ source ~/Solstice-0.5.0-GNU-Linux64/etc/solstice.profile
-~ $ solstice -h
-</pre>
-
-<p>To setup the Solstice environment for all subsequently spawned shells, source
-the profile of Solstice in your shell initialisation script.</p>
-
-<pre class="code">
-~ $ echo "source ~/Solstice-0.5.0-GNU-Linux64/etc/solstice.profile" >> ~/.bashrc
-</pre>
-
-<p>The Solstice <b>reference documentation</b> is installed in the
-<code>share/man</code> sub-directory of Solstice. To consult it, browse the
-HTML files stored in the <code>share/man/man1</code> and
-<code>share/man/man5</code> directories. On GNU/Linux, you can alternatively
-use the <code>man</code> command-line to read its ROFF version.</p>
-
-<pre class="code">
-~ $ man solstice
-~ $ man solstice-input
-~ $ man solstice-output
-~ $ man solstice-receiver
-</pre>
-
-</div> <!--content-->
-
-</body>
diff --git a/solstice.html.in b/solstice.html.in
@@ -1,51 +1,22 @@
-<!DOCTYPE html>
-
-<html lang=en>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Solstice</title>
- <link rel="stylesheet" title="default" href="meso.css">
-</head>
-
-<body>
-
-<div id="menu">
- <h2>Solstice</h2>
- <ul>
- <li id=cur>About</li>
- <li>Reference documentation</li>
- </ul>
- <ul id=lvl2>
- <li><a href="man/man1/solstice.1.html">solstice</a></li>
- <li><a href="man/man5/solstice-input.5.html">solstice-input</a></li>
- <li><a href="man/man5/solstice-output.5.html">solstice-output</a></li>
- <li><a href="man/man5/solstice-receiver.5.html">solstice-receiver</a></li>
- </ul>
-
- <div id="info">
- <p>Solstice is developped by <a
- href="https://www.meso-star.com">|Méso|Star></a> in collaboration with
- the <a href="http://www.labex-solstice.fr/">Laboratory of Excellence
- Solstice</a> and the <a
- href="http://www.promes.cnrs.fr/index.php?page=home-en">PROMES</a>
- laboratory of the National Center for Scientific Research. It is copyright
- © <a href="http://www.cnrs.fr/index.php">CNRS</a> 2016-2017.</p>
- </div>
-</div>
-
-<div id=content>
<header>
<h1>Solstice - The solar plant simulation tool</h1>
</header>
<div id="news">
- <p><b>Solstice ${version} is available</b></p>
+ <p><b>Solstice ${VERSION} is available</b></p>
<ul>
- <li> GNU/Linux: <a href="">tar.gz</a> / <a href="">md5</a></li>
- <li> Windows: <a href="">zip</a> / <a href="">md5</a></li>
+ <li>GNU/Linux:
+ <a href="downloads/Solstice-${VERSION}-GNU-Linux64.tar.gz">tar.gz</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:
+ <a href="downloads/Solstice-${VERSION}-Source.zip">zip</a> /
+ <a href="downloads/Solstice-${VERSION}-Source.zip.sig">pgp</a></li>
</ul>
- <ul><li>Sources: <a href="">zip</a> / <a href="">md5</a></li></ul>
</div>
<p>Solstice computes the <b>total power</b> collected by a concentrated solar
@@ -127,16 +98,16 @@ materials of the simulated solar plant.</p>
<h2>Quick start</h2>
-<p>Get the desired archive of Solstice and check its MD5 checksum against its
-corresponding <code>md5</code> file. Then extract it. On Windows, open a
-command prompt into the Solstice bin directory and invoke the
+<p>Get the desired archive of Solstice and verify its integrity against its <a
+href=solstice-downloads.html#pgp>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
Solstice application to the system and allowing its invocation from
anywhere.</p>
<pre class="code">
-C:\Users\Meso-Star\Solstice-${version}-Win64\bin>solstice -h
+C:\Users\Meso-Star\Solstice-${VERSION}-Win64\bin>solstice -h
</pre>
<p>On GNU/Linux, source the provided <code>solstice.profile</code> file to
@@ -144,30 +115,26 @@ register the Solstice installation for the current shell priorly to the
invocation of the <code>solstice</code> program.</p>
<pre class="code">
-~ $ source ~/Solstice-${version}-GNU-Linux64/etc/solstice.profile
-~ $ solstice -h
+$ source ~/Solstice-${VERSION}-GNU-Linux64/etc/solstice.profile
+$ solstice -h
</pre>
<p>To setup the Solstice environment for all subsequently spawned shells, source
the profile of Solstice in your shell initialisation script.</p>
<pre class="code">
-~ $ echo "source ~/Solstice-${version}-GNU-Linux64/etc/solstice.profile" >> ~/.bashrc
+$ echo "source ~/Solstice-${VERSION}-GNU-Linux64/etc/solstice.profile" >> ~/.bashrc
</pre>
<p>The Solstice <b>reference documentation</b> is installed in the
<code>share/man</code> sub-directory of Solstice. To consult it, browse the
HTML files stored in the <code>share/man/man1</code> and
<code>share/man/man5</code> directories. On GNU/Linux, you can alternatively
-use the <code>man</code> command-line to read its ROFF version.</p>
+use the <code>man</code> command-line to read its ROFF VERSION.</p>
<pre class="code">
-~ $ man solstice
-~ $ man solstice-input
-~ $ man solstice-output
-~ $ man solstice-receiver
+$ man solstice
+$ man solstice-input
+$ man solstice-output
+$ man solstice-receiver
</pre>
-
-</div> <!--content-->
-
-</body>
diff --git a/solstice.sh b/solstice.sh
@@ -0,0 +1,138 @@
+#!/bin/bash
+
+# Copyright (C) |Meso|Star> 2017
+#
+# 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 ./solstice-menu.sh
+
+if [ $# -lt 1 ]; then
+ echo "Usage: $0 VERSION"
+ 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
+
+################################################################################
+# Sign the package
+################################################################################
+archs=$(find downloads/ -name "*.zip" -o -name "*.tar.gz" )
+for arch in $archs; do
+ if [ ! -f $arch.sig ]; then
+ echo "Sign $arch"
+ gpg -a -o $arch.sig --detach-sign $arch
+ fi
+done
+
+################################################################################
+# Generate the HTML code of the solstice release notes
+################################################################################
+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
+markdown2 $arch/share/doc/solstice/README.md \
+ | sed '/^<h2>Release notes<\/h2>/,$!d' \
+ | sed '/^<h2>Licenses<\/h2>/,$d' \
+ > $dir_curr/release_notes.html.in
+cd $dir_curr
+
+################################################################################
+# Generate the About page
+################################################################################
+echo "Write solstice.html"
+{
+ print_header About;
+ VERSION=$1 envsubst < solstice.html.in;
+ print_footer;
+} > solstice.html
+
+################################################################################
+# Generate the Downloads page
+################################################################################
+echo "Write solstice-downloads.html"
+{
+ print_header Downloads;
+ echo '<header><h1>Downloads</h1></header>';
+ print_downloads;
+ VERSION=$1 envsubst < pgp_signature.html.in;
+ cat release_notes.html.in;
+ print_footer;
+} > solstice-downloads.html;
+
+
+################################################################################
+# Generate the reference documentation
+################################################################################
+for((i=0; i<${#man_pages[@]}; ++i)); do
+ entry=(${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 [ ! -f "$man_path" ]; then
+ echo "Cannot find the '$man_path' man page."
+ continue
+ fi
+
+ if [ ! -d man ]; then
+ mkdir man
+ fi
+
+ if [ ! -d man/man${man_num} ]; then
+ mkdir man/man${man_num}
+ fi
+
+ echo "Write $output"
+ {
+ print_header man-${entry[0]}
+ echo "<div style=\"font-variant: small-caps; float: right; color: #777777\">Version $1</div>";
+ echo '<header>';
+ echo " <h1>${man_name}(${man_num})</h1>";
+ echo '</header>';
+ } > $output
+
+ man2html -r $man_path \
+ | tail -n +30 \
+ | sed '/^<HR>$/,$d' \
+ | sed '/\ /d' \
+ | sed 's/<DL COMPACT>/<DL>/g' \
+ >> $output
+
+ if [ "${entry[0]}" == "solstice" ]; then
+ # Remove hyperlink on csplit, feh and sed 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\/sed\.1\.html">sed<\/A><\/B>/sed/g' $output
+
+ # Fix the hyperlink toward the GPLv3+ license
+ sed -i 's/gpl\.html\.">\(.*\).<\/A>/gpl.html">\1<\/A>./g' $output
+ fi
+ if [ "${man_name}" == "solstice-input" -o "${man_name}" == "solstice-receiver" ]; then
+ sed -i "s/\<Aincqt\>/Ain't/g" $output
+ fi
+ print_footer >> $output
+done
+