File hugo.spec of Package hugo
#
# spec file for package hugo
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define go_version 1.24
Name: hugo
Version: 0.151.0
Release: 0
Summary: The worlds fastest framework for building websites
License: Apache-2.0
URL: https://gohugo.io/
Source: %{name}-%{version}.tar.gz
Source1: vendor.tar.xz
Source99: hugo-rpmlintrc
Patch1: removemathstuff.patch
BuildRequires: gcc-c++
BuildRequires: golang(API) = %{go_version}
BuildRequires: golang-packaging
BuildRequires: pkgconfig(libsass) >= 3.5
BuildRequires: pkgconfig(libwebp)
Recommends: %{name}-doc = %{version}
Recommends: go%{go_version}
# formatsupport:
# to support more formarts from docs/content/en/content-management/formats.md
Recommends: python3-docutils
Recommends: python3-Pygments
Recommends: pandoc
Recommends: asciidoc
Recommends: rubygem(%{rb_default_ruby_abi}:asciidoctor)
# /formatsupport
Recommends: hugo-compress-site
Requires: hugo-binary = %{version}
Recommends: hugo-binary-without-deploy
%description
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.
%package binary-without-deploy
Summary: hugo binary without the deploy functionality
Requires: hugo = %{version}
Provides: hugo-binary = %{version}-%{release}
Conflicts: hugo-binary
Removepathpostfixes: -without-deploy
%description binary-without-deploy
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.
This package hugo binary without the deploy functionality.
%package binary-with-deploy
Summary: hugo binary with the deploy functionality
Requires: hugo = %{version}
Provides: hugo-binary = %{version}-%{release}
Conflicts: hugo-binary
Removepathpostfixes: -with-deploy
%description binary-with-deploy
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.
This package hugo binary with the deploy functionality.
%package doc
#
Summary: Documentation and examples for Hugo
Group: Productivity/Publishing/Other
Requires: %{name} = %{version}
BuildArch: noarch
%description doc
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.
This package holds the examples and documentation files.
%package compress-site
Summary: A simple script for compressing files in your hugo site
Group: Productivity/Publishing/Other
Requires: brotli
Requires: ruby
Requires: gzip
License: AGPL-3.0-only
BuildArch: noarch
%description compress-site
A simple script for compressing files in your hugo site.
%prep
%autosetup -p1 -a 1
%build
# we can not clean this up with the patch because of the binary wasm files
rm -rv internal/warpc
go version
# build tags explained:
# - extended: build hugo in extended mode
# - dev: make the go-libsass use the system library
CGO_ENABLED=1 \
go build \
-v \
-mod=vendor \
-tags="dev extended" \
-buildvcs=false \
-buildmode=pie \
-ldflags "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=https://build.opensuse.org/package/show/%{_project}/%{name}" \
-o hugo-without-deploy
go build \
-mod=vendor \
-tags="dev extended withdeploy" \
-buildvcs=false \
-buildmode=pie \
-ldflags "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=https://build.opensuse.org/package/show/%{_project}/%{name}" \
-o hugo-with-deploy
%check
./hugo-with-deploy version
./hugo-without-deploy version
find docs/ -name .gitignore -print -delete
find docs/ -type f -print0 | xargs -r0 chmod a-x
%install
install -D -m 0755 -t %{buildroot}%{_bindir}/ hugo-with-deploy hugo-without-deploy
%files
%license LICENSE
%doc CONTRIBUTING.md README.md
%files binary-with-deploy
%{_bindir}/hugo-with-deploy
%files binary-without-deploy
%{_bindir}/hugo-without-deploy
%files doc
%doc docs/
%changelog