From 59e03afbe83f038b021fd59fec84e7ba350a46e1 Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Sun, 9 Oct 2022 13:59:55 +0200 Subject: [PATCH] initial package creation Signed-off-by: Toshaan Bharvani --- SOURCES/.gitkeeper | 0 SPECS/hugo.spec | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 SOURCES/.gitkeeper create mode 100644 SPECS/hugo.spec diff --git a/SOURCES/.gitkeeper b/SOURCES/.gitkeeper new file mode 100644 index 0000000..e69de29 diff --git a/SPECS/hugo.spec b/SPECS/hugo.spec new file mode 100644 index 0000000..34b1d06 --- /dev/null +++ b/SPECS/hugo.spec @@ -0,0 +1,63 @@ +%define debug_package %{nil} + +Name : hugo +Version : 0.104.3 +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 +sed 's|h1:NCWpmDDNjHNsrei6VmnYXzOiyZUxV8LVU19REGQ8dKA=|h1:CRDpKE90NuksNOWe7qjq1JHh7yonOht8f7rzAJQSDhc=|' -i go.sum +sed 's|h1:JFNqj2afbbhCqTiyN16D7Tudc/aaDzE2FBDk+VlBQnE=|h1:TA3qh4Cq1VOjh4AJnMHrUFbAsIbD7OnOvpaIRYsU0sI=|' -i go.sum +sed 's|h1:KG+mPzRdPs7eklbZ7KsIikzwvd4wcyA9vv2MniUrFQ8=|h1:o/A5/1yxndTbcU6+eNQ3bJs7TL0xuNoI0MiLZvmE5Jg=|' -i go.sum +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 +%ifarch ppc64 +export CGO_ENABLED=1 +%endif +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 +%ifarch ppc64 +unset CGO_ENABLED +%endif + +%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