Blob Blame History Raw
%global with_debug 1

%if 0%{?with_debug}
%global _dwz_low_mem_die_limit 0
%else
%global debug_package   %{nil}
%endif

%if ! 0%{?gobuild:1}
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
%endif

%global provider        github
%global provider_tld    com
%global project         vbatts
%global repo            go-mtree
# https://github.com/vbatts/go-mtree
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path     %{provider_prefix}
%global commit          85fac2fc14752c3edbf6be564af4fbfef6a07e2f
%global shortcommit     %(c=%{commit}; echo ${c:0:7})

ExcludeArch: ppc64 

Name:           gomtree
Version:        0.4.0
Release:        4%{?dist}
Summary:        Go CLI tool for mtree support
License:        BSD
URL:            https://%{provider_prefix}
Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.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 %{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}

%description
%{summary}

{?enable_gotoolset7}

%prep
%setup -q -n %{repo}-%{commit}

%build
mkdir -p src/github.com/vbatts
ln -s ../../../ src/github.com/vbatts/go-mtree

export GOPATH=$(pwd):%{gopath}

%gobuild -o bin/%{name} %{import_path}/cmd/%{name}

%install
install -d -p %{buildroot}%{_bindir}
install -p -m 0755 bin/%{name} %{buildroot}%{_bindir}

#define license tag if not already defined
%{!?_licensedir:%global license %doc}

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}

%changelog
* Mon Jul 30 2018 Florian Weimer <fweimer@redhat.com> - 0.4.0-4
- Rebuild with fixed binutils

* Sun Jul 29 2018 Jan Chaloupka <jchaloup@redhat.com> - 0.4.0-3
- Build from bundled dependencies
  resolves: #1608482

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Tue Aug 01 2017 Brent Baude <bbaude@redhat.com> - 0.4.0-1
- New version of gomtree

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Tue Apr 25 2017 bbaude <bbaude@redhat.com> - 0.3.1-2
- No golang support for ppc64. BZ #1445491

* Fri Feb 17 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.3.1-1
- bump to v0.3.1

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Dec 15 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.3.0-1
- Resolves: 1403037 - bump to v0.3.0

* Mon Oct 03 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.2.git8c6b32c
- Resolves: #1380420 - import into Fedora
- fix binary build step

* Thu Sep 29 2016 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.1.git8c6b32c
- First package for Fedora