2518e8b
%if 0%{?fedora} || 0%{?rhel} == 6
Fridolin Pokorny fbc6509
%global with_devel 1
Fridolin Pokorny fbc6509
%global with_bundled 0
Fridolin Pokorny fbc6509
%global with_debug 0
Fridolin Pokorny fbc6509
# No tests provided
Fridolin Pokorny fbc6509
%global with_check 0
Fridolin Pokorny fbc6509
%global with_unit_test 0
Fridolin Pokorny fbc6509
%else
Fridolin Pokorny fbc6509
%global with_devel 0
Fridolin Pokorny fbc6509
%global with_bundled 0
Fridolin Pokorny fbc6509
%global with_debug 0
Fridolin Pokorny fbc6509
%global with_check 0
Fridolin Pokorny fbc6509
%global with_unit_test 0
Fridolin Pokorny fbc6509
%endif
Fridolin Pokorny fbc6509
Fridolin Pokorny fbc6509
%if 0%{?with_debug}
Fridolin Pokorny fbc6509
%global _dwz_low_mem_die_limit 0
Fridolin Pokorny fbc6509
%else
7fdc969
%global debug_package   %{nil}
Fridolin Pokorny fbc6509
%endif
Fridolin Pokorny fbc6509
3a52de7
%global provider        github
3a52de7
%global provider_tld    com
3a52de7
%global project         kr
3a52de7
%global repo            pty
Fridolin Pokorny fbc6509
# https://github.com/kr/pty
Fridolin Pokorny fbc6509
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
Fridolin Pokorny fbc6509
%global import_path     %{provider_prefix}
118c934
%global commit          f7ee69f31298ecbe5d2b349c711e2547a617d398
5368d5b
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
5368d5b
15ca666
Name:           golang-github-kr-pty
5368d5b
Version:        0
abc5261
Release:        0.31.git%{shortcommit}%{?dist}
5368d5b
Summary:        PTY interface for Go
5368d5b
License:        MIT
2518e8b
URL:            https://godoc.org/%{import_path}
Fridolin Pokorny fbc6509
Source0:        https://%{provider_prefix}/archive/%{commit}/pty-%{shortcommit}.tar.gz
Fridolin Pokorny fbc6509
b496e6d
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
b496e6d
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
b496e6d
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
b496e6d
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
5368d5b
5368d5b
%description
5368d5b
Pty is a Go package for using UNIX pseudo-terminals.
5368d5b
Fridolin Pokorny fbc6509
%if 0%{?with_devel}
5368d5b
%package devel
Fridolin Pokorny fbc6509
Summary:       %{summary}
Fridolin Pokorny fbc6509
BuildArch:     noarch
Fridolin Pokorny fbc6509
Fridolin Pokorny fbc6509
%if 0%{?with_check}
Fridolin Pokorny fbc6509
%endif
Fridolin Pokorny fbc6509
Fridolin Pokorny fbc6509
Provides:      golang(%{import_path}) = %{version}-%{release}
5368d5b
5368d5b
%description devel
15ca666
Pty is a Go package for using UNIX pseudo-terminals.
15ca666
Fridolin Pokorny fbc6509
This package contains library source intended for
Fridolin Pokorny fbc6509
building other packages which use import path with
Fridolin Pokorny fbc6509
%{import_path} prefix.
Fridolin Pokorny fbc6509
%endif
Fridolin Pokorny fbc6509
b496e6d
%if 0%{?with_unit_test} && 0%{?with_devel}
Fridolin Pokorny fbc6509
%package unit-test
Fridolin Pokorny fbc6509
Summary:         Unit tests for %{name} package
b496e6d
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
b496e6d
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
Fridolin Pokorny fbc6509
Fridolin Pokorny fbc6509
%if 0%{?with_check}
Fridolin Pokorny fbc6509
#Here comes all BuildRequires: PACKAGE the unit tests
Fridolin Pokorny fbc6509
#in %%check section need for running
Fridolin Pokorny fbc6509
%endif
Fridolin Pokorny fbc6509
Fridolin Pokorny fbc6509
# test subpackage tests code from devel subpackage
Fridolin Pokorny fbc6509
Requires:        %{name}-devel = %{version}-%{release}
Fridolin Pokorny fbc6509
Fridolin Pokorny fbc6509
%description unit-test
Fridolin Pokorny fbc6509
%{summary}
Fridolin Pokorny fbc6509
Fridolin Pokorny fbc6509
This package contains unit tests for project
Fridolin Pokorny fbc6509
providing packages with %{import_path} prefix.
Fridolin Pokorny fbc6509
%endif
5368d5b
5368d5b
%prep
3a52de7
%setup -q -n %{repo}-%{commit}
5368d5b
5368d5b
%build
5368d5b
5368d5b
%install
Fridolin Pokorny fbc6509
# source codes for building projects
Fridolin Pokorny fbc6509
%if 0%{?with_devel}
Fridolin Pokorny fbc6509
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
b496e6d
echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list
Fridolin Pokorny fbc6509
# find all *.go but no *_test.go files and generate devel.file-list
Fridolin Pokorny fbc6509
for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do
b496e6d
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
Fridolin Pokorny fbc6509
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
Fridolin Pokorny fbc6509
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
Fridolin Pokorny fbc6509
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
Fridolin Pokorny fbc6509
done
Fridolin Pokorny fbc6509
%endif
Fridolin Pokorny fbc6509
Fridolin Pokorny fbc6509
# testing files for this project
b496e6d
%if 0%{?with_unit_test} && 0%{?with_devel}
Fridolin Pokorny fbc6509
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
Fridolin Pokorny fbc6509
# find all *_test.go files and generate unit-test.file-list
Fridolin Pokorny fbc6509
for file in $(find . -iname "*_test.go"); do
b496e6d
    echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list
Fridolin Pokorny fbc6509
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
Fridolin Pokorny fbc6509
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
Fridolin Pokorny fbc6509
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list
Fridolin Pokorny fbc6509
done
Fridolin Pokorny fbc6509
%endif
Fridolin Pokorny fbc6509
b496e6d
%if 0%{?with_devel}
b496e6d
sort -u -o devel.file-list devel.file-list
b496e6d
%endif
b496e6d
Fridolin Pokorny fbc6509
%check
Fridolin Pokorny fbc6509
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
b496e6d
%if ! 0%{?with_bundled}
b496e6d
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
Fridolin Pokorny fbc6509
%else
b496e6d
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath}
Fridolin Pokorny fbc6509
%endif
b496e6d
b496e6d
%if ! 0%{?gotest:1}
b496e6d
%global gotest go test
Fridolin Pokorny fbc6509
%endif
Fridolin Pokorny fbc6509
Fridolin Pokorny fbc6509
%endif
5368d5b
b496e6d
#define license tag if not already defined
b496e6d
%{!?_licensedir:%global license %doc}
b496e6d
Fridolin Pokorny fbc6509
%if 0%{?with_devel}
Fridolin Pokorny fbc6509
%files devel -f devel.file-list
b496e6d
%license License
Fridolin Pokorny fbc6509
%doc README.md
3a52de7
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
Fridolin Pokorny fbc6509
%endif
Fridolin Pokorny fbc6509
b496e6d
%if 0%{?with_unit_test} && 0%{?with_devel}
Fridolin Pokorny fbc6509
%files unit-test -f unit-test.file-list
b496e6d
%license License
Fridolin Pokorny fbc6509
%doc README.md
Fridolin Pokorny fbc6509
%endif
15ca666
5368d5b
%changelog
abc5261
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.31.gitf7ee69f
abc5261
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
abc5261
62eda6e
* Thu Jul 21 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.30.gitf7ee69f
62eda6e
- https://fedoraproject.org/wiki/Changes/golang1.7
62eda6e
2518e8b
* Thu Mar 03 2016 jchaloup <jchaloup@redhat.com> - 0-0.29.gitf7ee69f
2518e8b
- Fix fedora macro
2518e8b
  resolves: #1313956
2518e8b
118c934
* Sat Feb 27 2016 Peter Robinson <pbrobinson@fedoraproject.org> 0-0.28.gitf7ee69f
118c934
- Bump to upstream f7ee69f31298ecbe5d2b349c711e2547a617d398 (add aarch64 support)
118c934
8852aee
* Mon Feb 22 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.27.git05017fc
8852aee
- https://fedoraproject.org/wiki/Changes/golang1.6
8852aee
136bb29
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.26.git05017fc
136bb29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
136bb29
b496e6d
* Sat Sep 12 2015 jchaloup <jchaloup@redhat.com> - 0-0.25.git05017fc
b496e6d
- Update to spec-2.1
b496e6d
  related: #1254595
b496e6d
Fridolin Pokorny fbc6509
* Wed Aug 12 2015 Fridolin Pokorny <fpokorny@redhat.com> - 0-0.24.git05017fc
Fridolin Pokorny fbc6509
- Update spec file to spec-2.0
Fridolin Pokorny fbc6509
  resolves: #1254595
Fridolin Pokorny fbc6509
164174b
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.23.git05017fc
164174b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
164174b
3a52de7
* Wed Feb 25 2015 jchaloup <jchaloup@redhat.com> - 0-0.22.git05017fc
3a52de7
- Bump to upstream 05017fcccf23c823bfdea560dcc958a136e54fb7
3a52de7
  related: #1001396
3a52de7
03cd17a
* Thu Jul 31 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.21.git
03cd17a
- do not own dirs owned by golang
03cd17a
- archfulness and defattr for el6 only
03cd17a
e2cd170
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.20.git67e2db2
e2cd170
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
e2cd170
2f81b5e
* Sat May 31 2014 Lokesh Mandvekar <lsm5@redhat.com> 0-0.19.git
2f81b5e
- update to commit 67e2db24c8 (required for docker 1.0
2f81b5e
https://github.com/dotcloud/docker/issues/5908 )
2f81b5e
5c6be9a
* Wed Jan 15 2014 Lokesh Mandvekar <lsm5@redhat.com> 0-0.18.git3b1f648
5c6be9a
- exclusivearch for el6+
5c6be9a
3fb37bc
* Wed Jan 15 2014 Lokesh Mandvekar <lsm5@redhat.com> 0-0.17.git3b1f648
3fb37bc
- revert golang >= 1.2 version requirement
3fb37bc
d419aca
* Wed Jan 15 2014 Lokesh Mandvekar <lsm5@redhat.com> 0-0.16.git3b1f648
d419aca
- require golang 1.2 and up
d419aca
30f3d48
* Wed Oct 16 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.15.git3b1f648
30f3d48
- removed double quotes from provides
30f3d48
a84c794
* Tue Oct 08 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.14.git3b1f648
a84c794
- noarch for f19+ and rhel7+, exclusivearch otherwise
a84c794
4e3e016
* Mon Oct 07 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.13.git3b1f648
4e3e016
- exclusivearch as per golang
4e3e016
4e3e016
* Sun Oct 06 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.12.git3b1f648
7fdc969
- excluded for ppc64
7fdc969
- debug_package nil
7fdc969
0b068c3
* Wed Oct 02 2013 Lokesh Mandvekar <lsm5@fedoraproject.org> 0-0.11.git3b1f648
0b068c3
- docker first run error fix
0b068c3
15ca666
* Sun Sep 22 2013 Matthew Miller <mattdm@fedoraproject.org> 0-0.10.git27435c6
15ca666
- install just the source code for devel package
15ca666
5368d5b
* Tue Sep 17 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.9.git27435c6
5368d5b
- version format changed
5368d5b
- docdir unversioned
5368d5b
5368d5b
* Mon Sep 16 2013 Lokesh Mandvekar <lsm5@redhat.com> git27435c6-8
5368d5b
- No debuginfo generated, was empty to begin with
5368d5b
- package owns all directories in import_path
5368d5b
5368d5b
* Mon Sep 16 2013 Lokesh Mandvekar <lsm5@redhat.com> git27435c6-7
5368d5b
- only devel package generated
5368d5b
- Provides moved to devel package
5368d5b
- docdir modified
5368d5b
5368d5b
* Wed Sep 11 2013 Lokesh Mandvekar <lsm5@redhat.com> git27435c6-6
5368d5b
- rm from install section removed
5368d5b
5368d5b
* Tue Sep 10 2013 Lokesh Mandvekar <lsm5@redhat.com> git27435c6-5
5368d5b
- cleanup in prep and build as per guidelines
5368d5b
5368d5b
* Tue Sep 10 2013 Lokesh Mandvekar <lsm5@redhat.com> git27435c6-4
5368d5b
- Build under all circumstances
5368d5b
- Go pkg archives handled (thanks to Vincent Batts (vbatts@redhat.com)
5368d5b
5368d5b
* Thu Aug 29 2013 Lokesh Mandvekar <lsm5@redhat.com> 0.0.1-3
5368d5b
- Devel package generated
5368d5b
5368d5b
* Wed Aug 28 2013 Lokesh Mandvekar <lsm5@redhat.com> 0.0.1-2
5368d5b
- Fixed permissions
5368d5b
5368d5b
* Mon Aug 26 2013 Lokesh Mandvekar <lsm5@redhat.com> 0.0.1-1
5368d5b
- Initial fedora package
b496e6d