Blame golang-github-dgrijalva-jwt-go.spec

d891aa3
%if 0%{?fedora} || 0%{?rhel} == 6
d891aa3
%global with_devel 1
d891aa3
%global with_bundled 0
d891aa3
%global with_debug 0
d891aa3
%global with_check 1
d891aa3
%global with_unit_test 1
d891aa3
%else
d891aa3
%global with_devel 0
d891aa3
%global with_bundled 0
d891aa3
%global with_debug 0
d891aa3
%global with_check 0
d891aa3
%global with_unit_test 0
d891aa3
%endif
d891aa3
d891aa3
%if 0%{?with_debug}
d891aa3
%global _dwz_low_mem_die_limit 0
d891aa3
%else
d891aa3
%global debug_package   %{nil}
d891aa3
%endif
d891aa3
d891aa3
%global provider        github
d891aa3
%global provider_tld    com
d891aa3
%global project         dgrijalva
d891aa3
%global repo            jwt-go
d891aa3
# https://github.com/dgrijalva/jwt-go
d891aa3
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
d891aa3
%global import_path     %{provider_prefix}
d891aa3
%global commit          5ca80149b9d3f8b863af0e2bb6742e608603bd99
d891aa3
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
d891aa3
d891aa3
Name:           golang-%{provider}-%{project}-%{repo}
d891aa3
Version:        2.2.0
1a5b162
Release:        6%{?dist}
d891aa3
Summary:        Golang implementation of JSON Web Tokens (JWT)
d891aa3
License:        MIT
d891aa3
URL:            https://%{provider_prefix}
d891aa3
Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
d891aa3
d891aa3
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
d891aa3
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
d891aa3
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
d891aa3
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
d891aa3
d891aa3
%description
d891aa3
%{summary}
d891aa3
d891aa3
%if 0%{?with_devel}
d891aa3
%package devel
d891aa3
Summary:       %{summary}
d891aa3
BuildArch:     noarch
d891aa3
d891aa3
%if 0%{?with_check}
d891aa3
%endif
d891aa3
d891aa3
d891aa3
Provides:      golang(%{import_path}) = %{version}-%{release}
d891aa3
d891aa3
%description devel
d891aa3
%{summary}
d891aa3
d891aa3
This package contains library source intended for
d891aa3
building other packages which use import path with
d891aa3
%{import_path} prefix.
d891aa3
%endif
d891aa3
d891aa3
%if 0%{?with_unit_test} && 0%{?with_devel}
d891aa3
%package unit-test
d891aa3
Summary:         Unit tests for %{name} package
d891aa3
%if 0%{?with_check}
d891aa3
#Here comes all BuildRequires: PACKAGE the unit tests
d891aa3
#in %%check section need for running
d891aa3
%endif
d891aa3
d891aa3
# test subpackage tests code from devel subpackage
d891aa3
Requires:        %{name}-devel = %{version}-%{release}
d891aa3
d891aa3
%description unit-test
d891aa3
%{summary}
d891aa3
d891aa3
This package contains unit tests for project
d891aa3
providing packages with %{import_path} prefix.
d891aa3
%endif
d891aa3
d891aa3
%prep
d891aa3
%setup -q -n %{repo}-%{commit}
d891aa3
d891aa3
%build
d891aa3
d891aa3
%install
d891aa3
# source codes for building projects
d891aa3
%if 0%{?with_devel}
d891aa3
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
d891aa3
echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list
d891aa3
# find all *.go but no *_test.go files and generate devel.file-list
d891aa3
for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do
d891aa3
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
d891aa3
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
d891aa3
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
d891aa3
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
d891aa3
done
d891aa3
%endif
d891aa3
d891aa3
# testing files for this project
d891aa3
%if 0%{?with_unit_test} && 0%{?with_devel}
d891aa3
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
d891aa3
# find all *_test.go files and generate unit-test.file-list
d891aa3
for file in $(find . -iname "*_test.go"); do
d891aa3
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
d891aa3
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
d891aa3
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
d891aa3
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list
d891aa3
done
d891aa3
cp -rpav test %{buildroot}/%{gopath}/src/%{import_path}/test
d891aa3
echo "%%{gopath}/src/%%{import_path}/test" >> unit-test.file-list
d891aa3
%endif
d891aa3
d891aa3
%if 0%{?with_devel}
d891aa3
sort -u -o devel.file-list devel.file-list
d891aa3
%endif
d891aa3
d891aa3
%check
d891aa3
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
d891aa3
%if ! 0%{?with_bundled}
d891aa3
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
d891aa3
%else
d891aa3
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath}
d891aa3
%endif
d891aa3
d891aa3
%if ! 0%{?gotest:1}
d891aa3
%global gotest go test
d891aa3
%endif
d891aa3
d891aa3
%gotest %{import_path}
d891aa3
%endif
d891aa3
d891aa3
#define license tag if not already defined
d891aa3
%{!?_licensedir:%global license %doc}
d891aa3
d891aa3
%if 0%{?with_devel}
d891aa3
%files devel -f devel.file-list
d891aa3
%license LICENSE
d891aa3
%doc VERSION_HISTORY.md README.md
d891aa3
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
d891aa3
%endif
d891aa3
d891aa3
%if 0%{?with_unit_test} && 0%{?with_devel}
d891aa3
%files unit-test -f unit-test.file-list
d891aa3
%license LICENSE
d891aa3
%doc VERSION_HISTORY.md README.md
d891aa3
%endif
d891aa3
d891aa3
%changelog
1a5b162
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-6
1a5b162
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
1a5b162
cd9df1d
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-5
cd9df1d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
cd9df1d
4cec15e
* Thu Jul 21 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.0-4
4cec15e
- https://fedoraproject.org/wiki/Changes/golang1.7
4cec15e
391a1bf
* Mon Feb 22 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.0-3
391a1bf
- https://fedoraproject.org/wiki/Changes/golang1.6
391a1bf
dc80cb2
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-2
dc80cb2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
dc80cb2
d891aa3
* Thu Oct 08 2015 jchaloup <jchaloup@redhat.com> - 2.2.0-1.git5ca8014
d891aa3
- First package for Fedora
d891aa3
  resolves: #1269813
d891aa3