%global debug_package %{nil} %global snapshot 1 %global provider github %global provider_tld com %global project prometheus %global repo promu # github.com/prometheus/promu %global gopackage %{provider}.%{provider_tld}/%{project}/%{repo} %global commit 642a960b363a409efff7621dbf5b183d58670ec2 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global download_prefix %{provider}.%{provider_tld}/%{project}/%{repo} Name: golang-%{provider}-%{project}-%{repo} Version: 0.5.0 Release: 2.git%{shortcommit}%{?dist} Summary: Prometheus Utility Tool for building and releasing projects License: ASL 2.0 URL: https://prometheus.io Source0: https://%{gopackage}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz Patch0: 0001-set-the-binary-name-to-promu.patch Patch1: 0002-use-local-vendor-directory-for-dependencies.patch # 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} ppc64le s390x} BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} %description %{summary} %package -n %{project}-%{repo} Summary: %{summary} Provides: prometheus-promu = %{version}-%{release} %description -n %{project}-%{repo} %{summary} %prep %autosetup -p1 -n %{repo}-%{commit} %build # Go expects a full path to the sources which is not included in the source # tarball so create a link with the expected path export GOPATH=%{_builddir}/go/src mkdir -p ${GOPATH}/%{provider}.%{provider_tld}/%{project} GOPACKAGEPATH=${GOPATH}/%{gopackage} if [ ! -e "$GOPACKAGEPATH" ]; then ln -s `pwd` "$GOPACKAGEPATH" fi make build %install install -d %{buildroot}%{_bindir} install -D -p -m 0755 %{_builddir}/%{repo}-%{commit}/promu %{buildroot}/%{_bindir}/promu %files %license LICENSE NOTICE %doc CONTRIBUTING.md MAINTAINERS.md README.md %{_bindir}/promu %files -n %{project}-%{repo} %license LICENSE NOTICE %doc CONTRIBUTING.md MAINTAINERS.md README.md %{_bindir}/promu %changelog * Tue Oct 01 2019 Paul Gier - 0.4.0-1.git642a96 - Update to v0.5.0 * Wed Jun 12 2019 Paul Gier - 0.4.0-1.gitafc7dfe - Update to v0.4.0 - Refactoring to simplify the build * Tue Jul 24 2018 Simon Pasquier - 0-4.git85ceabc - Enable aarch64 * Wed Jul 18 2018 Florian Weimer - 0-3.git85ceabc - Do not force static linking * Wed Jan 10 2018 Yaakov Selkowitz - 0-2.git85ceabc - Rebuilt for ppc64le, s390x enablement * Mon Aug 28 2017 Paul Gier - 0-1.20170828151318.git85ceabc - Initial spec creation