From b7cdf0c3a39587186fc613fb63c7967f28ac846c Mon Sep 17 00:00:00 2001 From: fsLeg Date: Sat, 30 Aug 2025 00:07:18 +0300 Subject: [PATCH] hugo: added --- hugo/README | 26 +++++++++ hugo/hugo.SlackBuild | 128 +++++++++++++++++++++++++++++++++++++++++++ hugo/hugo.info | 12 ++++ hugo/mkvendor.sh | 43 +++++++++++++++ hugo/slack-desc | 19 +++++++ 5 files changed, 228 insertions(+) create mode 100644 hugo/README create mode 100644 hugo/hugo.SlackBuild create mode 100644 hugo/hugo.info create mode 100644 hugo/mkvendor.sh create mode 100644 hugo/slack-desc diff --git a/hugo/README b/hugo/README new file mode 100644 index 0000000..c687ef5 --- /dev/null +++ b/hugo/README @@ -0,0 +1,26 @@ +Hugo is a static HTML and CSS website generator written in Go. It is +optimized for speed, ease of use, and configurability. Hugo takes a +directory with content and templates and renders them into a full HTML +website. + +Hugo relies on Markdown files with front matter for metadata, and you +can run Hugo from any directory. This works well for shared hosts and +other systems where you don’t have a privileged account. + +Hugo renders a typical website of moderate size in a fraction of a +second. A good rule of thumb is that each piece of content renders in +around 1 millisecond. + +Hugo is designed to work well for any kind of website including blogs, +tumbles, and docs. + +By default the extended version with deployment support is built. The +extended version adds support for WebP image encoding and SASS +processing. The deployment support allows you to deploy your website to +Amazon S3, Azure Blob Storage, or Google Cloud Storage. To build just +the core version use: + + EXTENDED=no DEPLOY=no ./hugo.SlackBuild + +dart-sass is an optional runtime dependency. It'll be used for SASS +processing regardless of version built. diff --git a/hugo/hugo.SlackBuild b/hugo/hugo.SlackBuild new file mode 100644 index 0000000..7d34604 --- /dev/null +++ b/hugo/hugo.SlackBuild @@ -0,0 +1,128 @@ +#!/bin/bash + +# Slackware build script for hugo + +# Copyright 2025 Vladislav 'fsLeg' Borisov, Moscow, Russia +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=hugo +VERSION=${VERSION:-0.149.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" +elif [ "$ARCH" = "aarch64" ]; then + SLKCFLAGS="-O2 -fPIC" +else + SLKCFLAGS="-O2" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +tar xf $CWD/$PRGNAM-$VERSION-vendored-sources.tar.xz +chown -R root:root . + +if [ "${EXTENDED:-yes}" = "yes" ] || [ "${DEPLOY:-yes}" = "yes" ]; then + TAGS="-tags " + if [ "${EXTENDED:-yes}" = "yes" ]; then + TAGS+="extended," + fi + if [ "${DEPLOY:-yes}" = "yes" ]; then + TAGS+="withdeploy" + fi +fi + +CGO_ENABLED=1 \ +CGO_CPPFLAGS="${SLKCFLAGS}" \ +CGO_CFLAGS="${SLKCFLAGS}" \ +CGO_CXXFLAGS="${SLKCFLAGS}" \ +GOPATH=$(pwd)/gocache \ +GOCACHE=$(pwd)/gocache \ +go build -v \ + $TAGS \ + -buildvcs=false \ + -buildmode=pie \ + -mod=readonly \ + -mod=vendor \ + -modcacherw \ + -ldflags "-compressdwarf=false \ + -linkmode external \ + -extldflags '${LDFLAGS}'" + +mkdir -p $PKG/usr/bin \ + $PKG/usr/man/man1 \ + $PKG/usr/doc/$PRGNAM-$VERSION \ + $PKG/usr/share/bash-completion/completions \ + $PKG/usr/share/fish/vendor_completions.d \ + $PKG/usr/share/zsh/site-functions +./hugo gen man --dir $PKG/usr/man/man1 +./hugo gen doc --dir $PKG/usr/doc/$PRGNAM-$VERSION +./hugo completion bash > $PKG/usr/share/bash-completion/completions/$PRGNAM +./hugo completion fish > $PKG/usr/share/fish/vendor_completions.d/$PRGNAM.fish +./hugo completion zsh > $PKG/usr/share/zsh/site-functions/_$PRGNAM +install -Dm755 -t $PKG/usr/bin hugo + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +cp -a \ + CONTRIBUTING.md LICENSE README.md SECURITY.md \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/hugo/hugo.info b/hugo/hugo.info new file mode 100644 index 0000000..16e4fa9 --- /dev/null +++ b/hugo/hugo.info @@ -0,0 +1,12 @@ +PRGNAM="hugo" +VERSION="0.149.0" +HOMEPAGE="https://gohugo.io/" +DOWNLOAD="https://github.com/gohugoio/hugo/archive/v0.149.0/hugo-0.149.0.tar.gz \ + https://sbo.t-rg.ws/hugo-0.149.0-vendored-sources.tar.xz" +MD5SUM="aaef840fe6d8057b7e7695c34ae11ba9 \ + a99b2b03c4dc02337f2102c420543ad1" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="google-go-lang" +MAINTAINER="Vladislav 'fsLeg' Borisov" +EMAIL="fsleg@t-rg.ws" diff --git a/hugo/mkvendor.sh b/hugo/mkvendor.sh new file mode 100644 index 0000000..f206e87 --- /dev/null +++ b/hugo/mkvendor.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +set -e + +CWD="$(pwd)" +TMP="${TMP:-$(mktemp -d)}" +. "$CWD/hugo.info" +OUTPUT="${OUTPUT:-$CWD}" +export GOPATH="$TMP/cache" +export GOCACHE="$TMP/cache" + +tar xf "$CWD/$PRGNAM-$VERSION.tar.gz" -C "$TMP" +cd "$TMP/$PRGNAM-$VERSION" + +go mod vendor + +# libwebp-1.3.2 is the one in Slackware 15, newer ones don't compile +if [ -e "$CWD/libwebp-1.3.2.tar.gz" ]; then + cp "$CWD/libwebp-1.3.2.tar.gz" "$TMP/" +else + wget --directory-prefix="$TMP" --tries=0 --retry-on-http-error=503 "https://github.com/webmproject/libwebp/archive/v1.3.2/libwebp-v1.3.2.tar.gz" +fi +tar xf "$TMP/libwebp-1.3.2.tar.gz" -C .. +mv "$TMP/libwebp-1.3.2" vendor/github.com/bep/gowebp/libwebp_src + +# libsass is deprecated, 3.6.6 is the last release +if [ -e "$CWD/libsass-3.6.6.tar.gz" ]; then + cp "$CWD/libsass-3.6.6.tar.gz" "$TMP/" +else + wget --directory-prefix="$TMP" --tries=0 --retry-on-http-error=503 "https://github.com/sass/libsass/archive/3.6.6/libsass-3.6.6.tar.gz" +fi +tar xf "$TMP/libsass-3.6.6.tar.gz" -C .. +mv "$TMP/libsass-3.6.6" vendor/github.com/bep/golibsass/libsass_src + +if [ -f "$OUTPUT/$PRGNAM-$VERSION-vendored-sources.tar" ]; then + rm "$OUTPUT/$PRGNAM-$VERSION-vendored-sources.tar" +fi + +tar cfJ "$OUTPUT/$PRGNAM-$VERSION-vendored-sources.tar.xz" vendor/ + +go clean -cache -modcache +cd "$CWD" +rm -rf "$TMP" diff --git a/hugo/slack-desc b/hugo/slack-desc new file mode 100644 index 0000000..f7eafa6 --- /dev/null +++ b/hugo/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +hugo: hugo (static HTML and CSS website generator written in Go) +hugo: +hugo: Hugo is a static HTML and CSS website generator written in Go. It is +hugo: optimized for speed, ease of use, and configurability. Hugo takes a +hugo: directory with content and templates and renders them into a full +hugo: HTML website. +hugo: +hugo: Homepage: https://gohugo.io +hugo: +hugo: +hugo: -- 2.46.4