%global debug_package %{nil}
%global import_path code.google.com/p/goprotobuf
%global gopath %{_datadir}/gocode
%global rev 61664b8425f3e0e4371d4b56016b224b9d69cbbb
%global shortrev %(r=%{rev}; echo ${r:0:12})
Name: golang-googlecode-goprotobuf
Version: 0
Release: 0.7.hg%{shortrev}%{?dist}
Summary: Go support for Google protocol buffers
License: BSD
URL: http://%{import_path}
Source0: https://goprotobuf.googlecode.com/archive/%{rev}.zip
ExclusiveArch: %{ix86} x86_64 %{arm}
BuildRequires: golang
Requires: protobuf
Provides: protoc-gen-go = %{version}-%{release}
%description
This package provides support for protocol buffers in the form of a protocol
compiler plugin which generates Go source files that, once compiled, can access
and manage protocol buffers.
Install %{name}-devel for the associated support library.
%package devel
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
BuildArch: noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm}
%endif
Requires: golang
Summary: Go support for Google protocol buffers
Provides: golang(%{import_path}) = %{version}-%{release}
Provides: golang(%{import_path}/proto) = %{version}-%{release}
Provides: golang(%{import_path}/protoc-gen-go) = %{version}-%{release}
Provides: golang(%{import_path}/protoc-gen-go/generator) = %{version}-%{release}
Provides: golang(%{import_path}/protoc-gen-go/plugin) = %{version}-%{release}
%description devel
This package provides a library that implements run-time support for
encoding (marshaling), decoding (unmarshaling), and accessing protocol
buffers in the Go language.
Install %{name} for the related protocol compiler plugin.
%prep
%setup -n goprotobuf-%{shortrev}
mkdir -p src/%{import_path}
cp -R proto protoc-gen-go src/%{import_path}/
%build
unset GOPATH
export GOPATH=$(pwd)
cd protoc-gen-go
go build
%install
install -d %{buildroot}%{_bindir}
install -m 755 protoc-gen-go/protoc-gen-go %{buildroot}/%{_bindir}/protoc-gen-go
install -d %{buildroot}/%{gopath}/src/%{import_path}
rm -rf proto/testdata protoc-gen-go/{protoc-gen-go,testdata}
for d in proto protoc-gen-go; do
cp -av $d %{buildroot}/%{gopath}/src/%{import_path}/
done
%files
%doc AUTHORS CONTRIBUTORS LICENSE README
%{_bindir}/protoc-gen-go
%files devel
%doc AUTHORS CONTRIBUTORS LICENSE README
%dir %attr(755,root,root) %{gopath}
%dir %attr(755,root,root) %{gopath}/src
%dir %attr(755,root,root) %{gopath}/src/code.google.com
%dir %attr(755,root,root) %{gopath}/src/code.google.com/p
%dir %attr(755,root,root) %{gopath}/src/%{import_path}
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/proto
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/protoc-gen-go
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/protoc-gen-go/descriptor
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/protoc-gen-go/generator
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/protoc-gen-go/plugin
%{gopath}/src/%{import_path}/proto/Makefile
%{gopath}/src/%{import_path}/proto/*.go
%{gopath}/src/%{import_path}/protoc-gen-go/Makefile
%{gopath}/src/%{import_path}/protoc-gen-go/*.go
%{gopath}/src/%{import_path}/protoc-gen-go/descriptor/Makefile
%{gopath}/src/%{import_path}/protoc-gen-go/descriptor/*.pb.go*
%{gopath}/src/%{import_path}/protoc-gen-go/generator/Makefile
%{gopath}/src/%{import_path}/protoc-gen-go/generator/*.go
%{gopath}/src/%{import_path}/protoc-gen-go/plugin/Makefile
%{gopath}/src/%{import_path}/protoc-gen-go/plugin/*.go*
%changelog
* Thu Oct 17 2013 Lokesh Mandvekar <lsm5@redhat.com> - 0-0.7.hg61664b8425f3
- removed double quotes from provides
* Wed Oct 16 2013 Peter Lemenkov <lemenkov@gmail.com> - 0-0.6.hg61664b8425f3
- Added missing buildrequires
* Mon Oct 14 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.5.hg61664b8425f3
- description update
* Mon Oct 14 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.4.hg61664b8425f3
- defattr removed
- docs included in base and devel packages
* Sat Oct 12 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.3.hg61664b8425f3
- testdata directories excluded
* Sat Oct 12 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.2.hg61664b8425f3
- compiler plugin in archful base package
- libraries in noarch (except rhel6) devel subpackage
* Fri Oct 11 2013 Lokesh Mandvekar <lsm5@redhat.com> 0-0.1.hg61664b8425f3
- Initial fedora package