You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.5 KiB
54 lines
1.5 KiB
%define debug_package %{nil} |
|
|
|
Name : hugo |
|
Version : 0.70.0 |
|
Release : 1%{?dist} |
|
Summary : The world’s fastest framework for building websites. |
|
Group : System/Web |
|
License : Apache License |
|
URL : https://gohugo.io/ |
|
#Source0 : |
|
BuildRequires : golang |
|
BuildRequires : git |
|
Requires : git |
|
|
|
%description |
|
|
|
|
|
%prep |
|
%setup -T -q -c %{name}-%{version} |
|
mkdir go |
|
export GOPATH=`pwd`/go |
|
export GO111MODULE=on |
|
mkdir src |
|
cd src |
|
git clone https://github.com/gohugoio/hugo.git |
|
cd hugo |
|
git checkout tags/v%{version} |
|
#go get -u -v github.com/gohugoio/hugo |
|
go mod download |
|
|
|
|
|
%build |
|
export GOPATH=`pwd`/go |
|
export GO111MODULE=on |
|
cd src/hugo |
|
git checkout tags/v%{version} |
|
export SHORTCOMMIT=$(git rev-parse --short HEAD) |
|
export BUILDDATE=$(date +%Y%m%d) |
|
go build -v -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid "%{version}" -X 'github.com/gohugoio/hugo/common/hugo.buildDate="$BUILDDATE"' -X 'github.com/gohugoio/hugo/common/hugo.commitHash="$SHORTCOMMIT"'" -o hugo |
|
go build -v -ldflags "-extldflags -s -w -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -buildid "%{version}" -X 'github.com/gohugoio/hugo/common/hugo.buildDate="$BUILDDATE"' -X 'github.com/gohugoio/hugo/common/hugo.commitHash="$SHORTCOMMIT"'" -tags "extended" -o hugo-extended |
|
|
|
|
|
%install |
|
install -p -D -m 0555 src/hugo/hugo %{buildroot}%{_bindir}/hugo |
|
install -p -D -m 0555 src/hugo/hugo-extended %{buildroot}%{_bindir}/hugo-extended |
|
|
|
|
|
%files |
|
%doc |
|
%{_bindir}/hugo |
|
%{_bindir}/hugo-extended |
|
|
|
|
|
%changelog
|
|
|