%define gobuild(o:) %{expand: # https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12 %global _dwz_low_mem_die_limit 0 %ifnarch ppc64 go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}' -compressdwarf=false" -a -v -x %{?**}; %else go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}' -compressdwarf=false" -a -v -x %{?**}; %endif } # https://github.com/cpuguy83/go-md2man %global goipath github.com/cpuguy83/go-md2man Version: 2.0.0 %global commit af8da765f0460ccb1d91003b4945a792363a94ca %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global snapshotdate 20210612 %global common_description %{expand: Converts markdown into roff (man pages).} Name: golang-github-cpuguy83-md2man Release: 4.%{snapshotdate}git%{shortcommit}%{?dist} Summary: Converts markdown into roff (man pages) License: MIT URL: https://github.com/cpuguy83/go-md2man Source0: %url/archive/%{commit}/go-md2man-%{commit}.tar.gz Source1: vendor-%{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} Provides: go-md2man = %{version}-%{release} Provides: golang-github-cpuguy83-go-md2man = %{version}-%{release} Obsoletes: golang-github-cpuguy83-go-md2man < 1.0.4-6 %description %{common_description} %prep %autosetup -p1 -n go-md2man-%{commit} %setup -q -T -D -a 1 -n go-md2man-%{commit} %build export GO111MODULE=on export GOFLAGS=-mod=vendor %gobuild -o _bin/go-md2man . %install install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp _bin/* %{buildroot}%{_bindir}/ %files %license LICENSE.md %doc README.md go-md2man.1.md %{_bindir}/* %changelog * Sat Jun 12 2021 Robert-André Mauchin - 2.0.0-4.20210612gitaf8da76 - Initial package for EPEL