diff --git a/.gitignore b/.gitignore index 10fddec..65cc764 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/protobuf-e8904f5.tar.gz +/protobuf-c3995ae.tar.gz diff --git a/golang-googlecode-gogoprotobuf.spec b/golang-googlecode-gogoprotobuf.spec index ae01205..42d8084 100644 --- a/golang-googlecode-gogoprotobuf.spec +++ b/golang-googlecode-gogoprotobuf.spec @@ -19,20 +19,6 @@ %global debug_package %{nil} %endif -%define copying() \ -%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7 \ -%license %{*} \ -%else \ -%doc %{*} \ -%endif - -%global isgccgoarch 0 -%if 0%{?gccgo_arches:1} -%ifarch %{gccgo_arches} -%global isgccgoarch 1 -%endif -%endif - %global provider github %global provider_tld com %global project gogo @@ -40,7 +26,7 @@ # https://github.com/gogo/protobuf %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} %global import_path %{provider_prefix} -%global commit e8904f58e872a473a5b91bc9bf3377d223555263 +%global commit c3995ae437bb78d1189f4f147dfe5f87ad3596e4 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global nname golang-github-gogo-protobuf @@ -48,25 +34,17 @@ %global devel_main golang-github-gogo-protobuf-devel Name: golang-googlecode-gogoprotobuf -Version: 0.1 -Release: 0.4.git%{shortcommit}%{?dist} +Version: 0.2 +Release: 0.1.git%{shortcommit}%{?dist} Summary: A fork of goprotobuf with several extra features License: BSD URL: https://%{provider_prefix} Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz -# If go_arches not defined fall through to implicit golang archs -%if 0%{?go_arches:1} -ExclusiveArch: %{go_arches} -%else -ExclusiveArch: %{ix86} x86_64 %{arm} -%endif -# If gccgo_arches does not fit or is not defined fall through to golang -%if %{isgccgoarch} -BuildRequires: gcc-go >= %{gccgo_min_vers} -%else -BuildRequires: golang -%endif +# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required +ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{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} Requires: protobuf @@ -140,9 +118,11 @@ Provides: golang(%{import_path}/test/dashfilename) = %{version}-%{release} Provides: golang(%{import_path}/test/defaultconflict) = %{version}-%{release} Provides: golang(%{import_path}/test/embedconflict) = %{version}-%{release} Provides: golang(%{import_path}/test/empty-issue70) = %{version}-%{release} +Provides: golang(%{import_path}/test/enumcustomname) = %{version}-%{release} Provides: golang(%{import_path}/test/enumprefix) = %{version}-%{release} Provides: golang(%{import_path}/test/enumstringer) = %{version}-%{release} Provides: golang(%{import_path}/test/example) = %{version}-%{release} +Provides: golang(%{import_path}/test/filedotname) = %{version}-%{release} Provides: golang(%{import_path}/test/fuzztests) = %{version}-%{release} Provides: golang(%{import_path}/test/group) = %{version}-%{release} Provides: golang(%{import_path}/test/importdedup) = %{version}-%{release} @@ -179,6 +159,7 @@ Provides: golang(%{import_path}/test/oneof3/combos/unsafemarshaler) = %{ve Provides: golang(%{import_path}/test/oneof3/combos/unsafeunmarshaler) = %{version}-%{release} Provides: golang(%{import_path}/test/oneofembed) = %{version}-%{release} Provides: golang(%{import_path}/test/packed) = %{version}-%{release} +Provides: golang(%{import_path}/test/protosize) = %{version}-%{release} Provides: golang(%{import_path}/test/required) = %{version}-%{release} Provides: golang(%{import_path}/test/sizeunderscore) = %{version}-%{release} Provides: golang(%{import_path}/test/tags) = %{version}-%{release} @@ -265,9 +246,11 @@ Provides: golang(%{g_import_path}/test/dashfilename) = %{version}-%{releas Provides: golang(%{g_import_path}/test/defaultconflict) = %{version}-%{release} Provides: golang(%{g_import_path}/test/embedconflict) = %{version}-%{release} Provides: golang(%{g_import_path}/test/empty-issue70) = %{version}-%{release} +Provides: golang(%{g_import_path}/test/enumcustomname) = %{version}-%{release} Provides: golang(%{g_import_path}/test/enumprefix) = %{version}-%{release} Provides: golang(%{g_import_path}/test/enumstringer) = %{version}-%{release} Provides: golang(%{g_import_path}/test/example) = %{version}-%{release} +Provides: golang(%{g_import_path}/test/filedotname) = %{version}-%{release} Provides: golang(%{g_import_path}/test/fuzztests) = %{version}-%{release} Provides: golang(%{g_import_path}/test/group) = %{version}-%{release} Provides: golang(%{g_import_path}/test/importdedup) = %{version}-%{release} @@ -304,6 +287,7 @@ Provides: golang(%{g_import_path}/test/oneof3/combos/unsafemarshaler) = %{ Provides: golang(%{g_import_path}/test/oneof3/combos/unsafeunmarshaler) = %{version}-%{release} Provides: golang(%{g_import_path}/test/oneofembed) = %{version}-%{release} Provides: golang(%{g_import_path}/test/packed) = %{version}-%{release} +Provides: golang(%{g_import_path}/test/protosize) = %{version}-%{release} Provides: golang(%{g_import_path}/test/required) = %{version}-%{release} Provides: golang(%{g_import_path}/test/sizeunderscore) = %{version}-%{release} Provides: golang(%{g_import_path}/test/tags) = %{version}-%{release} @@ -342,18 +326,8 @@ building other packages which use %{project}/%{repo}. %if 0%{?with_unit_test} %package unit-test Summary: Unit tests for %{name} package -# If go_arches not defined fall through to implicit golang archs -%if 0%{?go_arches:1} -ExclusiveArch: %{go_arches} -%else -ExclusiveArch: %{ix86} x86_64 %{arm} -%endif -# If gccgo_arches does not fit or is not defined fall through to golang -%if %{isgccgoarch} -BuildRequires: gcc-go >= %{gccgo_min_vers} -%else -BuildRequires: golang -%endif +# 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} %if 0%{?with_check} #Here comes all BuildRequires: PACKAGE the unit tests @@ -374,43 +348,6 @@ providing packages with %{import_path} prefix. %setup -q -n %{repo}-%{commit} %build -# If gccgo_arches does not fit or is not defined fall through to golang -# gccco arches -%if %{isgccgoarch} -%if 0%{?gcc_go_build:1} -export GOCOMPILER='%{gcc_go_build}' -%else -echo "No compiler for SA" -exit 1 -%endif -# golang arches (due to ExclusiveArch) -%else -%if 0%{?golang_build:1} -export GOCOMPILER='%{golang_build} -ldflags "$LDFLAGS"' -%else -export GOCOMPILER='go build -ldflags "$LDFLAGS"' -%endif -%endif - -export LDFLAGS="" -%if 0%{?with_debug} -%if %{isgccgoarch} -export OLD_RPM_OPT_FLAGS="$RPM_OPT_FLAGS" -function gobuild { -export RPM_OPT_FLAGS="$OLD_RPM_OPT_FLAGS -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -eval ${GOCOMPILER} -a -v -x "$@"; -} -%else -export OLD_LDFLAGS="$LDFLAGS" -function gobuild { -export LDFLAGS="$OLD_LDFLAGS -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -eval ${GOCOMPILER} -a -v -x "$@"; -} -%endif -%else -function gobuild { eval ${GOCOMPILER} -a -v -x "$@"; } -%endif - mkdir -p src/github.com/gogo/ ln -s ../../../ src/github.com/gogo/protobuf @@ -421,7 +358,7 @@ echo "Unable to build from bundled deps. No Godeps nor vendor directory" exit 1 %endif -gobuild -o bin/protoc-gen-gogo %{import_path}/protoc-gen-gogo +%gobuild -o bin/protoc-gen-gogo %{import_path}/protoc-gen-gogo %install #### binary #### @@ -431,27 +368,22 @@ rm -rf proto/testdata protoc-gen-gogo/{protoc-gen-gogo,testdata} fieldpath/field # source codes for building projects %if 0%{?with_devel} -install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ +install -d -p %{buildroot}/%{gopath}/src/%{import_path} install -d -p %{buildroot}/%{gopath}/src/%{g_import_path} +echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list +echo "%%dir %%{gopath}/src/%%{g_import_path}/." >> g_devel.file-list # find all *.go but no *_test.go files and generate devel.file-list -for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do +for file in $(find . \( -iname "*.go" -o -iname "*.proto" -o -iname "*.golden" \) \! -iname "*_test.go") ; do + echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list + + echo "%%dir %%{gopath}/src/%%{g_import_path}/$(dirname $file)" >> g_devel.file-list install -d -p %{buildroot}/%{gopath}/src/%{g_import_path}/$(dirname $file) cp -pav $file %{buildroot}/%{gopath}/src/%{g_import_path}/$file echo "%%{gopath}/src/%%{g_import_path}/$file" >> g_devel.file-list done -for ext in proto golden; do - for file in $(find . -iname "*.${ext}") ; do - install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) - cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file - echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list - install -d -p %{buildroot}/%{gopath}/src/%{g_import_path}/$(dirname $file) - cp -pav $file %{buildroot}/%{gopath}/src/%{g_import_path}/$file - echo "%%{gopath}/src/%%{g_import_path}/$file" >> g_devel.file-list - done -done pushd %{buildroot}/%{gopath}/src/%{g_import_path}/ # github.com/gogo/protobuf -> code.google.com/p/gogoprotobuf @@ -465,111 +397,121 @@ popd install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ # find all *_test.go files and generate unit-test.file-list for file in $(find . -iname "*_test.go"); do + echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list done %endif +%if 0%{?with_devel} +sort -u -o devel.file-list devel.file-list +sort -u -o g_devel.file-list g_devel.file-list +%endif + %check %if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel} -%if %{isgccgoarch} -function gotest { %{gcc_go_test} "$@"; } -%else -%if 0%{?golang_test:1} -function gotest { %{golang_test} "$@"; } +%if ! 0%{?with_bundled} +export GOPATH=%{buildroot}/%{gopath}:%{gopath} %else -function gotest { go test "$@"; } +export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath} %endif + +%if ! 0%{?gotest:1} +%global gotest go test %endif -export GOPATH=%{buildroot}/%{gopath}:%{gopath} -gotest %{import_path}/codec -gotest %{import_path}/fieldpath -gotest %{import_path}/io -gotest %{import_path}/jsonpb -gotest %{import_path}/parser -#gotest %%{import_path}/proto -#gotest %%{import_path}/proto/testdata -gotest %{import_path}/protoc-gen-gogo/generator -gotest %{import_path}/test -gotest %{import_path}/test/casttype/combos/both -gotest %{import_path}/test/casttype/combos/marshaler -gotest %{import_path}/test/casttype/combos/neither -gotest %{import_path}/test/casttype/combos/unmarshaler -gotest %{import_path}/test/casttype/combos/unsafeboth -gotest %{import_path}/test/casttype/combos/unsafemarshaler -gotest %{import_path}/test/casttype/combos/unsafeunmarshaler -gotest %{import_path}/test/combos/both -gotest %{import_path}/test/combos/marshaler -gotest %{import_path}/test/combos/unmarshaler -gotest %{import_path}/test/combos/unsafeboth -gotest %{import_path}/test/combos/unsafemarshaler -gotest %{import_path}/test/combos/unsafeunmarshaler -gotest %{import_path}/test/custom -gotest %{import_path}/test/custombytesnonstruct -#go test %%{import_path}/test/dashfilename -gotest %{import_path}/test/defaultconflict -gotest %{import_path}/test/embedconflict -gotest %{import_path}/test/empty-issue70 -gotest %{import_path}/test/enumstringer -gotest %{import_path}/test/group -gotest %{import_path}/test/importdedup -gotest %{import_path}/test/indeximport-issue72 -gotest %{import_path}/test/indeximport-issue72/index -gotest %{import_path}/test/issue34 -gotest %{import_path}/test/issue42order -gotest %{import_path}/test/issue8 -gotest %{import_path}/test/mapsproto2/combos/both -gotest %{import_path}/test/mapsproto2/combos/marshaler -gotest %{import_path}/test/mapsproto2/combos/neither -gotest %{import_path}/test/mapsproto2/combos/unmarshaler -gotest %{import_path}/test/mapsproto2/combos/unsafeboth -gotest %{import_path}/test/mapsproto2/combos/unsafemarshaler -gotest %{import_path}/test/mapsproto2/combos/unsafeunmarshaler -gotest %{import_path}/test/moredefaults -gotest %{import_path}/test/packed -gotest %{import_path}/test/required -gotest %{import_path}/test/sizeunderscore -gotest %{import_path}/test/tags -gotest %{import_path}/test/theproto3/combos/both -gotest %{import_path}/test/theproto3/combos/marshaler -gotest %{import_path}/test/theproto3/combos/neither -gotest %{import_path}/test/theproto3/combos/unmarshaler -gotest %{import_path}/test/theproto3/combos/unsafeboth -gotest %{import_path}/test/theproto3/combos/unsafemarshaler -gotest %{import_path}/test/theproto3/combos/unsafeunmarshaler -gotest %{import_path}/test/unmarshalmerge -gotest %{import_path}/test/unrecognized -gotest %{import_path}/test/unrecognizedgroup -gotest %{import_path}/vanity/test +%gotest %{import_path}/codec +%gotest %{import_path}/fieldpath +%gotest %{import_path}/io +%gotest %{import_path}/jsonpb +%gotest %{import_path}/parser +#%gotest %%{import_path}/proto +#%gotest %%{import_path}/proto/testdata +%gotest %{import_path}/protoc-gen-gogo/generator +%gotest %{import_path}/test +%gotest %{import_path}/test/casttype/combos/both +%gotest %{import_path}/test/casttype/combos/marshaler +%gotest %{import_path}/test/casttype/combos/neither +%gotest %{import_path}/test/casttype/combos/unmarshaler +%gotest %{import_path}/test/casttype/combos/unsafeboth +%gotest %{import_path}/test/casttype/combos/unsafemarshaler +%gotest %{import_path}/test/casttype/combos/unsafeunmarshaler +%gotest %{import_path}/test/combos/both +%gotest %{import_path}/test/combos/marshaler +%gotest %{import_path}/test/combos/unmarshaler +%gotest %{import_path}/test/combos/unsafeboth +%gotest %{import_path}/test/combos/unsafemarshaler +%gotest %{import_path}/test/combos/unsafeunmarshaler +%gotest %{import_path}/test/custom +%gotest %{import_path}/test/custombytesnonstruct +#%gotest %%{import_path}/test/dashfilename +%gotest %{import_path}/test/defaultconflict +%gotest %{import_path}/test/embedconflict +%gotest %{import_path}/test/empty-issue70 +%gotest %{import_path}/test/enumstringer +%gotest %{import_path}/test/group +%gotest %{import_path}/test/importdedup +%gotest %{import_path}/test/indeximport-issue72 +%gotest %{import_path}/test/indeximport-issue72/index +%gotest %{import_path}/test/issue34 +%gotest %{import_path}/test/issue42order +%gotest %{import_path}/test/issue8 +%gotest %{import_path}/test/mapsproto2/combos/both +%gotest %{import_path}/test/mapsproto2/combos/marshaler +%gotest %{import_path}/test/mapsproto2/combos/neither +%gotest %{import_path}/test/mapsproto2/combos/unmarshaler +%gotest %{import_path}/test/mapsproto2/combos/unsafeboth +%gotest %{import_path}/test/mapsproto2/combos/unsafemarshaler +%gotest %{import_path}/test/mapsproto2/combos/unsafeunmarshaler +%gotest %{import_path}/test/moredefaults +%gotest %{import_path}/test/packed +%gotest %{import_path}/test/required +%gotest %{import_path}/test/sizeunderscore +%gotest %{import_path}/test/tags +%gotest %{import_path}/test/theproto3/combos/both +%gotest %{import_path}/test/theproto3/combos/marshaler +%gotest %{import_path}/test/theproto3/combos/neither +%gotest %{import_path}/test/theproto3/combos/unmarshaler +%gotest %{import_path}/test/theproto3/combos/unsafeboth +%gotest %{import_path}/test/theproto3/combos/unsafemarshaler +%gotest %{import_path}/test/theproto3/combos/unsafeunmarshaler +%gotest %{import_path}/test/unmarshalmerge +%gotest %{import_path}/test/unrecognized +%gotest %{import_path}/test/unrecognizedgroup +%gotest %{import_path}/vanity/test %endif +#define license tag if not already defined +%{!?_licensedir:%global license %doc} + %files -%copying LICENSE +%license LICENSE %doc CONTRIBUTORS README %{_bindir}/protoc-gen-gogo %if 0%{?with_devel} %files -n %{nname}-devel -f devel.file-list -%copying LICENSE +%license LICENSE %doc CONTRIBUTORS README %dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} -%dir %{gopath}/src/%{import_path} %files devel -f g_devel.file-list -%copying LICENSE +%license LICENSE %doc CONTRIBUTORS README -%dir %{gopath}/src/%{g_import_path} %endif %if 0%{?with_unit_test} %files unit-test -f unit-test.file-list -%copying LICENSE +%license LICENSE %doc CONTRIBUTORS README %endif %changelog +* Sun May 15 2016 jchaloup - 0.2-0.1.gitc3995ae +- Bump to upstream c3995ae437bb78d1189f4f147dfe5f87ad3596e4 + related: #1246215 + * Mon Feb 22 2016 Fedora Release Engineering - 0.1-0.4.gite8904f5 - https://fedoraproject.org/wiki/Changes/golang1.6 diff --git a/sources b/sources index fb23cff..6dbbba8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -34642fa8d5e62afd4b5486393b6e85ef protobuf-e8904f5.tar.gz +66c275c87dce7f17ea273b970dee327d protobuf-c3995ae.tar.gz