From 190d9f37bddd6f223f1c46d9193b59e95672c575 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Thu, 7 Dec 2023 13:58:57 +0100 Subject: [PATCH] packages: also ship website tarball. Signed-off-by: Denis 'GNUtoo' Carikli Acked-by: Adrien 'neox' Bourmault --- Makefile | 1 + resources/dependencies/pureos-10 | 3 ++ resources/packages/website/distclean | 39 ++++++++++++++++++++ resources/packages/website/download | 49 +++++++++++++++++++++++++ resources/packages/website/release | 54 ++++++++++++++++++++++++++++ tests/lint | 1 + website-build/build.sh | 17 +++++++-- 7 files changed, 161 insertions(+), 3 deletions(-) create mode 100755 resources/packages/website/distclean create mode 100755 resources/packages/website/download create mode 100755 resources/packages/website/release diff --git a/Makefile b/Makefile index eda15fb..45375a0 100644 --- a/Makefile +++ b/Makefile @@ -45,6 +45,7 @@ roms: release: ./build release src ./build release roms + ./build release website clean: ./build clean cbutils diff --git a/resources/dependencies/pureos-10 b/resources/dependencies/pureos-10 index 703028e..0d28dcd 100755 --- a/resources/dependencies/pureos-10 +++ b/resources/dependencies/pureos-10 @@ -104,3 +104,6 @@ pkcon -y --allow-reinstall install libpci-dev pciutils zlib1g-dev libftdi-dev bu # ---------------------- pkcon -y --allow-reinstall install shellcheck # lint pkcon -y --allow-reinstall install gawk git grep lzip make sed tar xz-utils # u-boot-libre + +# For building the website tarball +pkcon -y --allow-reinstall install pandoc diff --git a/resources/packages/website/distclean b/resources/packages/website/distclean new file mode 100755 index 0000000..37dd772 --- /dev/null +++ b/resources/packages/website/distclean @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2023 Denis 'GNUtoo' Carikli +# +# 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 . + +# shellcheck source=resources/scripts/tasks/distclean.sh +. "$(dirname "$0")"/../../scripts/tasks/distclean.sh + +distclean_website() +{ + rm -rf \ + website-build/aclocal.m4 \ + website-build/autom4te.cache/ \ + website-build/config.log \ + website-build/config.status \ + website-build/configure \ + website-build/deploy/ \ + website-build/install-sh \ + website-build/Makefile \ + website-build/Makefile.in \ + website-build/missing \ + website-build/untitled/ \ + website-build/website.tar.gz +} + +# shellcheck disable=SC2068 +distclean_main distclean_website $@ diff --git a/resources/packages/website/download b/resources/packages/website/download new file mode 100755 index 0000000..8a3e80e --- /dev/null +++ b/resources/packages/website/download @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +# Copyright (C) 2023 Denis 'GNUtoo' Carikli +# +# 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 . + +. resources/scripts/misc/sysexits.sh + +progname="resources/packages/website/release" + +set -e + +usage() +{ + progname="$1" + + printf "Usage: %s [options]\n\n" "${progname}" + printf "Available options:\n" + printf "\t-h, --help\n" + printf "\t\tDisplay this help and exit.\n" +} + +download_untitled() +{ + cd website-build + ./autogen.sh + ./configure --disable-guix --disable-lighttpd + ./build.sh --download-only +} + +if [ $# -eq 1 ] && { [ "$1" = "-h" ] || [ "$1" == "--help" ] ;} ; then + usage "${progname}" + exit 0 +elif [ $# -eq 0 ] ; then + download_untitled +else + usage "${progname}" + exit ${EX_USAGE} +fi diff --git a/resources/packages/website/release b/resources/packages/website/release new file mode 100755 index 0000000..2e0d8e9 --- /dev/null +++ b/resources/packages/website/release @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# Copyright (C) 2023 Denis 'GNUtoo' Carikli +# +# 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 . + +. resources/scripts/misc/sysexits.sh + +progname="resources/packages/website/release" + +set -e + +usage() +{ + progname="$1" + + printf "Usage: %s [options]\n\n" "${progname}" + printf "Available options:\n" + printf "\t-h, --help\n" + printf "\t\tDisplay this help and exit.\n" +} + +build_website() +{ + version="$(git --no-pager describe --tags HEAD)" + + cd website-build + ./autogen.sh + ./configure --disable-guix --disable-lighttpd + make website.tar.gz + + install -d ../release + install -m 644 website.tar.gz ../release/gnuboot-website-"${version}".tar.gz +} + +if [ $# -eq 1 ] && { [ "$1" = "-h" ] || [ "$1" == "--help" ] ;} ; then + usage "${progname}" + exit 0 +elif [ $# -eq 0 ] ; then + build_website +else + usage "${progname}" + exit ${EX_USAGE} +fi diff --git a/tests/lint b/tests/lint index 88cc4d6..b26086e 100755 --- a/tests/lint +++ b/tests/lint @@ -58,6 +58,7 @@ run_shellcheck \ resources/packages/src/distclean \ resources/packages/u-boot-libre/distclean \ resources/packages/u-boot/distclean \ + resources/packages/website/distclean \ resources/scripts/tasks/distclean.sh \ tests/distclean \ tests/lint diff --git a/website-build/build.sh b/website-build/build.sh index 83776cf..21605c3 100755 --- a/website-build/build.sh +++ b/website-build/build.sh @@ -32,6 +32,10 @@ help() echo -e "\t\tUse a local untitled directory from PATH\n" \ "\t\tinstead of downloading the latest version from\n" \ "\t\t${untitled_uri}" + echo -e "\t--download-only" + echo -e "\t\tOnly download and setup Untitled. Does not build the" + echo -e "\t\twebsite." + } sync_repo() @@ -89,6 +93,7 @@ help_missing_arg() help } +download_only=0 i=1 while [ "$i" -le $# ] ; do opt="$(eval echo \$$i)" @@ -98,6 +103,9 @@ while [ "$i" -le $# ] ; do help exit 0 ;; + --download-only) + download_only=1 + ;; --with-untitled-path) if [ "$i" -ge $# ] ; then help_missing_arg "--with-untitled-path" @@ -119,7 +127,10 @@ set -e sync_repo "untitled" \ "${untitled_uri}" "${untitled_path}" "${untitled_commit}" -copy_website "untitled/www/lbwww/" -cd untitled -./build sites lbwww +if [ "${download_only}" -eq 0 ] ; then + copy_website "untitled/www/lbwww/" + + cd untitled + ./build sites lbwww +fi