From 78c6651845396258698dee94d72fb7cde822e54b Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 26 Feb 2019 04:33:20 -0500 Subject: [PATCH] Rewrite spec using latest template. --- hugo.spec | 398 +++++------------------------------------------------- sources | 2 +- 2 files changed, 37 insertions(+), 363 deletions(-) diff --git a/hugo.spec b/hugo.spec index 989f1c7..f1bd777 100644 --- a/hugo.spec +++ b/hugo.spec @@ -1,125 +1,26 @@ -# If any of the following macros should be set otherwise, -# you can wrap any of them with the following conditions: -# - %%if 0%%{centos} == 7 -# - %%if 0%%{?rhel} == 7 -# - %%if 0%%{?fedora} == 23 -# Or just test for particular distribution: -# - %%if 0%%{centos} -# - %%if 0%%{?rhel} -# - %%if 0%%{?fedora} -# -# Be aware, on centos, both %%rhel and %%centos are set. If you want to test -# rhel specific macros, you can use %%if 0%%{?rhel} && 0%%{?centos} == 0 condition. -# (Don't forget to replace double percentage symbol with single one in order to apply a condition) - -# Generate devel rpm -%global with_devel 1 -# Build project from bundled dependencies -%global with_bundled 0 -# Build with debug info rpm -%global with_debug 1 -# Run tests in check section -%global with_check 1 -# Generate unit-test rpm -%global with_unit_test 1 - -%if 0%{?with_debug} -%global _dwz_low_mem_die_limit 0 -%else -%global debug_package %{nil} -%endif - -%if ! 0%{?gobuild:1} -%global gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**}; -%endif - -%global provider github -%global provider_tld com -%global project gohugoio -%global repo hugo # https://github.com/gohugoio/hugo -%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} -%global import_path %{provider_prefix} -# This commit is the 0.38 tag -%global commit f7bc28c5291bda85e8d63433121dc903a6f7bf80 -%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global goipath github.com/gohugoio/hugo +Version: 0.38 + +%gometa Name: hugo -Version: 0.38 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A Fast and Flexible Static Site Generator built with love in GoLang License: ASL 2.0 and MIT -URL: https://%{provider_prefix} -Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{version}.tar.gz - -# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required -ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}} -# If go_compiler is not set to 1, there is no virtual provide. Use golang instead. -BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} - -%if ! 0%{?with_bundled} -# main.go -BuildRequires: golang(github.com/spf13/jwalterweatherman) - -# magefile.go -# No need in BRing these -# BuildRequires: golang(github.com/magefile/mage/mg) -# BuildRequires: golang(github.com/magefile/mage/sh) - -# Remaining dependencies not included in main packages -BuildRequires: golang(github.com/yosssi/ace) -BuildRequires: golang(golang.org/x/text/unicode/norm) -BuildRequires: golang(github.com/alecthomas/chroma/formatters/html) -BuildRequires: golang(github.com/BurntSushi/toml) -BuildRequires: golang(github.com/hashicorp/go-immutable-radix) -BuildRequires: golang(github.com/russross/blackfriday) -BuildRequires: golang(golang.org/x/text/transform) -BuildRequires: golang(github.com/markbates/inflect) -BuildRequires: golang(gopkg.in/yaml.v2) -BuildRequires: golang(github.com/mitchellh/mapstructure) -BuildRequires: golang(github.com/spf13/viper) -BuildRequires: golang(github.com/fsnotify/fsnotify) -BuildRequires: golang(github.com/spf13/fsync) -BuildRequires: golang(github.com/alecthomas/chroma) -BuildRequires: golang(github.com/spf13/afero) -BuildRequires: golang(github.com/spf13/cast) -BuildRequires: golang(github.com/alecthomas/chroma/lexers) -BuildRequires: golang(github.com/chaseadamsio/goorgeous) -BuildRequires: golang(github.com/nicksnyder/go-i18n/i18n/bundle) -BuildRequires: golang(github.com/nicksnyder/go-i18n/i18n/language) -BuildRequires: golang(github.com/kyokomi/emoji) -BuildRequires: golang(github.com/gorilla/websocket) -BuildRequires: golang(github.com/eknkc/amber) -BuildRequires: golang(github.com/spf13/cobra/doc) -BuildRequires: golang(github.com/alecthomas/chroma/styles) -BuildRequires: golang(github.com/spf13/pflag) -BuildRequires: golang(github.com/miekg/mmark) -BuildRequires: golang(github.com/jdkato/prose/transform) -BuildRequires: golang(github.com/PuerkitoBio/purell) -BuildRequires: golang(github.com/spf13/nitro) -BuildRequires: golang(github.com/alecthomas/chroma/formatters) -BuildRequires: golang(github.com/spf13/cobra) -BuildRequires: golang(github.com/bep/gitmap) -BuildRequires: golang(golang.org/x/image/webp) -BuildRequires: golang(github.com/disintegration/imaging) -BuildRequires: golang(github.com/gobwas/glob) -BuildRequires: golang(github.com/muesli/smartcrop) -BuildRequires: golang(github.com/olekukonko/tablewriter) -BuildRequires: golang(golang.org/x/net/context) -BuildRequires: golang(golang.org/x/sync/errgroup) -%endif +URL: %{gourl} +Source0: %{gosource} %description 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. -%if 0%{?with_devel} -%package -n golang-%{provider}-%{project}-%{repo}-devel + +%package -n %{goname}-devel Summary: %{summary} BuildArch: noarch -%if 0%{?with_check} && ! 0%{?with_bundled} BuildRequires: golang(github.com/BurntSushi/toml) BuildRequires: golang(github.com/PuerkitoBio/purell) BuildRequires: golang(github.com/alecthomas/chroma) @@ -128,18 +29,22 @@ BuildRequires: golang(github.com/alecthomas/chroma/formatters/html) BuildRequires: golang(github.com/alecthomas/chroma/lexers) BuildRequires: golang(github.com/alecthomas/chroma/styles) BuildRequires: golang(github.com/bep/gitmap) -BuildRequires: golang(github.com/markbates/inflect) BuildRequires: golang(github.com/chaseadamsio/goorgeous) +BuildRequires: golang(github.com/disintegration/imaging) BuildRequires: golang(github.com/eknkc/amber) BuildRequires: golang(github.com/fsnotify/fsnotify) +BuildRequires: golang(github.com/gobwas/glob) BuildRequires: golang(github.com/gorilla/websocket) BuildRequires: golang(github.com/hashicorp/go-immutable-radix) BuildRequires: golang(github.com/jdkato/prose/transform) BuildRequires: golang(github.com/kyokomi/emoji) +BuildRequires: golang(github.com/markbates/inflect) BuildRequires: golang(github.com/miekg/mmark) BuildRequires: golang(github.com/mitchellh/mapstructure) +BuildRequires: golang(github.com/muesli/smartcrop) BuildRequires: golang(github.com/nicksnyder/go-i18n/i18n/bundle) BuildRequires: golang(github.com/nicksnyder/go-i18n/i18n/language) +BuildRequires: golang(github.com/olekukonko/tablewriter) BuildRequires: golang(github.com/russross/blackfriday) BuildRequires: golang(github.com/spf13/afero) BuildRequires: golang(github.com/spf13/cast) @@ -151,296 +56,66 @@ BuildRequires: golang(github.com/spf13/nitro) BuildRequires: golang(github.com/spf13/pflag) BuildRequires: golang(github.com/spf13/viper) BuildRequires: golang(github.com/yosssi/ace) +BuildRequires: golang(golang.org/x/image/webp) +BuildRequires: golang(golang.org/x/net/context) +BuildRequires: golang(golang.org/x/sync/errgroup) BuildRequires: golang(golang.org/x/text/transform) BuildRequires: golang(golang.org/x/text/unicode/norm) BuildRequires: golang(gopkg.in/yaml.v2) -BuildRequires: golang(golang.org/x/image/webp) -BuildRequires: golang(github.com/disintegration/imaging) -BuildRequires: golang(github.com/gobwas/glob) -BuildRequires: golang(github.com/muesli/smartcrop) -BuildRequires: golang(github.com/olekukonko/tablewriter) -BuildRequires: golang(golang.org/x/net/context) -BuildRequires: golang(golang.org/x/sync/errgroup) -%endif -Requires: golang(github.com/BurntSushi/toml) -Requires: golang(github.com/PuerkitoBio/purell) -Requires: golang(github.com/alecthomas/chroma) -Requires: golang(github.com/alecthomas/chroma/formatters) -Requires: golang(github.com/alecthomas/chroma/formatters/html) -Requires: golang(github.com/alecthomas/chroma/lexers) -Requires: golang(github.com/alecthomas/chroma/styles) -Requires: golang(github.com/bep/gitmap) -Requires: golang(github.com/markbates/inflect) -Requires: golang(github.com/chaseadamsio/goorgeous) -Requires: golang(github.com/eknkc/amber) -Requires: golang(github.com/fsnotify/fsnotify) -Requires: golang(github.com/gorilla/websocket) -Requires: golang(github.com/hashicorp/go-immutable-radix) -Requires: golang(github.com/jdkato/prose/transform) -Requires: golang(github.com/kyokomi/emoji) -Requires: golang(github.com/miekg/mmark) -Requires: golang(github.com/mitchellh/mapstructure) -Requires: golang(github.com/nicksnyder/go-i18n/i18n/bundle) -Requires: golang(github.com/nicksnyder/go-i18n/i18n/language) -Requires: golang(github.com/russross/blackfriday) -Requires: golang(github.com/spf13/afero) -Requires: golang(github.com/spf13/cast) -Requires: golang(github.com/spf13/cobra) -Requires: golang(github.com/spf13/cobra/doc) -Requires: golang(github.com/spf13/fsync) -Requires: golang(github.com/spf13/jwalterweatherman) -Requires: golang(github.com/spf13/nitro) -Requires: golang(github.com/spf13/pflag) -Requires: golang(github.com/spf13/viper) -Requires: golang(github.com/yosssi/ace) -Requires: golang(golang.org/x/text/transform) -Requires: golang(golang.org/x/text/unicode/norm) -Requires: golang(gopkg.in/yaml.v2) -Requires: golang(golang.org/x/image/webp) -Requires: golang(github.com/disintegration/imaging) -Requires: golang(github.com/gobwas/glob) -Requires: golang(github.com/muesli/smartcrop) -Requires: golang(github.com/olekukonko/tablewriter) -Requires: golang(golang.org/x/net/context) -Requires: golang(golang.org/x/sync/errgroup) - -Provides: golang(%{import_path}/bufferpool) = %{version}-%{release} -Provides: golang(%{import_path}/cache) = %{version}-%{release} -Provides: golang(%{import_path}/commands) = %{version}-%{release} -Provides: golang(%{import_path}/common/types) = %{version}-%{release} -Provides: golang(%{import_path}/compare) = %{version}-%{release} -Provides: golang(%{import_path}/config) = %{version}-%{release} -Provides: golang(%{import_path}/create) = %{version}-%{release} -Provides: golang(%{import_path}/deps) = %{version}-%{release} -Provides: golang(%{import_path}/docshelper) = %{version}-%{release} -Provides: golang(%{import_path}/helpers) = %{version}-%{release} -Provides: golang(%{import_path}/hugofs) = %{version}-%{release} -Provides: golang(%{import_path}/hugolib) = %{version}-%{release} -Provides: golang(%{import_path}/i18n) = %{version}-%{release} -Provides: golang(%{import_path}/livereload) = %{version}-%{release} -Provides: golang(%{import_path}/media) = %{version}-%{release} -Provides: golang(%{import_path}/metrics) = %{version}-%{release} -Provides: golang(%{import_path}/output) = %{version}-%{release} -Provides: golang(%{import_path}/parser) = %{version}-%{release} -Provides: golang(%{import_path}/related) = %{version}-%{release} -Provides: golang(%{import_path}/releaser) = %{version}-%{release} -Provides: golang(%{import_path}/source) = %{version}-%{release} -Provides: golang(%{import_path}/tpl) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/cast) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/collections) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/compare) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/crypto) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/data) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/encoding) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/fmt) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/images) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/inflect) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/lang) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/math) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/os) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/partials) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/safe) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/strings) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/time) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/tplimpl) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/transform) = %{version}-%{release} -Provides: golang(%{import_path}/tpl/urls) = %{version}-%{release} -Provides: golang(%{import_path}/transform) = %{version}-%{release} -Provides: golang(%{import_path}/utils) = %{version}-%{release} -Provides: golang(%{import_path}/watcher) = %{version}-%{release} -Provides: golang(%{import_path}/resource) = %{version}-%{release} - -%description -n golang-%{provider}-%{project}-%{repo}-devel -%{summary} - -This package contains library source intended for -building other packages which use import path with -%{import_path} prefix. -%endif - -%if 0%{?with_unit_test} && 0%{?with_devel} -%package -n golang-%{provider}-%{project}-%{repo}-unit-test-devel -Summary: Unit tests for %{name} package -%if 0%{?with_check} -#Here comes all BuildRequires: PACKAGE the unit tests -#in %%check section need for running -%endif - -# test subpackage tests code from devel subpackage -Requires: golang-%{provider}-%{project}-%{repo}-devel = %{version}-%{release} - -%if 0%{?with_check} && ! 0%{?with_bundled} +# These are used during tests BuildRequires: golang(github.com/fortytw2/leaktest) BuildRequires: golang(github.com/stretchr/testify/assert) BuildRequires: golang(github.com/stretchr/testify/require) -%endif - -Requires: golang(github.com/fortytw2/leaktest) -Requires: golang(github.com/stretchr/testify/assert) -Requires: golang(github.com/stretchr/testify/require) - -# These are used during hugolib tests -%%if 0%{?with_check} BuildRequires: python3-docutils BuildRequires: python3-pygments BuildRequires: rubygem-asciidoctor -Requires: python3-docutils -Requires: python3-pygments -Requires: rubygem-asciidoctor -%%endif -%description -n golang-%{provider}-%{project}-%{repo}-unit-test-devel +%description -n %{goname}-devel %{summary} -This package contains unit tests for project -providing packages with %{import_path} prefix. -%endif +This package contains library source intended for building other packages +which use import path with %{goipath} prefix. + %prep -%setup -q -n %{repo}-%{commit} +%forgeautosetup -p1 + %build -mkdir -p src/%{provider}.%{provider_tld}/%{project} -ln -s ../../../ src/%{import_path} +%gobuildroot -%if ! 0%{?with_bundled} -export GOPATH=$(pwd):%{gopath} -%else -# No dependency directories so far -export GOPATH=$(pwd):%{gopath} -%endif +%gobuild -o _bin/hugo %{goipath} -%gobuild -o bin/hugo %{import_path}/ %install +%goinstall + install -d -p %{buildroot}%{_bindir} -install -p -m 0755 bin/hugo %{buildroot}%{_bindir} +install -p -m 0755 _bin/hugo %{buildroot}%{_bindir} -# source codes for building projects -%if 0%{?with_devel} -install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ -echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list -# find all *.go but no *_test.go files and generate devel.file-list -for file in $(find . \( -iname "*.go" -or -iname "*.s" \) \! -iname "*_test.go") ; do - dirprefix=$(dirname $file) - install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$dirprefix - cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file - echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list - - while [ "$dirprefix" != "." ]; do - echo "%%dir %%{gopath}/src/%%{import_path}/$dirprefix" >> devel.file-list - dirprefix=$(dirname $dirprefix) - done -done -%endif - -# testing files for this project -%if 0%{?with_unit_test} && 0%{?with_devel} -install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ -# find all *_test.go files and generate unit-test-devel.file-list -for file in $(find . -iname "*_test.go") ; do - dirprefix=$(dirname $file) - install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$dirprefix - cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file - echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test-devel.file-list - - while [ "$dirprefix" != "." ]; do - echo "%%dir %%{gopath}/src/%%{import_path}/$dirprefix" >> devel.file-list - dirprefix=$(dirname $dirprefix) - done -done -# install data used for tests -cp -pav ./hugolib/testdata %{buildroot}/%{gopath}/src/%{import_path}/hugolib/ -echo "%%{gopath}/src/%%{import_path}/hugolib/testdata" >> unit-test-devel.file-list -cp -pav ./resource/testdata %{buildroot}/%{gopath}/src/%{import_path}/resource/ -echo "%%{gopath}/src/%%{import_path}/resource/testdata" >> unit-test-devel.file-list - -%endif - -%if 0%{?with_devel} -sort -u -o devel.file-list devel.file-list -%endif %check -%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel} -%if ! 0%{?with_bundled} -export GOPATH=%{buildroot}/%{gopath}:%{gopath} -%else -# No dependency directories so far - -export GOPATH=%{buildroot}/%{gopath}:%{gopath} -%endif - -%if ! 0%{?gotest:1} -%global gotest go test -%endif - -%gotest %{import_path}/bufferpool -%gotest %{import_path}/cache -%gotest %{import_path}/commands -%gotest %{import_path}/common/types -%gotest %{import_path}/create -%gotest %{import_path}/helpers -%gotest %{import_path}/hugofs -%gotest %{import_path}/hugolib -%gotest %{import_path}/i18n -%gotest %{import_path}/media -%gotest %{import_path}/metrics -%gotest %{import_path}/output -%gotest %{import_path}/parser -%gotest %{import_path}/related -# We do not want to test upstream release process (needs git repo) -# %%gotest %%{import_path}/releaser -%gotest %{import_path}/source -%gotest %{import_path}/tpl/cast -%gotest %{import_path}/tpl/collections -%gotest %{import_path}/tpl/compare -%gotest %{import_path}/tpl/crypto -%gotest %{import_path}/tpl/data -%gotest %{import_path}/tpl/encoding -%gotest %{import_path}/tpl/fmt -%gotest %{import_path}/tpl/images -%gotest %{import_path}/tpl/inflect -%gotest %{import_path}/tpl/internal -%gotest %{import_path}/tpl/lang -%gotest %{import_path}/tpl/math -%gotest %{import_path}/tpl/os -%gotest %{import_path}/tpl/partials -%gotest %{import_path}/tpl/safe -%gotest %{import_path}/tpl/strings -# A test depends on the host timezone, we do now want to test it. +# releaser: We do not want to test upstream release process (needs git repo) +# tpl/time: A test depends on the host timezone, we do now want to test it. # time_test.go:49: [3] DateFormat failed: Unable to Cast 1421733600 to Time # line 35 returns different results -# %%gotest %%{import_path}/tpl/time -%gotest %{import_path}/tpl/tplimpl -%gotest %{import_path}/tpl/transform -%gotest %{import_path}/tpl/urls -%gotest %{import_path}/transform -%gotest %{import_path}/resource -%endif +%gochecks -d releaser -d tpl/time -#define license tag if not already defined -%{!?_licensedir:%global license %doc} %files %license LICENSE.md %doc CONTRIBUTING.md README.md %{_bindir}/hugo -%if 0%{?with_devel} -%files -n golang-%{provider}-%{project}-%{repo}-devel -f devel.file-list +%files -n %{goname}-devel -f devel.file-list %license LICENSE.md %doc CONTRIBUTING.md README.md -%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} -%endif -%if 0%{?with_unit_test} && 0%{?with_devel} -%files -n golang-%{provider}-%{project}-%{repo}-unit-test-devel -f unit-test-devel.file-list -%license LICENSE.md -%doc CONTRIBUTING.md README.md -%endif %changelog +* Tue Feb 26 2019 Elliott Sales de Andrade - 0.38-4 +- Rewrite spec using latest template + * Fri Feb 01 2019 Fedora Release Engineering - 0.38-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild @@ -536,4 +211,3 @@ export GOPATH=%{buildroot}/%{gopath}:%{gopath} * Sun Feb 26 2017 Athos Ribeiro - 0.18.1-1 - Initial package - diff --git a/sources b/sources index af6b933..0e10538 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (hugo-0.38.tar.gz) = 232c193612130f894e12514e5cb7a9a8e66f98e55440ea2a6667692d6eada5cdafd0e11dcfacc174f42aae9af68b37592f45cea18a4a1ba5a779956780923df7 +SHA512 (hugo-0.38.tar.gz) = 5b6c089e8c04dc610b02c17fed8c68b4fb87c6af5c78f48604e6a46c380f834793651c3cc94da83233fd521225c5ed4c7c7ea35124fea322157d9e5de9217a40