# If any of the following macros should be set otherwise, # you can wrap any of them with the following conditions: # - %%if 0%%{centos} == 7 # - %%if 0%%{?rhel} == 7 # - %%if 0%%{?fedora} == 23 # Or just test for particular distribution: # - %%if 0%%{centos} # - %%if 0%%{?rhel} # - %%if 0%%{?fedora} # # Be aware, on centos, both %%rhel and %%centos are set. If you want to test # rhel specific macros, you can use %%if 0%%{?rhel} && 0%%{?centos} == 0 condition. # (Don't forget to replace double percentage symbol with single one in order to apply a condition) # Generate devel rpm %global with_devel 1 # Build project from bundled dependencies %global with_bundled 0 # Build with debug info rpm %global with_debug 0 # Run tests in check section %global with_check 0 # Generate unit-test rpm %global with_unit_test 1 %if 0%{?with_debug} %global _dwz_low_mem_die_limit 0 %else %global debug_package %{nil} %endif %global provider_tld com %global provider github %global project golang %global repo text # https://github.com/golang/text %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} %global import_path code.google.com/p/go.text %global commit 65f4f820a7954b82e5c9325e1e088a4fda098f36 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global x_provider golang %global x_provider_tld org %global x_repo text %global x_import_path %{x_provider}.%{x_provider_tld}/x/%{x_repo} %global x_name golang-%{x_provider}%{x_provider_tld}-%{repo} %global devel_main %{x_name}-devel %global devel_prefix x Name: golang-googlecode-text Version: 0 Release: 0.20.git%{shortcommit}%{?dist} Summary: Supplementary Go text libraries License: BSD URL: https://%{provider_prefix} Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}} # If go_compiler is not set to 1, there is no virtual provide. Use golang instead. BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} %description %{summary} %if 0%{?with_devel} %package devel Summary: Supplementary Go text libraries for code.google.com/p/ imports BuildArch: noarch %if 0%{?with_check} %endif Provides: golang(%{import_path}) = %{version}-%{release} Provides: golang(%{import_path}/cases) = %{version}-%{release} Provides: golang(%{import_path}/collate) = %{version}-%{release} Provides: golang(%{import_path}/collate/build) = %{version}-%{release} Provides: golang(%{import_path}/currency) = %{version}-%{release} Provides: golang(%{import_path}/encoding) = %{version}-%{release} Provides: golang(%{import_path}/encoding/charmap) = %{version}-%{release} Provides: golang(%{import_path}/encoding/htmlindex) = %{version}-%{release} Provides: golang(%{import_path}/encoding/ianaindex) = %{version}-%{release} Provides: golang(%{import_path}/encoding/japanese) = %{version}-%{release} Provides: golang(%{import_path}/encoding/korean) = %{version}-%{release} Provides: golang(%{import_path}/encoding/simplifiedchinese) = %{version}-%{release} Provides: golang(%{import_path}/encoding/traditionalchinese) = %{version}-%{release} Provides: golang(%{import_path}/encoding/unicode) = %{version}-%{release} Provides: golang(%{import_path}/encoding/unicode/utf32) = %{version}-%{release} Provides: golang(%{import_path}/language) = %{version}-%{release} Provides: golang(%{import_path}/language/display) = %{version}-%{release} Provides: golang(%{import_path}/message) = %{version}-%{release} Provides: golang(%{import_path}/runes) = %{version}-%{release} Provides: golang(%{import_path}/search) = %{version}-%{release} Provides: golang(%{import_path}/secure) = %{version}-%{release} Provides: golang(%{import_path}/secure/bidirule) = %{version}-%{release} Provides: golang(%{import_path}/secure/precis) = %{version}-%{release} Provides: golang(%{import_path}/transform) = %{version}-%{release} Provides: golang(%{import_path}/unicode) = %{version}-%{release} Provides: golang(%{import_path}/unicode/bidi) = %{version}-%{release} Provides: golang(%{import_path}/unicode/cldr) = %{version}-%{release} Provides: golang(%{import_path}/unicode/norm) = %{version}-%{release} Provides: golang(%{import_path}/unicode/rangetable) = %{version}-%{release} Provides: golang(%{import_path}/unicode/runenames) = %{version}-%{release} Provides: golang(%{import_path}/width) = %{version}-%{release} %package -n %{x_name}-devel Summary: Supplementary Go text libraries for golang.org/x/ imports BuildArch: noarch %if 0%{?with_check} %endif Provides: golang(%{x_import_path}) = %{version}-%{release} Provides: golang(%{x_import_path}/cases) = %{version}-%{release} Provides: golang(%{x_import_path}/collate) = %{version}-%{release} Provides: golang(%{x_import_path}/collate/build) = %{version}-%{release} Provides: golang(%{x_import_path}/currency) = %{version}-%{release} Provides: golang(%{x_import_path}/encoding) = %{version}-%{release} Provides: golang(%{x_import_path}/encoding/charmap) = %{version}-%{release} Provides: golang(%{x_import_path}/encoding/htmlindex) = %{version}-%{release} Provides: golang(%{x_import_path}/encoding/ianaindex) = %{version}-%{release} Provides: golang(%{x_import_path}/encoding/japanese) = %{version}-%{release} Provides: golang(%{x_import_path}/encoding/korean) = %{version}-%{release} Provides: golang(%{x_import_path}/encoding/simplifiedchinese) = %{version}-%{release} Provides: golang(%{x_import_path}/encoding/traditionalchinese) = %{version}-%{release} Provides: golang(%{x_import_path}/encoding/unicode) = %{version}-%{release} Provides: golang(%{x_import_path}/encoding/unicode/utf32) = %{version}-%{release} Provides: golang(%{x_import_path}/language) = %{version}-%{release} Provides: golang(%{x_import_path}/language/display) = %{version}-%{release} Provides: golang(%{x_import_path}/message) = %{version}-%{release} Provides: golang(%{x_import_path}/runes) = %{version}-%{release} Provides: golang(%{x_import_path}/search) = %{version}-%{release} Provides: golang(%{x_import_path}/secure) = %{version}-%{release} Provides: golang(%{x_import_path}/secure/bidirule) = %{version}-%{release} Provides: golang(%{x_import_path}/secure/precis) = %{version}-%{release} Provides: golang(%{x_import_path}/transform) = %{version}-%{release} Provides: golang(%{x_import_path}/unicode) = %{version}-%{release} Provides: golang(%{x_import_path}/unicode/bidi) = %{version}-%{release} Provides: golang(%{x_import_path}/unicode/cldr) = %{version}-%{release} Provides: golang(%{x_import_path}/unicode/norm) = %{version}-%{release} Provides: golang(%{x_import_path}/unicode/rangetable) = %{version}-%{release} Provides: golang(%{x_import_path}/unicode/runenames) = %{version}-%{release} Provides: golang(%{x_import_path}/width) = %{version}-%{release} %description devel %{summary} This package contains library source intended for building other packages which use the supplementary Go text libraries with code.google.com/p/ imports. %description -n %{x_name}-devel This package contains library source intended for building other packages which use the supplementary Go text libraries with golang.org/x/ imports. %endif %if 0%{?with_unit_test} %package unit-test-devel Summary: Unit tests for %{name} package %if 0%{?with_check} #Here comes all BuildRequires: PACKAGE the unit tests #in %%check section need for running %endif # test subpackage tests code from devel subpackage Requires: %{x_name}-devel = %{version}-%{release} %description unit-test-devel %{summary} This package contains unit tests for project providing packages with %{x_import_path} prefix. %endif %prep %setup -q -n %{repo}-%{commit} %build %install # source codes for building projects %if 0%{?with_devel} install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ install -d -p %{buildroot}%{gopath}/src/%{x_import_path} # find all *.go but no *_test.go files and generate devel.file-list for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do dirprefix=$(dirname $file) install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$dirprefix cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list install -d -p %{buildroot}/%{gopath}/src/%{x_import_path}/$dirprefix cp -pav $file %{buildroot}/%{gopath}/src/%{x_import_path}/$file echo "%%{gopath}/src/%%{x_import_path}/$file" >> x_devel.file-list while [ "$dirprefix" != "." ]; do echo "%%dir %%{gopath}/src/%%{import_path}/$dirprefix" >> devel.file-list echo "%%dir %%{gopath}/src/%%{x_import_path}/$dirprefix" >> x_devel.file-list dirprefix=$(dirname $dirprefix) done done pushd %{buildroot}/%{gopath}/src/%{import_path} # from https://groups.google.com/forum/#!topic/golang-nuts/eD8dh3T9yyA, first post sed -i 's/"golang\.org\/x\//"code\.google\.com\/p\/go\./g' \ $(find . -name '*.go') popd %endif # testing files for this project %if 0%{?with_unit_test} install -d -p %{buildroot}/%{gopath}/src/%{x_import_path}/ # find all *_test.go files and generate unit-test.file-list for file in $(find . -iname "*_test.go"); do dirprefix=$(dirname $file) install -d -p %{buildroot}/%{gopath}/src/%{x_import_path}/$dirprefix cp -pav $file %{buildroot}/%{gopath}/src/%{x_import_path}/$file echo "%%{gopath}/src/%%{x_import_path}/$file" >> unit-test-devel.file-list while [ "$dirprefix" != "." ]; do echo "%%dir %%{gopath}/src/%%{x_import_path}/$dirprefix" >> x_devel.file-list dirprefix=$(dirname $dirprefix) done done for file in $(find ./encoding/testdata -iname "*.txt"); do install -d -p %{buildroot}/%{gopath}/src/%{x_import_path}/$(dirname $file) cp -pav $file %{buildroot}/%{gopath}/src/%{x_import_path}/$file echo "%%{gopath}/src/%%{x_import_path}/$file" >> unit-test-devel.file-list done %endif %if 0%{?with_devel} sort -u -o devel.file-list devel.file-list sort -u -o x_devel.file-list x_devel.file-list %endif %check %if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel} %if ! 0%{?with_bundled} export GOPATH=%{buildroot}/%{gopath}:%{gopath} %else export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath} %endif %if ! 0%{?gotest:1} %global gotest go test %endif #%%gotest %%{x_import_path}/cases %gotest %{x_import_path}/collate %gotest %{x_import_path}/collate/build %ifnarch s390x aarch64 %gotest %{x_import_path}/currency %endif %gotest %{x_import_path}/encoding %gotest %{x_import_path}/encoding/charmap %gotest %{x_import_path}/encoding/htmlindex %gotest %{x_import_path}/encoding/ianaindex %gotest %{x_import_path}/encoding/japanese %gotest %{x_import_path}/encoding/korean %gotest %{x_import_path}/encoding/simplifiedchinese %gotest %{x_import_path}/encoding/traditionalchinese %gotest %{x_import_path}/encoding/unicode %gotest %{x_import_path}/internal %gotest %{x_import_path}/internal/colltab %gotest %{x_import_path}/internal/tag %gotest %{x_import_path}/internal/triegen %gotest %{x_import_path}/internal/ucd %gotest %{x_import_path}/language %gotest %{x_import_path}/language/display %gotest %{x_import_path}/message %gotest %{x_import_path}/runes %gotest %{x_import_path}/search #%%gotest %%{import_path}/secure/precis %gotest %{x_import_path}/transform %gotest %{x_import_path}/unicode/bidi %gotest %{x_import_path}/unicode/cldr #%gotest %{x_import_path}/unicode/norm %gotest %{x_import_path}/unicode/rangetable %gotest %{x_import_path}/width %endif #define license tag if not already defined %{!?_licensedir:%global license %doc} %if 0%{?with_devel} %files devel -f devel.file-list %license LICENSE %doc AUTHORS CONTRIBUTORS PATENTS README %files -n %{x_name}-devel -f x_devel.file-list %license LICENSE %doc AUTHORS CONTRIBUTORS PATENTS README %endif %if 0%{?with_unit_test} %files unit-test-devel -f unit-test-devel.file-list %license LICENSE %doc CONTRIBUTORS %endif %changelog * Fri Aug 11 2017 Athos Ribeiro - 0-0.20.git65f4f82 - Bump to upstream 65f4f820a7954b82e5c9325e1e088a4fda098f36 - related: #1254601 * Wed Aug 02 2017 Fedora Release Engineering - 0-0.19.git04b8648 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Wed Jul 26 2017 Fedora Release Engineering - 0-0.18.git04b8648 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Fri Feb 10 2017 Fedora Release Engineering - 0-0.17.git04b8648 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Fri Jan 13 2017 Jan Chaloupka - 0-0.16.git04b8648 - Bump to upstream 04b8648d973c126ae60143b3e1473bc1576c7597 related: #1254601 * Wed Dec 14 2016 Jan Chaloupka - 0-0.15.git6fc2e00 - Polish the spec file related: #1254601 * Wed Aug 10 2016 jchaloup - 0-0.14.git6fc2e00 - skip currency test on aarch64 (binaries have different size) resolves: #1365814 * Wed Jul 27 2016 jchaloup - 0-0.13.git6fc2e00 - skip currency test on s390x (binaries have different size) resolves: #1360388 * Mon Jul 25 2016 jchaloup - 0-0.12.git6fc2e00 - Polishing the spec file related: #1254601 * Thu Jul 21 2016 Fedora Release Engineering - 0-0.11.git6fc2e00 - https://fedoraproject.org/wiki/Changes/golang1.7 * Tue Feb 23 2016 Peter Robinson 0-0.10.git6fc2e00 - License and arch definition cleanup * Mon Feb 22 2016 Fedora Release Engineering - 0-0.9.git6fc2e00 - https://fedoraproject.org/wiki/Changes/golang1.6 * Fri Feb 19 2016 jchaloup - 0-0.8.git6fc2e00 - Bump to upstream 6fc2e00a0d64b1f7fc1212dae5b0c939cf6d9ac4 Repository has moved from code.google.com/p/go.text to github.com/golang/text related: #1254601 * Wed Feb 03 2016 Fedora Release Engineering - 0-0.7.hg5b2527008a4c - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Thu Aug 20 2015 jchaloup - 0-0.6.hg5b2527008a4c - Choose the correct devel subpackage related: #1254601 * Thu Aug 20 2015 jchaloup - 0-0.5.hg5b2527008a4c - Update spec file to spec-2.0 resolves: #1254601 * Wed Jun 17 2015 Fedora Release Engineering - 0-0.4.hg5b2527008a4c - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Tue Dec 09 2014 jchaloup - 0-0.3.hg5b2527008a4c - Update to the latest commit 5b2527008a4c8988ca9dc6f010ebfb9dae67150b related: #1056285 * Fri Nov 21 2014 jchaloup - 0-0.2.hg024681b033be - Extend import paths for golang.org/x/ - Choose the correct architecture related: #1056285 * Sun Sep 28 2014 Lokesh Mandvekar - 0-0.1.hg024681b033be - Resolves: rhbz#1056285 - Initial package