jchaloup pushed to golang-github-cpuguy83-go-md2man (master). "Add debug info (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Tue May 19 08:02:40 UTC 2015


From ea4e03a6807331ef749bf8316ef41aabbbf6776b Mon Sep 17 00:00:00 2001
From: Jan Chaloupka <jchaloup at redhat.com>
Date: Tue, 19 May 2015 09:56:06 +0200
Subject: Add debug info Add license Update spec file to build on secondary
 architectures as well - related: #1222796


diff --git a/golang-github-cpuguy83-go-md2man.spec b/golang-github-cpuguy83-go-md2man.spec
index 877bc3d..68633c0 100644
--- a/golang-github-cpuguy83-go-md2man.spec
+++ b/golang-github-cpuguy83-go-md2man.spec
@@ -1,4 +1,42 @@
-%global debug_package   %{nil}
+# define arches for PA and SA
+%global golang_arches   %{ix86} x86_64 %{arm}
+%global gccgo_arches    %{power64} s390x aarch64
+%global go_arches       %golang_arches %gccgo_arches
+
+# gopath macro not defined for gccgo_arches
+%ifarch %{gccgo_arches}
+%global gopath          %{_datadir}/gocode
+%endif
+
+# Override to specify version for buildrequiresgo and requiresgo
+%global gccgo_version %{nil}
+%global golang_version %{nil}
+
+# To provide easy way to set Go compiler, with possible version override
+%ifarch %golang_arches
+%define gocompiler golang %{?golang_version}
+%else
+%define gocompiler gcc-go %{?gccgo_version}
+%endif
+
+# Chose the correct compiler
+%ifarch %golang_arches
+%define gobuild go build -compiler gc
+%else
+%define gobuild go build -compiler gccgo -gccgoflags "$RPM_OPT_FLAGS"
+%endif
+
+# Test with the correct compiler
+%ifarch %golang_arches \
+%define gotest go test -compiler gc
+%else
+%define gotest go test -compiler gccgo -gccgoflags "$RPM_OPT_FLAGS"
+%endif
+
+%if 0%{?fedora}
+# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12
+%global _dwz_low_mem_die_limit 0
+%endif
 %global provider        github
 %global provider_tld    com
 %global project         cpuguy83
@@ -6,15 +44,16 @@
 %global import_path     %{provider}.%{provider_tld}/%{project}/%{repo}
 %global commit          2831f11f66ff4008f10e2cd7ed9a85e3d3fc2bed
 %global shortcommit     %(c=%{commit}; echo ${c:0:7})
+%global golang_version  >= 1.2.1-3
 
 Name:           golang-%{provider}-%{project}-%{repo}
 Version:        1
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Process markdown into manpages
 License:        MIT
 URL:            https://%{import_path}
 Source0:        https://%{import_path}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
-ExclusiveArch:  %{ix86} x86_64 %{arm}
+ExclusiveArch:  %{go_arches}
 Provides:       %{repo} = %{version}-%{release}
 
 %description
@@ -22,9 +61,9 @@ Provides:       %{repo} = %{version}-%{release}
 manpages.
 
 %package devel
-BuildRequires:  golang >= 1.2.1-3
+BuildRequires:  %{gocompiler}
 BuildRequires:  golang(github.com/russross/blackfriday)
-Requires:       golang >= 1.2.1-3
+Requires:       %{gocompiler}
 BuildArch:      noarch
 Summary:        A golang registry for global request variables
 Provides:       golang(%{import_path}) = %{version}-%{release}
@@ -41,12 +80,18 @@ which use %{project}/%{repo}.
 %setup -qn %{repo}-%{commit}
 
 %build
+%if 0%{?fedora}
+function gobuild { %{gobuild} -a -ldflags "-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -v -x "$@"; }
+%else
+# no debug info for rhel so far
+function gobuild { %{gobuild} "$@"; }
+%endif
+
 mkdir -p _build/src/%{provider}.%{provider_tld}/%{project}
 ln -s $(pwd) ./_build/src/%{import_path}
-
 export GOPATH=$(pwd)/_build:%{gopath}
 pushd $(pwd)/_build/src
-go build  %{import_path}
+gobuild %{import_path}
 popd
 
 %install
@@ -62,18 +107,31 @@ install -p -m 755 ./_build/src/%{repo} %{buildroot}%{_bindir}
 #no test files so far
 
 %files
+%if 0%{?fedora}
+%license LICENSE.md
 %doc README.md
+%else
+%doc LICENSE.md README.md
+%endif
 %{_bindir}/%{repo}
 
 %files devel
+%if 0%{?fedora}
+%license LICENSE.md
 %doc README.md
+%else
+%doc LICENSE.md README.md
+%endif
 %dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
-%dir %{gopath}/src/%{import_path}
-%dir %{gopath}/src/%{import_path}/*
-%{gopath}/src/%{import_path}/*.go
-%{gopath}/src/%{import_path}/*/*.go
+%{gopath}/src/%{import_path}
 
 %changelog
+* Sun May 17 2015 jchaloup <jchaloup at redhat.com> - 1-5
+- Add debug info
+- Add license
+- Update spec file to build on secondary architectures as well
+  related: #1222796
+
 * Wed Feb 25 2015 jchaloup <jchaloup at redhat.com> - 1-4
 - Bump to upstream 2831f11f66ff4008f10e2cd7ed9a85e3d3fc2bed
   related: #1156492
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/golang-github-cpuguy83-go-md2man.git/commit/?h=master&id=ea4e03a6807331ef749bf8316ef41aabbbf6776b


More information about the scm-commits mailing list