Blame golang-github-yvasiyarov-gorelic.spec

cd9902d
%if 0%{?fedora} || 0%{?rhel} == 6
cd9902d
%global with_devel 1
cd9902d
%global with_bundled 0
cd9902d
%global with_debug 0
cd9902d
# no tests so far
cd9902d
%global with_check 0
cd9902d
%global with_unit_test 0
cd9902d
%else
cd9902d
%global with_devel 0
cd9902d
%global with_bundled 0
cd9902d
%global with_debug 0
cd9902d
%global with_check 0
cd9902d
%global with_unit_test 0
cd9902d
%endif
cd9902d
cd9902d
%if 0%{?with_debug}
cd9902d
%global _dwz_low_mem_die_limit 0
cd9902d
%else
cd9902d
%global debug_package   %{nil}
cd9902d
%endif
cd9902d
cd9902d
%global provider        github
cd9902d
%global provider_tld    com
cd9902d
%global project         yvasiyarov
cd9902d
%global repo            gorelic
cd9902d
# https://github.com/yvasiyarov/gorelic
cd9902d
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
cd9902d
%global import_path     %{provider_prefix}
cd9902d
%global commit          a9bba5b9ab508a086f9a12b8c51fab68478e2128
cd9902d
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
cd9902d
cd9902d
Name:           golang-%{provider}-%{project}-%{repo}
cd9902d
Version:        0
675355c
Release:        0.3.git%{shortcommit}%{?dist}
cd9902d
Summary:        New Relic agent for Go lang
cd9902d
# Detected licences
cd9902d
# - BSD (2 clause) at 'LICENSE'
cd9902d
License:        BSD
cd9902d
URL:            https://%{provider_prefix}
cd9902d
Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
cd9902d
cd9902d
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
cd9902d
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
cd9902d
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
cd9902d
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
cd9902d
cd9902d
%description
cd9902d
%{summary}
cd9902d
cd9902d
%if 0%{?with_devel}
cd9902d
%package devel
cd9902d
Summary:       %{summary}
cd9902d
BuildArch:     noarch
cd9902d
cd9902d
%if 0%{?with_check} && ! 0%{?with_bundled}
cd9902d
BuildRequires: golang(github.com/yvasiyarov/go-metrics)
cd9902d
BuildRequires: golang(github.com/yvasiyarov/newrelic_platform_go)
cd9902d
%endif
cd9902d
cd9902d
Requires:      golang(github.com/yvasiyarov/go-metrics)
cd9902d
Requires:      golang(github.com/yvasiyarov/newrelic_platform_go)
cd9902d
cd9902d
Provides:      golang(%{import_path}) = %{version}-%{release}
cd9902d
cd9902d
%description devel
cd9902d
%{summary}
cd9902d
cd9902d
This package contains library source intended for
cd9902d
building other packages which use import path with
cd9902d
%{import_path} prefix.
cd9902d
%endif
cd9902d
cd9902d
%if 0%{?with_unit_test} && 0%{?with_devel}
cd9902d
%package unit-test-devel
cd9902d
Summary:         Unit tests for %{name} package
cd9902d
%if 0%{?with_check}
cd9902d
#Here comes all BuildRequires: PACKAGE the unit tests
cd9902d
#in %%check section need for running
cd9902d
%endif
cd9902d
cd9902d
# test subpackage tests code from devel subpackage
cd9902d
Requires:        %{name}-devel = %{version}-%{release}
cd9902d
cd9902d
%if 0%{?with_check} && ! 0%{?with_bundled}
cd9902d
%endif
cd9902d
cd9902d
%description unit-test-devel
cd9902d
%{summary}
cd9902d
cd9902d
This package contains unit tests for project
cd9902d
providing packages with %{import_path} prefix.
cd9902d
%endif
cd9902d
cd9902d
%prep
cd9902d
%setup -q -n %{repo}-%{commit}
cd9902d
cd9902d
%build
cd9902d
cd9902d
%install
cd9902d
# source codes for building projects
cd9902d
%if 0%{?with_devel}
cd9902d
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
cd9902d
echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list
cd9902d
# find all *.go but no *_test.go files and generate devel.file-list
cd9902d
for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do
cd9902d
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
cd9902d
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
cd9902d
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
cd9902d
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
cd9902d
done
cd9902d
%endif
cd9902d
cd9902d
# testing files for this project
cd9902d
%if 0%{?with_unit_test} && 0%{?with_devel}
cd9902d
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
cd9902d
# find all *_test.go files and generate unit-test-devel.file-list
cd9902d
for file in $(find . -iname "*_test.go"); do
cd9902d
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
cd9902d
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
cd9902d
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
cd9902d
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test-devel.file-list
cd9902d
done
cd9902d
%endif
cd9902d
cd9902d
%if 0%{?with_devel}
cd9902d
sort -u -o devel.file-list devel.file-list
cd9902d
%endif
cd9902d
cd9902d
%check
cd9902d
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
cd9902d
%if ! 0%{?with_bundled}
cd9902d
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
cd9902d
%else
cd9902d
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath}
cd9902d
%endif
cd9902d
cd9902d
%endif
cd9902d
cd9902d
#define license tag if not already defined
cd9902d
%{!?_licensedir:%global license %doc}
cd9902d
cd9902d
%if 0%{?with_devel}
cd9902d
%files devel -f devel.file-list
cd9902d
%license LICENSE
cd9902d
%doc README.md
cd9902d
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
cd9902d
%endif
cd9902d
cd9902d
%if 0%{?with_unit_test} && 0%{?with_devel}
cd9902d
%files unit-test-devel -f unit-test-devel.file-list
cd9902d
%license LICENSE
cd9902d
%doc README.md
cd9902d
%endif
cd9902d
cd9902d
%changelog
675355c
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.3.gita9bba5b
675355c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
675355c
371c3b3
* Thu Jul 21 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.2.gita9bba5b
371c3b3
- https://fedoraproject.org/wiki/Changes/golang1.7
371c3b3
cd9902d
* Fri Mar 04 2016 jchaloup <jchaloup@redhat.com> - 0-0.1.gita9bba5b
cd9902d
- First package for Fedora
cd9902d
  resolves: #1314978