commit ee6481e9cf1947f8190024e47af5eda219352b0e
parent 3adacb0c72a3626e63fce03da4a6186025fe2973
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 21 Aug 2025 17:22:23 +0200
Solstice: start using the new compilation procedure
Add the section to the menu.tsv file and write shell scripts for the
dynamic content.
Note that man pages are more difficult to manage. Currently, the
compilation system assumes that the pages to be generated are listed
directly in the section directory. Either as markdown files or as shell
scripts used to generate their markdown before conversion to HTML.
Manual pages are also generated, but they are stored in subdirectories.
Without even addressing the idea that the generation of manual pages
should be based on data provided by the Solstice archive. Currently,
manual pages are therefore not managed.
Diffstat:
7 files changed, 154 insertions(+), 71 deletions(-)
diff --git a/menu.tsv b/menu.tsv
@@ -2,5 +2,5 @@ Home misc
A.R.T art
#htrdr htrdr
#Schiff schiff
-#Solstice solstice
+Solstice solstice
#Stardis stardis
diff --git a/solstice/.gitignore b/solstice/.gitignore
@@ -1,4 +1,5 @@
*.html
solstice-downloads.md
+solstice.md
Solstice-*-GNU-Linux64/
Solstice-PP-Sources-*/
diff --git a/solstice/config.in b/solstice/config.in
@@ -0,0 +1,11 @@
+version="0.9.1"
+version_solpp="0.3.1"
+
+arch="downloads/Solstice-${version}-GNU-Linux64.tar.gz"
+readme="Solstice-${version}-GNU-Linux64/share/doc/solstice/README.md"
+
+man="\
+ solstice 1
+ solstice-input 5
+ solstice-output 5
+ solstice-receiver 5"
diff --git a/solstice/index.tsv b/solstice/index.tsv
@@ -0,0 +1,5 @@
+Overview solstice.html
+Manual pages solstice-docs.html
+Downloads solstice-downloads.html
+Additional resources solstice-resources.html
+Git https://gitlab.com/meso-star/solstice
diff --git a/solstice/solstice-downloads.sh b/solstice/solstice-downloads.sh
@@ -0,0 +1,131 @@
+#!/bin/sh
+
+# Copyright (C) 2017-2025 |Méso|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/>.
+
+. "./config.in"
+
+set -e
+
+########################################################################
+# Helper function
+########################################################################
+# Inline the HTML formatting of a table listing Solstice archive to
+# download
+print_downloads()
+{
+ # Table header
+ echo '<table class="list">'
+ echo ' <tr>'
+ echo ' <th>Version</th>'
+ echo ' <th>GNU/Linux 64-bits</th>'
+ echo ' <th>Windows 64-bits</th>'
+ echo ' <th>Sources</th>'
+ echo ' </tr>'
+
+ # Define the basic regular expression of a version number
+ _version_re="[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}"
+ _version_re="${_version_re}\(-r[0-9]\{1,\}\)\{0,1\}"
+
+ # Browse all tarball files in the "downloads" subdirectory. Sort them
+ # in descending order according to lexicographical order. This may
+ # result in an incorrect order with regard to the version number. For
+ # example, version 9 will be considered higher than version 10. Some
+ # implementations offer an option to process version strings
+ # naturally, but this is not POSIX-compliant. So let's leave it as is,
+ # as there are currently no sorting issues.
+ find downloads -name "Solstice*.tar.gz" \
+ | grep -e "Solstice-${_version_re}-[^\(Sources\)].\{0,\}\.tar\.gz" \
+ | sort -r \
+ | while read -r _arch; do
+
+ # Extract the version from
+ _version=$(echo "${_arch}" \
+ | sed "s/downloads\/Solstice-\(${_version_re}\).\{0,\}$/\1/g")
+
+ # Setup archive names
+ _linux="${_arch}"
+ _windows="downloads/Solstice-${_version}-Win64.zip"
+ _source1="downloads/Solstice-${_version}-Sources.zip"
+ _source2="downloads/Solstice-${_version}-Source.zip"
+ _source3="downloads/Solstice-${_version}-Sources.tar.gz"
+ _source4="downloads/Solstice-${_version}-Source.tar.gz"
+
+ # Define the list to be referenced in each cell of the current
+ # version: first the GNU/Linux archive, then the Windows archive,
+ # and finally the corresponding sources. Since sources can have
+ # multiple names, find the one that matches the archive version,
+ # otherwise use a default name. The existence of the various
+ # archives available for download is verified below. The purpose
+ # here is simply a matter of providing three file names that could
+ # fill the cells in the row.
+ _dl="${_linux}"
+ _dl="${_dl} ${_windows}";
+ if [ -f "${_source1}" ]; then _dl="${_dl} ${_source1}";
+ elif [ -f "${_source2}" ]; then _dl="${_dl} ${_source2}";
+ elif [ -f "${_source3}" ]; then _dl="${_dl} ${_source3}";
+ else _dl="${_dl} ${_source4}"; fi
+
+ printf ' <tr>\n' # Let's get started on filling the line
+
+ # Print the version in the first cell of the row
+ printf ' <td>%s</td>\n' "${_version}"
+
+ # Iterate over the 3 filenames previously define and provide a link
+ # to it if their exist onto disk. For instance, a GNU/Linux archive
+ # can be provided while a Windows version is missing.
+ for _i in ${_dl}; do
+
+ printf ' <td>\n'
+
+ if [ -f "${_i}" ]; then
+ # The archive exists. Display a link to it whose label depends
+ # on the archive type (tarball or zip)
+ printf ' [<a href="%s">' "${_i}"
+ [ "${_i#*tar.gz}" != "${_i}" ] && printf 'tarball' || printf 'zip'
+ printf '</a>]\n'
+ fi
+
+ # Display a link to the archive signature, if it exists
+ if [ -f "${_i}.sig" ]; then
+ printf ' [<a href="%s.sig">pgp</a>]\n' "${_i}"
+ fi
+ printf ' </td>\n'
+ done
+
+ printf ' </tr>\n' # That's all for this row
+ done
+
+ # The table is complete. Don't forget to add a line break after it to
+ # signal to Markdown that the embedded HTML code has ended.
+ printf '</table>\n'
+ printf '\n'
+}
+
+########################################################################
+# Generate page content using Markdown formatting
+########################################################################
+if ! [ -e "${readme}" ]; then
+ tar -xz -f "${arch}" "${readme}"
+fi
+
+# Title
+echo '# Downloads'
+
+# List of archives to download
+print_downloads
+
+# Release notes
+sed -n '/^## Release notes/,/^## License/p' "${readme}" | sed '$d'
diff --git a/solstice/solstice.sh b/solstice/solstice.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+. "./config.in"
+
+sed "s/@VERSION@/${version}/g" solstice.md.in | md2html
diff --git a/solstice/solstice_build.sh b/solstice/solstice_build.sh
@@ -1,70 +0,0 @@
-#!/bin/sh -e
-
-# Copyright (C) 2017-2025 |Méso|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 -s Solstice -n Overview -r ../
- sed "s/@VERSION@/$1/g" solstice.md.in | md2html
- print_footer
-}
-
-documentations()
-{
- print_header -s Solstice -n Documentations -r ../
- md2html solstice-docs.md
- print_footer
-}
-
-downloads()
-{
- print_header -s Solstice -n Downloads -r ../
- md2html solstice-downloads.md
- print_footer
-}
-
-# Build the downloads page
-downloads2()
-{
- if [ $# -lt 1 ]; then
- printf "Usage: %s downloads <readme>\n" "$0" >&2
- exit 1
- fi
-
- printf '# Downloads\n'
- printf '\n'
- print_downloads Solstice
- printf '\n'
- sed -n '/^## Release notes/,/^## License/p' "$1" | sed '$d'
-}
-
-# Build the resources page
-resources()
-{
- print_header -s Solstice -n Resources -r ../
- md2html solstice-resources.md
- print_footer
-}
-
-"$@"