Blame golang-googlecode-net.spec

1e13078
%if 0%{?fedora} || 0%{?rhel} == 6
ff3b7b7
%global with_devel 1
ff3b7b7
%global with_bundled 0
3275d32
%global with_debug 0
ff3b7b7
%global with_check 1
1e13078
%global with_unit_test 1
ff3b7b7
%else
ff3b7b7
%global with_devel 0
1e13078
%global with_bundled 0
ff3b7b7
%global with_debug 0
ff3b7b7
%global with_check 0
1e13078
%global with_unit_test 0
ff3b7b7
%endif
ff3b7b7
ff3b7b7
%if 0%{?with_debug}
ff3b7b7
%global _dwz_low_mem_die_limit 0
ff3b7b7
%else
8a1dd91
%global debug_package   %{nil}
ff3b7b7
%endif
1e13078
8a1dd91
%global provider_tld    com
ab022d1
%global provider        github
ab022d1
%global project         golang
8a1dd91
%global repo            net
1e13078
# https://github.com/golang/net
1e13078
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
ab022d1
%global import_path     code.google.com/p/go.net
02f5af7
%global commit          1bc0720082d79ce7ffc6ef6e523d00d46b0dee45
ab022d1
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
4b66dc7
8e7b9a8
%global x_provider      golang
8e7b9a8
%global x_provider_tld  org
8e7b9a8
%global x_repo          net
8e7b9a8
%global x_import_path   %{x_provider}.%{x_provider_tld}/x/%{x_repo}
8e7b9a8
%global x_name          golang-%{x_provider}%{x_provider_tld}-%{repo}
8e7b9a8
b5ee3d9
%global devel_main      golang-golangorg-net-devel
b5ee3d9
%global devel_prefix    x
b5ee3d9
ab022d1
Name:       golang-googlecode-net
8a1dd91
Version:    0
8439db1
Release:    0.28.git%{shortcommit}%{?dist}
8a1dd91
Summary:    Supplementary Go networking libraries
8a1dd91
License:    BSD
1e13078
URL:        https://%{provider_prefix}
1e13078
Source0:    https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
1e13078
558160c
# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required
558160c
ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
558160c
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
558160c
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
4b66dc7
4b66dc7
%description
4b66dc7
%{summary}
4b66dc7
ff3b7b7
%if 0%{?with_devel}
4b66dc7
%package devel
1e13078
Summary:       Supplementary Go networking libraries for code.google.com/p/ imports
1e13078
BuildArch:     noarch
1e13078
1e13078
%if 0%{?with_check}
8a1dd91
BuildRequires:  golang(code.google.com/p/go.text/encoding)
8a1dd91
BuildRequires:  golang(code.google.com/p/go.text/encoding/charmap)
8a1dd91
BuildRequires:  golang(code.google.com/p/go.text/encoding/japanese)
8a1dd91
BuildRequires:  golang(code.google.com/p/go.text/encoding/korean)
8a1dd91
BuildRequires:  golang(code.google.com/p/go.text/encoding/simplifiedchinese)
8a1dd91
BuildRequires:  golang(code.google.com/p/go.text/encoding/traditionalchinese)
8a1dd91
BuildRequires:  golang(code.google.com/p/go.text/encoding/unicode)
8a1dd91
BuildRequires:  golang(code.google.com/p/go.text/transform)
1e13078
%endif
1e13078
b5ee3d9
Requires:  golang(code.google.com/p/go.text/encoding)
b5ee3d9
Requires:  golang(code.google.com/p/go.text/encoding/charmap)
b5ee3d9
Requires:  golang(code.google.com/p/go.text/encoding/japanese)
b5ee3d9
Requires:  golang(code.google.com/p/go.text/encoding/korean)
b5ee3d9
Requires:  golang(code.google.com/p/go.text/encoding/simplifiedchinese)
b5ee3d9
Requires:  golang(code.google.com/p/go.text/encoding/traditionalchinese)
b5ee3d9
Requires:  golang(code.google.com/p/go.text/encoding/unicode)
b5ee3d9
Requires:  golang(code.google.com/p/go.text/transform)
1e13078
8a1dd91
Provides:   golang(%{import_path}/context) = %{version}-%{release}
02f5af7
Provides:   golang(%{import_path}/context/ctxhttp) = %{version}-%{release}
8a1dd91
Provides:   golang(%{import_path}/dict) = %{version}-%{release}
8a1dd91
Provides:   golang(%{import_path}/html) = %{version}-%{release}
8a1dd91
Provides:   golang(%{import_path}/html/atom) = %{version}-%{release}
8a1dd91
Provides:   golang(%{import_path}/html/charset) = %{version}-%{release}
b5ee3d9
Provides:   golang(%{import_path}/icmp) = %{version}-%{release}
8a1dd91
Provides:   golang(%{import_path}/idna) = %{version}-%{release}
8a1dd91
Provides:   golang(%{import_path}/ipv4) = %{version}-%{release}
8a1dd91
Provides:   golang(%{import_path}/ipv6) = %{version}-%{release}
b5ee3d9
Provides:   golang(%{import_path}/netutil) = %{version}-%{release}
8a1dd91
Provides:   golang(%{import_path}/proxy) = %{version}-%{release}
8a1dd91
Provides:   golang(%{import_path}/publicsuffix) = %{version}-%{release}
ff3b7b7
Provides:   golang(%{import_path}/trace) = %{version}-%{release}
b5ee3d9
Provides:   golang(%{import_path}/webdav) = %{version}-%{release}
8a1dd91
Provides:   golang(%{import_path}/websocket) = %{version}-%{release}
4b66dc7
8e7b9a8
%package -n %{x_name}-devel
1e13078
Summary:       Supplementary Go networking libraries for golang.org/x/ imports
1e13078
BuildArch:     noarch
1e13078
1e13078
%if 0%{?with_unit_test}
8e7b9a8
BuildRequires:  golang(golang.org/x/text/encoding)
8e7b9a8
BuildRequires:  golang(golang.org/x/text/encoding/charmap)
8e7b9a8
BuildRequires:  golang(golang.org/x/text/encoding/japanese)
8e7b9a8
BuildRequires:  golang(golang.org/x/text/encoding/korean)
8e7b9a8
BuildRequires:  golang(golang.org/x/text/encoding/simplifiedchinese)
8e7b9a8
BuildRequires:  golang(golang.org/x/text/encoding/traditionalchinese)
8e7b9a8
BuildRequires:  golang(golang.org/x/text/encoding/unicode)
8e7b9a8
BuildRequires:  golang(golang.org/x/text/transform)
1e13078
%endif
1e13078
b5ee3d9
Requires:  golang(golang.org/x/text/encoding)
b5ee3d9
Requires:  golang(golang.org/x/text/encoding/charmap)
b5ee3d9
Requires:  golang(golang.org/x/text/encoding/japanese)
b5ee3d9
Requires:  golang(golang.org/x/text/encoding/korean)
b5ee3d9
Requires:  golang(golang.org/x/text/encoding/simplifiedchinese)
b5ee3d9
Requires:  golang(golang.org/x/text/encoding/traditionalchinese)
b5ee3d9
Requires:  golang(golang.org/x/text/encoding/unicode)
b5ee3d9
Requires:  golang(golang.org/x/text/transform)
b5ee3d9
8e7b9a8
Provides:   golang(%{x_import_path}/context) = %{version}-%{release}
02f5af7
Provides:   golang(%{x_import_path}/context/ctxhttp) = %{version}-%{release}
8e7b9a8
Provides:   golang(%{x_import_path}/dict) = %{version}-%{release}
8e7b9a8
Provides:   golang(%{x_import_path}/html) = %{version}-%{release}
8e7b9a8
Provides:   golang(%{x_import_path}/html/atom) = %{version}-%{release}
8e7b9a8
Provides:   golang(%{x_import_path}/html/charset) = %{version}-%{release}
b5ee3d9
Provides:   golang(%{x_import_path}/icmp) = %{version}-%{release}
8e7b9a8
Provides:   golang(%{x_import_path}/idna) = %{version}-%{release}
8e7b9a8
Provides:   golang(%{x_import_path}/ipv4) = %{version}-%{release}
8e7b9a8
Provides:   golang(%{x_import_path}/ipv6) = %{version}-%{release}
b5ee3d9
Provides:   golang(%{x_import_path}/netutil) = %{version}-%{release}
8e7b9a8
Provides:   golang(%{x_import_path}/proxy) = %{version}-%{release}
8e7b9a8
Provides:   golang(%{x_import_path}/publicsuffix) = %{version}-%{release}
ff3b7b7
Provides:   golang(%{x_import_path}/trace) = %{version}-%{release}
b5ee3d9
Provides:   golang(%{x_import_path}/webdav) = %{version}-%{release}
8e7b9a8
Provides:   golang(%{x_import_path}/websocket) = %{version}-%{release}
8e7b9a8
4b66dc7
%description devel
4b66dc7
%{summary}
4b66dc7
bc4883d
This package contains library source intended for building other packages
8e7b9a8
which use the supplementary Go networking libraries with code.google.com/p/ imports.
8e7b9a8
8e7b9a8
%description -n %{x_name}-devel
8e7b9a8
8e7b9a8
This package contains library source intended for building other packages
8e7b9a8
which use the supplementary Go text libraries with golang.org/x/ imports.
ff3b7b7
%endif
bc4883d
1e13078
%if 0%{?with_unit_test}
1e13078
%package unit-test
1e13078
Summary:         Unit tests for %{name} package
1e13078
1e13078
%if 0%{?with_check}
1e13078
#Here comes all BuildRequires: PACKAGE the unit tests
1e13078
#in %%check section need for running
1e13078
%endif
1e13078
1e13078
# test subpackage tests code from devel subpackage
1e13078
Requires:        %{name}-devel = %{version}-%{release}
1e13078
1e13078
%description unit-test
1e13078
%{summary}
1e13078
1e13078
This package contains unit tests for project
1e13078
providing packages with %{x_import_path} prefix.
1e13078
%endif
bc4883d
1e13078
%prep
ab022d1
%setup -q -n %{repo}-%{commit}
4b66dc7
4b66dc7
%build
4b66dc7
4b66dc7
%install
1e13078
# source codes for building projects
ff3b7b7
%if 0%{?with_devel}
1e13078
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
1e13078
install -d -p %{buildroot}/%{gopath}/src/%{x_import_path}/
1e13078
# find all *.go but no *_test.go files and generate devel.file-list
1e13078
for ext in go s; do
1e13078
    for file in $(find . -iname "*.${ext}" \! -iname "*_test.go") ; do
1e13078
        install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
1e13078
        cp $file %{buildroot}/%{gopath}/src/%{import_path}/$file
1e13078
        echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
1e13078
1e13078
        install -d -p %{buildroot}/%{gopath}/src/%{x_import_path}/$(dirname $file)
1e13078
        cp $file %{buildroot}/%{gopath}/src/%{x_import_path}/$file
1e13078
        echo "%%{gopath}/src/%%{x_import_path}/$file" >> x_devel.file-list
1e13078
    done
bc4883d
done
4b66dc7
1e13078
pushd %{buildroot}/%{gopath}/src/%{import_path}/
780a70a
sed -i 's/"golang\.org\/x\//"code\.google\.com\/p\/go\./g' \
780a70a
        $(find . -name '*.go')
1e13078
popd
1e13078
%endif
1e13078
1e13078
# testing files for this project
1e13078
%if 0%{?with_unit_test}
1e13078
install -d -p %{buildroot}/%{gopath}/src/%{x_import_path}/
1e13078
install -d -p %{buildroot}/%{gopath}/src/%{x_import_path}/html/testdata
1e13078
install -d -p %{buildroot}/%{gopath}/src/%{x_import_path}/html/charset/testdata
1e13078
cp -rpav html/testdata %{buildroot}/%{gopath}/src/%{x_import_path}/html
1e13078
cp -rpav html/charset/testdata %{buildroot}/%{gopath}/src/%{x_import_path}/html/charset
1e13078
echo "%%{gopath}/src/%%{x_import_path}/html/testdata" >> unit-test.file-list
1e13078
echo "%%{gopath}/src/%%{x_import_path}/html/charset/testdata" >> unit-test.file-list
1e13078
# find all files with $ext prefix and generate unit-test.file-list
1e13078
for file in $(find . -iname "*_test.go"); do
1e13078
    install -d -p %{buildroot}/%{gopath}/src/%{x_import_path}/$(dirname $file)
1e13078
    cp $file %{buildroot}/%{gopath}/src/%{x_import_path}/$file
1e13078
    echo "%%{gopath}/src/%%{x_import_path}/$file" >> unit-test.file-list
1e13078
done
ff3b7b7
%endif
780a70a
f212b2f
%check
1e13078
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
1e13078
%ifarch 0%{?gccgo_arches}
1e13078
function gotest { %{gcc_go_test} "$@"; }
1e13078
%else
1e13078
%if 0%{?golang_test:1}
1e13078
function gotest { %{golang_test} "$@"; }
1e13078
%else
1e13078
function gotest { go test "$@"; }
1e13078
%endif
1e13078
%endif
1e13078
ff3b7b7
export GOPATH=%{buildroot}%{gopath}:%{gopath}
02f5af7
go test %{x_import_path}/context
02f5af7
go test %{x_import_path}/context/ctxhttp
1e13078
go test %{x_import_path}/html
1e13078
go test %{x_import_path}/html/atom
1e13078
go test %{x_import_path}/html/charset
02f5af7
# socket: permission denied
02f5af7
#go test %%{x_import_path}/icmp
1e13078
go test %{x_import_path}/idna
1e13078
go test %{x_import_path}/internal/timeseries
1e13078
go test %{x_import_path}/ipv4
1e13078
go test %{x_import_path}/ipv6
1e13078
go test %{x_import_path}/netutil
1e13078
go test %{x_import_path}/proxy
1e13078
go test %{x_import_path}/publicsuffix
1e13078
go test %{x_import_path}/trace
1e13078
go test %{x_import_path}/webdav
02f5af7
go test %{x_import_path}/webdav/internal/xml
1e13078
go test %{x_import_path}/websocket
1e13078
%endif
f212b2f
558160c
#define license tag if not already defined
558160c
%{!?_licensedir:%global license %doc}
558160c
ff3b7b7
%if 0%{?with_devel}
1e13078
%files devel -f devel.file-list
558160c
%license LICENSE
1e13078
%doc AUTHORS CONTRIBUTORS PATENTS README CONTRIBUTING.md
1e13078
%dir %{gopath}/src/%{import_path}
1e13078
1e13078
%files -n %{x_name}-devel -f x_devel.file-list
558160c
%license LICENSE
1e13078
%doc AUTHORS CONTRIBUTORS PATENTS README CONTRIBUTING.md
1e13078
%dir %{gopath}/src/%{x_import_path}
1e13078
%endif
8e7b9a8
1e13078
%if 0%{?with_unit_test}
1e13078
%files unit-test -f unit-test.file-list
558160c
%license LICENSE
1e13078
%doc AUTHORS CONTRIBUTORS PATENTS README CONTRIBUTING.md
ff3b7b7
%endif
4b66dc7
4b66dc7
%changelog
8439db1
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.28.git1bc0720
8439db1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
8439db1
02f5af7
* Mon Oct 19 2015 jchaloup <jchaloup@redhat.com> - 0-0.27.git1bc0720
02f5af7
- Bump to upstream 1bc0720082d79ce7ffc6ef6e523d00d46b0dee45
02f5af7
  related: #1230677
02f5af7
558160c
* Thu Sep 24 2015 Peter Robinson <pbrobinson@fedoraproject.org> 0-0.6.git446d52d
558160c
- Change deps on compiler(go-compiler)
558160c
- Update Arches
558160c
- Use %%license
558160c
1e13078
* Wed Jul 29 2015 jchaloup <jchaloup@redhat.com> - 0-0.25.git446d52d
1e13078
- Update of spec file to spec-2.0
1e13078
  related: #1230677
1e13078
bcd1547
* Thu Jul 23 2015 jchaloup <jchaloup@redhat.com> - 0-0.24.git446d52d
bcd1547
- No debuginfo
bcd1547
  related: #1230677
bcd1547
ff3b7b7
* Thu Jul 23 2015 jchaloup <jchaloup@redhat.com> - 0-0.23.git446d52d
ff3b7b7
- Bump to upstream 446d52dd4018303a13b36097e26d0888aca5d6ef
ff3b7b7
  related: #1230677
ff3b7b7
fa7cabf
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.22.git7dbad50
fa7cabf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
fa7cabf
b5ee3d9
* Thu Jun 11 2015 jchaloup <jchaloup@redhat.com> - 0-0.21.git7dbad50
b5ee3d9
- Bump to 7dbad50ab5b31073856416cdcfeb2796d682f844
b5ee3d9
  resolves: #1230677
b5ee3d9
ab022d1
* Fri Feb 06 2015 jchaloup <jchaloup@redhat.com> - 0-0.20.git71586c3
ab022d1
- Bump to upstream 71586c3cf98f806af322c5a361660eb046e00501
ab022d1
- Repo moved to github, changing spec file header and globals
ab022d1
546ae7f
* Thu Dec 18 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.19.hg937a34c9de13
546ae7f
- Resolves: rhbz#1056185 disable ipv6 test
546ae7f
- also disable html/charset test
546ae7f
780a70a
* Tue Dec 09 2014 jchaloup <jchaloup@redhat.com> - 0-0.18.hg937a34c9de13
780a70a
- Update to the latest commit 937a34c9de13c766c814510f76bca091dee06028
780a70a
  related: #1009967
780a70a
8e7b9a8
* Mon Nov 24 2014 jchaloup <jchaloup@redhat.com> - 0-0.17.hg90e232e2462d
8e7b9a8
- Extend import paths for golang.org/x/
8e7b9a8
- context test failing on master
8e7b9a8
  related: #1009967
8e7b9a8
8a1dd91
* Mon Sep 29 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.16.hg90e232e2462d
8a1dd91
- Resolves: rhbz#1147193 - update to latest upstream revision 
8a1dd91
  90e232e2462dedc03bf3c93358da62d54d55dfb6
8a1dd91
- don't redefine gopath, don't own dirs owned by golang
8a1dd91
- use golang >= 1.2.1-3 for golang specific rpm macros
8a1dd91
- preserve timestamps of copied files
8a1dd91
- br stuff from golang-googlecode-text
8a1dd91
Vincent Batts fe7eaf7
* Fri Jul 11 2014 Vincent Batts <vbatts@fedoraproject.org> - 0-0.15.hg84a4013f96e0
Vincent Batts fe7eaf7
- don't fail on ipv6 test bz1056185
Vincent Batts fe7eaf7
9d51816
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.14.hg84a4013f96e0
9d51816
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
9d51816
f212b2f
* Fri Jan 17 2014 Lokesh Mandvekar <lsm5@redhat.com> 0-0.13.hg84a4013f96e0
f212b2f
- golang exclusivearch for el6+
f212b2f
- add check
f212b2f
4cd6095
* Fri Jan 17 2014 Lokesh Mandvekar <lsm5@redhat.com> 0-0.12.hg84a4013f96e0
4cd6095
- revert golang >= 1.2 version requirement
4cd6095
0237aff
* Wed Jan 15 2014 Lokesh Mandvekar <lsm5@redhat.com> 0-0.11.hg84a4013f96e0
0237aff
- require golang 1.2 and up
0237aff
cc40863
* Wed Oct 16 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.10.hg84a4013f96e0
cc40863
- removed double quotes from Provides
cc40863
d255514
* Tue Oct 08 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.9.hg84a4013f96e0
d255514
- noarch for f19+ and rhel7+, exclusivearch otherwise
d255514
9355824
* Mon Oct 07 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.8.hg84a4013f96e0
9355824
- exclusivearch as per golang package
9355824
- debug_package nil
9355824
bc4883d
* Sun Sep 22 2013 Matthew Miller <mattdm@fedoraproject.org> 0-0.7.hg
bc4883d
- install just the source code for devel package
bc4883d
ce564c4
* Fri Sep 20 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.6.hg
ce564c4
- All Provides listed explicitly
ce564c4
4b66dc7
* Fri Sep 20 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.5.hg
4b66dc7
- Provides corrected
4b66dc7
4b66dc7
* Fri Sep 20 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.4.hg
4b66dc7
- comment cleanup
4b66dc7
- build explanation
4b66dc7
4b66dc7
* Fri Sep 20 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.3.hg
4b66dc7
- html/webkit/scripted ownership set
4b66dc7
- codereview.cfg not packaged
4b66dc7
4b66dc7
* Fri Sep 20 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.2.hg
4b66dc7
- IPv6 doesn't build
4b66dc7
- Typo correction
4b66dc7
- directory ownership taken care of
4b66dc7
4b66dc7
* Thu Sep 19 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.1.hg
4b66dc7
- Initial fedora package