# Generated by go2rpm 1.19.0 %bcond check 1 # To update: # 1. Update the version in this file. # 2. Retrieve new source archive: # spectool -g hugo.spec. # 3. Generate the vendor archive: # go_vendor_archive create --config go-vendor-tools.toml hugo.spec # It might be necessary first to edit go-vendor-tools.toml if package # dependencies change. It might also be necessary to edit hugo.spec's # license union. # 4. Place the following in the RPM SOURCES directory: # hugo-VERSION.tar.gz # hugo-VERSION-vendor.tar.bz2 # 0010-skip-modules-TestClient.patch # 0020-fix-errorf.patch # go-vendor-tools.toml # libsass-3.6.6.tar.gz # 5. Review gocheck. Are more or fewer -d arguments needed? # https://github.com/gohugoio/hugo %global goipath github.com/gohugoio/hugo Version: 0.159.0 %gometa -L -f Name: hugo Release: %autorelease Summary: The world’s fastest framework for building websites # Generated by go-vendor-tools License: 0BSD AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT AND MPL-2.0 AND Unlicense URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml # Needed for vendor/golibsass; go-vendor-tools does not grab C code from Go repositories: Source3: libsass-3.6.6.tar.gz # 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 # See https://github.com/gohugoio/hugo/pull/14665. Patch0002: 0020-fix-errorf.patch BuildRequires: go-vendor-tools BuildRequires: gcc-c++ %description The world’s fastest framework for building websites. %prep %goprep -p1 tar -xf %{S:1} # Needed for vendor/golibsass; go-vendor-tools does not grab C code from Go repositories: mkdir vendor/github.com/bep/golibsass/libsass_src tar xvf %SOURCE3 -C vendor/github.com/bep/golibsass/libsass_src --strip-components=1 %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build # Allow github.com/tetratelabs/wazero to build. # For commentary on notext, see: # https://github.com/wazero/wazero/issues/2469 # https://bugzilla.redhat.com/show_bug.cgi?id=2428281 %global __golang_extldflags -Wl,-z,undefs -Wl,-z,notext %global gomodulesmode GO111MODULE=on # Build extended version of Hugo. export GO_BUILDTAGS="extended" export GO_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} %install %go_vendor_license_install -c %{S:2} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ %check %go_vendor_license_check -c %{S:2} %if %{with check} %global ignores %{shrink: -s TestCommands -s TestModulePrivateRepo -s TestGitInfoFromGitModuleWithGoMod -s TestGitInfoFromGitModuleWithVersionQuery -s TestModuleImportWithVersion -s TestGetRemoteHead -s TestGetRemoteResponseHeaders -s TestVimeoShortcode -s TestPagesFromGoTmplAsciiDocAndSimilar } # internal/warpc: fails on ppc64le. %gocheck2 -F -d internal/warpc %{ignores} %endif %files -f %{go_vendor_license_filelist} %doc docs AGENTS.md CLAUDE.md CONTRIBUTING.md README.md SECURITY.md %{_bindir}/hugo %changelog %autochangelog