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 c1cd2255dadc0f0a637a3191a269a7809a518be1
parent 0c2d8d2fefb113e61d47a0c4e8d7c27131e2adfb
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon, 25 Aug 2025 14:45:16 +0200

Schiff: use the new compilation procedure

Add the section to the menu.tsv file.

Add the index.tsv file corresponding to the section.

Write hooks to extract the contents of the archives, sign the
downloadable content, and generate the HTML for the manual pages.

Write shell scripts for dynamic content.

Diffstat:
Mmenu.tsv | 2+-
Dschiff/Makefile | 123-------------------------------------------------------------------------------
Aschiff/config.sh.in | 6++++++
Aschiff/hooks/00-extract-archive.sh | 23+++++++++++++++++++++++
Aschiff/hooks/01-generate-man.sh | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aschiff/hooks/xx-sign-archives.sh | 36++++++++++++++++++++++++++++++++++++
Aschiff/index.tsv | 4++++
Aschiff/schiff-downloads.sh | 30++++++++++++++++++++++++++++++
Aschiff/schiff.sh | 20++++++++++++++++++++
Dschiff/schiff_build.sh | 59-----------------------------------------------------------
10 files changed, 190 insertions(+), 183 deletions(-)

diff --git a/menu.tsv b/menu.tsv @@ -1,6 +1,6 @@ Home misc A.R.T art #htrdr htrdr -#Schiff schiff +Schiff schiff Solstice solstice #Stardis stardis diff --git a/schiff/Makefile b/schiff/Makefile @@ -1,123 +0,0 @@ -# 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/>. -.POSIX: - -include ../config.mk - -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 - -IMG = images/particles.png thumbs/particles.jpg -HTML = schiff.html schiff-docs.html schiff-downloads.html - -build: .sig .man - @$(MAKE) -fMakefile -f .sig -f .man build_all - -build_all: $(HTML) man - -clean: - @echo "Cleaning generated files" - @rm -rf man - @rm -f .sig .lint .man $(HTML) $(HTML:=.err) - @rm -f schiff-downloads.md - -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.md.in $(IMG) schiff_build.sh - @echo "Building $@" - @$(SHELL) schiff_build.sh overview $(SCHIFF_VERSION) < schiff.md.in > $@ - -################################################################################ -# Manual pages -################################################################################ -schiff-docs.html: schiff-docs.md schiff_build.sh - @echo "Building $@" - @$(SHELL) schiff_build.sh documentations > $@ - -################################################################################ -# Downloads -################################################################################ -schiff-downloads.html: schiff-downloads.md schiff_build.sh - @echo "Building $@" - @$(SHELL) schiff_build.sh downloads > $@ - -schiff-downloads.md: $(SCHIFF_SIG) $(SCHIFF_README) schiff_build.sh - @echo "Building $@" - @$(SHELL) schiff_build.sh downloads2 $(SCHIFF_README) > $@ - -$(SCHIFF_README) $(MAN): - @echo "Extracting data from $(SCHIFF_ARCH)" - @tar -xz -f $(SCHIFF_ARCH) $(SCHIFF_README) $(MAN) - -################################################################################ -# Check files -################################################################################ -lint: build .lint .sig - @$(MAKE) -fMakefile -f .lint -f .sig lint_all - -lint_all: lint_shells $(HTML:=.lint) - -lint_shells: - @echo "Checking schiff_build.sh" && shellcheck -o all -x schiff_build.sh - -################################################################################ -# Miscellaneous -################################################################################ -.sig: Makefile ../configure_targets.sh - @echo "Setup .sig" - @$(SHELL) ../configure_targets.sh sig $(SCHIFF_PKG)> .sig - -.lint: Makefile ../configure_targets.sh - @echo "Setup .lint" - @$(SHELL) ../configure_targets.sh lint $(HTML) > .lint - -.man: Makefile ../configure_targets.sh - @echo "Setup .man" - @$(SHELL) ../configure_targets.sh man Schiff $(SCHIFF_VERSION) $(MAN) > .man diff --git a/schiff/config.sh.in b/schiff/config.sh.in @@ -0,0 +1,6 @@ +#!/bin/sh + +version="0.4.2" +arch="downloads/Schiff-${version}-GNU-Linux64.tar.gz" +directory="Schiff-${version}-GNU-Linux64" +readme="${directory}/share/doc/schiff/README.md" diff --git a/schiff/hooks/00-extract-archive.sh b/schiff/hooks/00-extract-archive.sh @@ -0,0 +1,23 @@ +#!/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/>. + +set -e + +. "./config.sh.in" + +>&2 printf 'Extracting %s\n' "${arch}" +tar -xz -f "${arch}" "${directory}/share/man" "${readme}" diff --git a/schiff/hooks/01-generate-man.sh b/schiff/hooks/01-generate-man.sh @@ -0,0 +1,70 @@ +#!/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/>. + +set -e + +. "./config.sh.in" + +######################################################################## +# Helper function +######################################################################## +man_pages() +{ + find "${directory}/share/man" -name "schiff*.[15]" +} + +# Man to convert is submitted on stdin +man2html() # output_filename +{ + { + cd .. + sh ./generate_header.sh "${OLDPWD##*/}/$1" + sh ./convert_man.sh + cat ./footer.html + cd "${OLDPWD}" + } > "$1" +} + +######################################################################## +# The script +######################################################################## +if [ "$1" = "targets" ]; then + targets + exit 0 +fi + +man_pages | while read -r i; do + filename="$(basename "${i}")" + section="${filename##*.}" + + if ! [ -d "./man/man${section}" ]; then + mkdir -p "./man/man${section}"; + fi + + dst="man/man${section}/${filename}.html" + man2html "${dst}" < "${i}" + + # Check the result of the HTML conversion + if ! tidy --show-info no --show-filename yes -qe "${dst}"; then + >&2 printf '%s: error converting %s\n' "${0##*/}" "${i}" + exit 1 + fi + + # Write the generated files to standard output to inform the build + # system which files it needs to handle during installation. + printf '%s/%s\n' "${PWD##*/}" "${dst}" +done diff --git a/schiff/hooks/xx-sign-archives.sh b/schiff/hooks/xx-sign-archives.sh @@ -0,0 +1,36 @@ +#!/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/>. + +set -e + +find downloads \ + -name "*.tar" \ + -o -name "*.tar.gz" \ + -o -name "*.tgz" \ + -o -name "*.zip" \ +| while read -r i; do + + sign="${i}.sig" + + >&2 printf 'Signing %s\n' "${i}" + gpg --yes -a -o "${sign}" --detach-sign "${i}" + + # Write the generated files to standard output to inform the build + # system which files it needs to handle during installation. + printf '%s/%s\n' "${PWD##*/}" "${i}.sig" + +done diff --git a/schiff/index.tsv b/schiff/index.tsv @@ -0,0 +1,4 @@ +Overview schiff.html +Manual pages schiff-docs.html +Downloads schiff-downloads.html +Git https://gitlab.com/meso-star/schiff diff --git a/schiff/schiff-downloads.sh b/schiff/schiff-downloads.sh @@ -0,0 +1,30 @@ +#!/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.sh.in" +. "../meso-web.sh" + +set -e + +# Title +echo '# Downloads' + +# List of archives to download +print_downloads "${PWD%%*/}" Schiff Linux + +# Release notes +sed -n '/^## Release notes/,/^## License/p' "${readme}" | sed '$d' diff --git a/schiff/schiff.sh b/schiff/schiff.sh @@ -0,0 +1,20 @@ +#!/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.sh.in" + +sed "s/@VERSION@/${version}/g" schiff.md.in | md2html diff --git a/schiff/schiff_build.sh b/schiff/schiff_build.sh @@ -1,59 +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 - -overview() -{ - if [ $# -lt 1 ]; then - printf "Usage: %s overview <version>\n" "$0" >&2 - exit 1 - fi - - print_header -s Schiff -n Overview -r ../ - sed "s/@VERSION@/$1/g" | md2html - print_footer -} - -documentations() -{ - print_header -s Schiff -n Documentations -r ../ - md2html schiff-docs.md - print_footer -} - -downloads() -{ - print_header -s Schiff -n Downloads -r ../ - md2html schiff-downloads.md - print_footer -} - -downloads2() -{ - if [ $# -lt 1 ]; then - printf "Usage: %s downloads <readme>\n" "$0" >&2 - exit 1 - fi - - printf '# Downloads\n' - print_downloads Schiff "Linux" - printf '\n' - sed -n '/^## Release notes/,/^## License/p' "$1" | sed '$d' -} - -"$@"