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 49a5873cd2529608ff3361e6ad790126a42d3ead
parent 8ee98c7eae7d8551477ac8077d41df8a48f47acc
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue,  5 Dec 2017 16:08:50 +0100

Add the star-engine script

Diffstat:
M.gitignore | 2++
MMakefile | 19+++++++++++++------
Mmeso-menu.sh | 40+++++++++++++++++++++++++++++++++++-----
Mmisc.sh | 8--------
Mschiff.sh | 1+
Msolstice.sh | 2+-
Mstar-engine.html.in | 6+++---
Astar-engine.sh | 106+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8 files changed, 161 insertions(+), 23 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -8,6 +8,8 @@ solstice.html solstice-downloads.html solstice-resources.html star-engine.html +star-engine-downloads.html +star_engine_release_notes.html.in downloads/ *.sw[po] *.[ao] diff --git a/Makefile b/Makefile @@ -20,17 +20,16 @@ SOLSTICE-PP=~/code/meso-star/solstice-scripts/ SCHIFF-VERSION=0.3.1 SCHIFF-SCRIPTS=~/code/meso-star/schiff-scripts/src/ +STAR-ENGINE-VERSION=0.5.0 +STAR-ENGINE-README=~/code/star-engine/README.md + REMOTE=OVH:www/projects/ .PHONY: default default: all .PHONY: all -all: misc solstice schiff - -.PHONY: solstice -solstice: - @sh ./solstice.sh $(SOLSTICE-VERSION) $(SOLSTICE-ABG) $(SOLSTICE-PP) +all: misc solstice schiff star-engine .PHONY: clean clean: @@ -71,11 +70,19 @@ publish: $(REMOTE)/downloads/ rsync -avzr man $(REMOTE) +.PHONY: star-engine +star-engine: + @sh star-engine.sh $(STAR-ENGINE-VERSION) $(STAR-ENGINE-README) + .PHONY: schiff schiff: schiff.html.in @sh schiff.sh $(SCHIFF-VERSION) $(SCHIFF-SCRIPTS) +.PHONY: solstice +solstice: + @sh solstice.sh $(SOLSTICE-VERSION) $(SOLSTICE-ABG) $(SOLSTICE-PP) + .PHONY: misc -misc: +misc: @sh misc.sh diff --git a/meso-menu.sh b/meso-menu.sh @@ -115,6 +115,33 @@ print_solstice_sub_menu() { echo ' </div>' } + +print_star_engine_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}star-engine.html>Overview</a></li>" + fi + if [ "$name" == "Downloads" ]; then + echo ' <li id=cur>Downloads</li>' + else + echo " <li><a href=${root}star-engine-downloads.html>Downloads</a></li>" + fi + echo " <li><a href=https://gitlab.com/meso-star/star-engine>Repository</a></li>" + echo ' </ul>' + echo ' <div id="info">' + echo ' <p>Star-Engine is copyright &#169; <a' + echo ' href="https://www.meso-star.com">|Méso|Star&gt;</a>' + echo ' 2015-2017.</p>' + echo ' </div>' + echo ' </div>' +} + print_header() { local section=$1 local name=${2#man-} @@ -157,6 +184,7 @@ print_header() { fi 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.html>Star-Engine</a></h2>" fi @@ -176,6 +204,8 @@ print_footer() { } print_downloads() { + prefix=$1 + echo '<table>' echo ' <tr>' echo ' <th>Version</th>' @@ -184,15 +214,15 @@ print_downloads() { echo ' <th>Sources</th>' echo ' </tr>' - local archs=$(find downloads -regex ".*/Solstice-[0-9]+\.[0-9]+\.[0-9]+-.*tar.gz" | sort -r ) + local archs=$(find downloads -regex ".*/$prefix-[0-9]+\.[0-9]+\.[0-9]+-.*tar.gz" | sort -r ) local arch; for arch in $archs; do - local version=$(echo $arch | sed 's/.*Solstice-\([0-9]\+.[0-9]\+.[0-9]\+\)-.*/\1/g') + local version=$(echo $arch | sed "s/.*${prefix}-\([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" + "downloads/${prefix}-${version}-GNU-Linux64.tar.gz" + "downloads/${prefix}-${version}-Win64.zip" + "downloads/${prefix}-${version}-Source.zip" ) echo " <tr>" diff --git a/misc.sh b/misc.sh @@ -34,14 +34,6 @@ echo "Write stardis.html" print_footer } > stardis.html -echo "Write star-engine.html" -{ - print_header Star-Engine dummy - cat star-engine.html.in - print_footer -} > star-engine.html - - echo "Write pgp_signatures.html" { print_header PGP dummy diff --git a/schiff.sh b/schiff.sh @@ -134,3 +134,4 @@ for((i=0; i<${#schiff_man_pages[@]}; ++i)); do done +echo "" diff --git a/solstice.sh b/solstice.sh @@ -187,7 +187,7 @@ echo "Write solstice-downloads.html" { print_header Solstice Downloads; echo '<header><h1>Downloads</h1></header>'; - print_downloads; + print_downloads Solstice; cat release_notes.html.in; print_footer; } > solstice-downloads.html; diff --git a/star-engine.html.in b/star-engine.html.in @@ -3,7 +3,7 @@ </header> <div id="news"> - <p><b>Star-Engine ${VERSION} is available</b></p> + <p><b>Download Star-Engine ${VERSION}</b></p> <ul> <li>GNU/Linux: <a href="downloads/Star-Engine-${VERSION}-GNU-Linux64.tar.gz">tarball</a> / @@ -14,8 +14,8 @@ </ul> <ul> <li>Sources: - <a href="downloads/Star-Engine-${VERSION}-Sources.zip">zip</a> / - <a href="downloads/Star-Engine-${VERSION}-Sources.zip.sig">pgp</a></li> + <a href="downloads/Star-Engine-${VERSION}-Source.zip">zip</a> / + <a href="downloads/Star-Engine-${VERSION}-Source.zip.sig">pgp</a></li> </ul> </div> diff --git a/star-engine.sh b/star-engine.sh @@ -0,0 +1,106 @@ +#!/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 ./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 + +set +e +if hash markdown 2> /dev/null; then + markdown=markdown +elif hash markdown2 2> /dev/null; then + markdown=markdown2 +else + echo "Cannot find the markdown[2] command" + exit 1 +fi +set -e + +################################################################################ +# 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 + +################################################################################ +# Generate the overview page +################################################################################ +echo "Write star-engine.html" +{ + print_header Star-Engine Overview + VERSION=$1 envsubst < star-engine.html.in + print_footer +} > star-engine.html + +################################################################################ +# Generate the Downloads page +################################################################################ +echo "Write star-engine-downloads.html" +{ + print_header Star-Engine Downloads; + echo '<header><h1>Downloads</h1></header>'; + print_downloads Star-Engine; + cat star_engine_release_notes.html.in; + print_footer; +} > star-engine-downloads.html; + +echo "" +