1
Fork 0

Move to binary hugo build

This commit is contained in:
Joshua Goins 2024-12-30 21:39:41 -05:00
parent 639b528cd8
commit e4b15d5593
10 changed files with 27 additions and 603 deletions

View file

@ -1,94 +0,0 @@
# Generated by go2rpm 1.15.0
%bcond check 1
%bcond bootstrap 0
%if %{with bootstrap}
%global debug_package %{nil}
%endif
%if %{with bootstrap}
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^golang\\(.*\\)$
%endif
# https://github.com/bep/imagemeta
%global goipath github.com/bep/imagemeta
Version: 0.8.3
# REMOVE BEFORE SUBMITTING THIS FOR REVIEW
# ---
# New Fedora packages should use %%gometa -f, which makes the package
# ExclusiveArch to %%golang_arches_future and thus excludes the package from
# %%ix86. If the new package is needed as a dependency for another package,
# please consider removing that package from %%ix86 in the same way, instead of
# building more go packages for i686. If your package is not a leaf package,
# you'll need to coordinate the removal of the package's dependents first.
# ---
# REMOVE BEFORE SUBMITTING THIS FOR REVIEW
%gometa -L -f
%global common_description %{expand:
Go library for reading EXIF, IPTC and XMP image meta data from JPEG, TIFF, PNG,
and WebP files.}
%global golicenses LICENSE
%global godocs README.md
Name: golang-github-bep-imagemeta
Release: %autorelease
Summary: Go library for reading EXIF, IPTC and XMP image meta data from JPEG, TIFF, PNG, and WebP files
License: MIT
URL: %{gourl}
Source: %{gosource}
%description %{common_description}
%gopkg
%prep
%goprep -A
%autopatch -p1
%if %{without bootstrap}
%generate_buildrequires
%go_generate_buildrequires
%endif
%if %{without bootstrap}
%build
for cmd in gen; do
%gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
done
%endif
%install
%gopkginstall
%if %{without bootstrap}
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
install -m 0775 -p %{gosourcedir}/metadecoder_iptc_fields.json %{buildroot}%{_datadir}/gocode/src/github.com/bep/imagemeta/metadecoder_iptc_fields.json
%endif
%if %{without bootstrap}
%if %{with check}
%check
%gocheck
%endif
%endif
%files
%license LICENSE
%doc README.md
# REMOVE BEFORE SUBMITTING THIS FOR REVIEW
# ---
# New Fedora packages should not use globs to avoid installing conflicting
# binaries.
# Write a _bindir line per each of the binaries the package will install.
# ---
# REMOVE BEFORE SUBMITTING THIS FOR REVIEW
%{_bindir}/*
%gopkgfiles
%{_datadir}/gocode/src/github.com/bep/imagemeta/metadecoder_iptc_fields.json
%changelog
%autochangelog

View file

@ -1,57 +0,0 @@
# Generated by go2rpm
%bcond_without check
%global debug_package %{nil}
# https://github.com/bep/gitmap
%global goipath github.com/bep/gitmap
Version: 1.6.0
%gometa
%global godevelheader %{expand:
Requires: git-core}
%global common_description %{expand:
A fairly fast way to create a map from all the filenames to info objects for a
given revision of a Git repo.
This library uses os/exec to talk to Git. There are faster ways to do this by
using some Go Git-lib or C bindings, but that adds dependencies I really don't
want or need.}
%global golicenses LICENSE
%global godocs README.md
Name: %{goname}
Release: %autorelease
Summary: Create map from filename to info object from revision of a repo
License: MIT
URL: %{gourl}
Source0: %{gosource}
BuildRequires: git-core
%description
%{common_description}
%gopkg
%prep
%goprep
%install
%gopkginstall
%if %{with check}
%check
# .: Skip tests that require execution from Git repository.
%gocheck \
-d .
%endif
%gopkgfiles
%changelog
%autochangelog

View file

@ -1,66 +0,0 @@
# Generated by go2rpm 1.15.0
%bcond check 1
%bcond bootstrap 0
%global debug_package %{nil}
%if %{with bootstrap}
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^golang\\(.*\\)$
%endif
# https://github.com/gohugoio/hashstructure
%global goipath github.com/gohugoio/hashstructure
Version: 0.1.0
# REMOVE BEFORE SUBMITTING THIS FOR REVIEW
# ---
# New Fedora packages should use %%gometa -f, which makes the package
# ExclusiveArch to %%golang_arches_future and thus excludes the package from
# %%ix86. If the new package is needed as a dependency for another package,
# please consider removing that package from %%ix86 in the same way, instead of
# building more go packages for i686. If your package is not a leaf package,
# you'll need to coordinate the removal of the package's dependents first.
# ---
# REMOVE BEFORE SUBMITTING THIS FOR REVIEW
%gometa -L -f
%global common_description %{expand:
Get hash values for arbitrary values in Go (golang).}
%global golicenses LICENSE
%global godocs README.md
Name: golang-github-gohugoio-hashstructure
Release: %autorelease
Summary: Get hash values for arbitrary values in Go (golang)
License: MIT
URL: %{gourl}
Source: %{gosource}
%description %{common_description}
%gopkg
%prep
%goprep -A
%autopatch -p1
%if %{without bootstrap}
%generate_buildrequires
%go_generate_buildrequires
%endif
%install
%gopkginstall
%if %{without bootstrap}
%if %{with check}
%check
%gocheck
%endif
%endif
%gopkgfiles
%changelog
%autochangelog

View file

@ -1,67 +0,0 @@
# Generated by go2rpm 1.15.0
%bcond check 1
%bcond bootstrap 0
%global debug_package %{nil}
%if %{with bootstrap}
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^golang\\(.*\\)$
%endif
# https://github.com/gohugoio/httpcache
%global goipath github.com/gohugoio/httpcache
Version: 0.7.0
# REMOVE BEFORE SUBMITTING THIS FOR REVIEW
# ---
# New Fedora packages should use %%gometa -f, which makes the package
# ExclusiveArch to %%golang_arches_future and thus excludes the package from
# %%ix86. If the new package is needed as a dependency for another package,
# please consider removing that package from %%ix86 in the same way, instead of
# building more go packages for i686. If your package is not a leaf package,
# you'll need to coordinate the removal of the package's dependents first.
# ---
# REMOVE BEFORE SUBMITTING THIS FOR REVIEW
%gometa -L -f
%global common_description %{expand:
A Transport for http.Client that will cache responses according to the HTTP
RFC.}
%global golicenses LICENSE.txt
%global godocs README.md
Name: golang-github-gohugoio-httpcache
Release: %autorelease
Summary: A Transport for http.Client that will cache responses according to the HTTP RFC
License: MIT
URL: %{gourl}
Source: %{gosource}
%description %{common_description}
%gopkg
%prep
%goprep -A
%autopatch -p1
%if %{without bootstrap}
%generate_buildrequires
%go_generate_buildrequires
%endif
%install
%gopkginstall
%if %{without bootstrap}
%if %{with check}
%check
%gocheck
%endif
%endif
%gopkgfiles
%changelog
%autochangelog

View file

@ -1,50 +0,0 @@
# Generated by go2rpm 1.10.0
%bcond_without check
%global debug_package %{nil}
# https://github.com/gohugoio/hugo-goldmark-extensions
%global goipath github.com/gohugoio/hugo-goldmark-extensions
Version: 0.3.0
%global tag passthrough/v0.3.0
%global distprefix %{nil}
%gometa -L -f
%global common_description %{expand:
A collection of Goldmark extensions created by the Hugo community.}
%global golicenses LICENSE
%global godocs README.md
Name: golang-github-gohugoio-hugo-goldmark-extensions
Release: %autorelease
Summary: A collection of Goldmark extensions created by the Hugo community
License: Apache-2.0
URL: %{gourl}
Source: %{gosource}
%description %{common_description}
%gopkg
%prep
%goprep -A
%generate_buildrequires
%go_generate_buildrequires
%install
%gopkginstall
%if %{with check}
%check
# passthrough: fails on Rawhide.
%gocheck \
-d passthrough
%endif
%gopkgfiles
%changelog
%autochangelog

View file

@ -1,91 +0,0 @@
# Generated by go2rpm 1.15.0
%bcond check 1
%bcond bootstrap 0
%if %{with bootstrap}
%global debug_package %{nil}
%endif
%if %{with bootstrap}
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^golang\\(.*\\)$
%endif
# https://github.com/tetratelabs/wazero
%global goipath github.com/tetratelabs/wazero
Version: 1.8.2
# REMOVE BEFORE SUBMITTING THIS FOR REVIEW
# ---
# New Fedora packages should use %%gometa -f, which makes the package
# ExclusiveArch to %%golang_arches_future and thus excludes the package from
# %%ix86. If the new package is needed as a dependency for another package,
# please consider removing that package from %%ix86 in the same way, instead of
# building more go packages for i686. If your package is not a leaf package,
# you'll need to coordinate the removal of the package's dependents first.
# ---
# REMOVE BEFORE SUBMITTING THIS FOR REVIEW
%gometa -L -f
%global common_description %{expand:
Wazero: the zero dependency WebAssembly runtime for Go developers.}
%global golicenses LICENSE NOTICE
Name: golang-github-tetratelabs-wazero
Release: %autorelease
Summary: Wazero: the zero dependency WebAssembly runtime for Go developers
License: Apache-2.0
URL: %{gourl}
Source: %{gosource}
%description %{common_description}
%gopkg
%prep
%goprep -A
%autopatch -p1
%if %{without bootstrap}
%generate_buildrequires
%go_generate_buildrequires
%endif
%if %{without bootstrap}
%build
for cmd in cmd/* ; do
%gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
done
%endif
%install
%gopkginstall
%if %{without bootstrap}
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
%endif
%if %{without bootstrap}
%if %{with check}
%check
# check fials
%endif
%endif
%if %{without bootstrap}
%files
# REMOVE BEFORE SUBMITTING THIS FOR REVIEW
# ---
# New Fedora packages should not use globs to avoid installing conflicting
# binaries.
# Write a _bindir line per each of the binaries the package will install.
# ---
# REMOVE BEFORE SUBMITTING THIS FOR REVIEW
%{_bindir}/*
%endif
%gopkgfiles
%changelog
%autochangelog

27
hugo.spec Normal file
View file

@ -0,0 +1,27 @@
# no, this isn't built from source because there is like a hundred go packages and I gave up halfway through updating them
%global debug_package %{nil}
Name: hugo
Version: 0.140.2
Release: 4%{?dist}
Summary: The worlds fastest framework for building websites.
License: Apache-2.0
URL: https://github.com/gohugoio/hugo
Source0: https://github.com/gohugoio/hugo/releases/download/v%{version}/hugo_extended_%{version}_Linux-64bit.tar.gz
%description
The worlds fastest framework for building websites.
%prep
%setup -q -c -n hugo
%install
install -m 755 -D hugo %{buildroot}%{_bindir}/hugo
%files
%{_bindir}/hugo
%changelog
%autochangelog

View file

@ -1,25 +0,0 @@
setting SOURCE_DATE_EPOCH=1735516800
Executing(%mkbuilddir): /bin/sh -e /var/tmp/rpm-tmp.NuoLXj
+ umask 022
+ cd /home/josh/sources/copr/hugo/hugo-0.126.2-build
+ test -d /home/josh/sources/copr/hugo/hugo-0.126.2-build
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w /home/josh/sources/copr/hugo/hugo-0.126.2-build
+ /usr/bin/rm -rf /home/josh/sources/copr/hugo/hugo-0.126.2-build
+ /usr/bin/mkdir -p /home/josh/sources/copr/hugo/hugo-0.126.2-build
+ /usr/bin/mkdir -p /home/josh/sources/copr/hugo/hugo-0.126.2-build/SPECPARTS
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.0AMPFa
+ umask 022
+ cd /home/josh/sources/copr/hugo/hugo-0.126.2-build
+ cd /home/josh/sources/copr/hugo/hugo-0.126.2-build
+ rm -rf hugo-0.126.2
+ /usr/lib/rpm/rpmuncompress -x /home/josh/sources/copr/hugo/hugo-0.126.2.tar.gz
error: File /home/josh/sources/copr/hugo/hugo-0.126.2.tar.gz: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.0AMPFa (%prep)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.0AMPFa (%prep)

View file

@ -1,11 +0,0 @@
diff -u --recursive hugo-0.93.3-vanilla/modules/client_test.go hugo-0.93.3/modules/client_test.go
--- hugo-0.93.3-vanilla/modules/client_test.go 2022-03-08 04:15:27.000000000 -0600
+++ hugo-0.93.3/modules/client_test.go 2022-03-08 20:11:16.719396644 -0600
@@ -33,6 +33,7 @@
)
func TestClient(t *testing.T) {
+ t.Skip("skip test as network access is not allowed during package build")
modName := "hugo-modules-basic-test"
modPath := "github.com/gohugoio/tests/" + modName
defaultImport := "modh2_2"

View file

@ -1,142 +0,0 @@
%bcond_without check
# Some tests use a package that uses this.
%bcond_with bootstrap
# The output from a standard Hugo package build can be overwhelming when
# trying to diagnose package build errors. A less verbose follow up
# is:
#
# 1. Run "rpmbuild -ba hugo.spec >/tmp/LOG 2>&1" to capture all of
# the output.
#
# 2. Look for the command "go build ..." in that output.
#
# 3. Enter the BUILD/hugo-VERSION directory.
#
# 4. Export the two variables set before "go build ...".
#
# 5. Run the "go build ..." command, but without the "-v" and "-x".
# https://github.com/gohugoio/hugo
%global goipath github.com/gohugoio/hugo
Version: 0.140.2
%gometa -f
%global common_description %{expand:
Hugo is a static HTML and CSS website generator written in Go. It is optimized
for speed, easy use and configurability. Hugo takes a directory with content
and templates and renders them into a full HTML website.}
%global golicenses LICENSE docs/LICENSE.md docs/themes/gohugoioTheme/license.md
%global godocs docs examples README.md CONTRIBUTING.md
Name: hugo
Release: %autorelease
Summary: The world’s fastest framework for building websites
# Upstream license specification: Apache-2.0 and MIT
# Automatically converted from old format: ASL 2.0 and MIT - review is highly recommended.
License: Apache-2.0 AND LicenseRef-Callaway-MIT
URL: %{gourl}
Source0: %{gosource}
# Skip tests that uses the network.
# Based on https://sources.debian.org/data/main/h/hugo/0.58.3-1/debian/patches/0005-skip-modules-TestClient.patch
Patch0001: 0010-skip-modules-TestClient.patch
BuildRequires: golang(github.com/bep/golibsass/libsass) >= 0.7.0
BuildRequires: golang-github-gohugoio-hugo-goldmark-extensions-devel
# This is in response to Red Hat Bugzilla #2104346. The full dependencies
# for Hugo are large, including GCC and the Go toolchain. For example,
# "hugo server" will not work without these. It might be beneficial to avoid
# such large dependencies in some instances---such as CI pipelines---that
# do not require "hugo server". Thus golang-bin is a weak dependency.
#
# Also see the discussion at https://src.fedoraproject.org/rpms/hugo/pull-request/13.
Recommends: golang-bin
%description
%{common_description}
%gopkg
%prep
%goprep
# See https://github.com/gohugoio/hugo/issues/9860
sed -i 's|github.com/clbanning/mxj/v2|github.com/clbanning/mxj|' $(find . -iname '*.go' -type f)
# See https://github.com/gohugoio/hugo/issues/9860
# and https://github.com/nicksnyder/go-i18n/pull/253
# and https://bugzilla.redhat.com/show_bug.cgi?id=2031583
sed -i 's|github.com/gohugoio/go-i18n/v2|github.com/nicksnyder/go-i18n/v2|' $(find . -iname '*.go' -type f)
%autopatch -p1
# Replace blackfriday import path to avoid conflict with v2
sed -i \
-e 's|"github.com/russross/blackfriday|"gopkg.in/russross/blackfriday.v1|' \
$(find . -name '*.go')
# Skip test that assumes directory is in a git repository
sed -i '/TestPageWithLastmodFromGitInfo/a t.Skip()' hugolib/page_test.go
%if %{with bootstrap}
# Delete test using github.com/gohugoio/testmodBuilder/mods which has a
# dependency loop.
rm hugolib/hugo_modules_test.go
%endif
%generate_buildrequires
%go_generate_buildrequires
%build
BUILDTAGS="extended" LDFLAGS="${LDFLAGS} -X %{goipath}/common/hugo.buildDate=$(date --iso=seconds --date=@$SOURCE_DATE_EPOCH) -X %{goipath}/common/hugo.vendorInfo=Fedora:%{version}-%{release}" %gobuild -o %{gobuilddir}/bin/hugo %{goipath}
%{gobuilddir}/bin/hugo completion bash >hugo-completion
%{gobuilddir}/bin/hugo gen man
%install
%gopkginstall
install -d -p %{buildroot}%{_bindir}
install -Dp -m 0755 %{gobuilddir}/bin/hugo %{buildroot}%{_bindir}
install -Dp hugo-completion %{buildroot}%{_datadir}/bash-completion/completions/hugo
install -Dp man/* -t %{buildroot}%{_mandir}/man1
%if %{with check}
%check
# .: Extensive test that uses network.
# hugolib: panic: runtime error: invalid memory address or nil pointer dereference
# hugolib/pagesfromdata: panic: runtime error: invalid memory address or nil pointer dereference
# langs/i18n: fails with current Rawhide
# markup/goldmark: fails with current Rawhide.
# resources/resource_factories/create: fails with current Rawhide.
# tpl/internal/go_templates/htmltemplate: fails with current Rawhide.
# tpl/internal/go_templates/texttemplate: fails with current Rawhide.
# tpl/internal/go_templates/texttemplate/parse: fails with current Rawhide.
%gocheck \
-d . \
-d hugolib \
-d hugolib/pagesfromdata \
-d langs/i18n \
-d markup/goldmark \
-d resources/resource_factories/create \
-d tpl/internal/go_templates/htmltemplate \
-d tpl/internal/go_templates/texttemplate \
-d tpl/internal/go_templates/texttemplate/parse \
%endif
%files
%doc CONTRIBUTING.md README.md docs
%license LICENSE
%{_bindir}/hugo
%{_datadir}/bash-completion/completions/hugo
%{_mandir}/man1/*.1*
%gopkgfiles
%changelog
%autochangelog