Blame golang-github-kballard-go-shellquote.spec

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