#!/bin/sh # Didier Spaier didieratslintdotfr VERSION=15.0 PKG="slint-docs" rm -rf pkg mkdir pkg TAG=slint BUILD=10 ARCH="noarch" PKGNAME="${PKG}-${VERSION}-${ARCH}-${BUILD}$TAG" CWD=$(pwd) TARGET="$CWD"/pkg/usr/doc/slint-"${VERSION}" mkdir -p "$TARGET" mkdir -p "$CWD"/pkg/usr/bin mkdir -p "$CWD"/pkg/install mkdir -p "$CWD"/pkg/usr/share/applications cp "$CWD"/start-slint-doc "$CWD"/pkg/usr/bin || exit cp "$CWD"/slint-documentation.desktop "$CWD"/pkg/usr/share/applications/ || exit SLINTDOCS=/data/github/slint-translations asciidoctor "$SLINTDOCS"/sources/HandBook/HandBook.adoc -o "$TARGET"/en_US.HandBook.html exit cp "$SLINTDOCS"/sources/HandBook/HandBook.adoc "$TARGET"/ cd "$SLINTDOCS"/HandBook || exit for handbookpo in *.HandBook.po; do ll_TT="${handbookpo%.*.*}" po4a-translate -M UTF-8 -m "$SLINTDOCS"/sources/HandBook/HandBook.adoc -f asciidoc -p "$handbookpo" -l "$TARGET"/"${ll_TT}".HandBook.adoc asciidoctor "$TARGET"/"${ll_TT}".HandBook.adoc -o "$TARGET"/"${ll_TT}".HandBook.html done rm "$TARGET"/*.adoc # shellcheck disable=SC2016 echo '#!/bin/sh (cd /usr/doc/slint-15.0 if [ "$(tty|grep tty)" ]; then if ls | grep -q ${LANG%.*}; then w3m -o confirm_qq=0 ${LANG%.*}.HandBook.html else w3m -o confirm_qq=0 en_US.HandBook.html fi else if ls | grep -q ${LANG%.*}; then firefox ${LANG%.*}.HandBook.html else firefox en_US.HandBook.html fi fi )'>"$CWD"/pkg/usr/bin/slint-doc chmod -R 755 "$CWD"/pkg/usr/bin chmod 755 "$CWD"/pkg/usr/share/applications chmod 644 "$CWD"/pkg/usr/share/applications/slint-documentation.desktop (cd "$CWD"/pkg cat << EOF > install/slack-desc # |-----handy-ruler------------------------------------------------------| slint-docs: slint-doc (documentation about Slint). slint-docs: slint-docs: Visit our website: http://slint.fr slint-docs: slint-docs: slint-docs: slint-docs: slint-docs: slint-docs: slint-docs: slint-docs: EOF /sbin/makepkg -l y -c n ../"${PKGNAME}".txz )