]> git.pld-linux.org Git - packages/protobuf.git/blobdiff - protobuf.spec
- added x32 patch (disable test specific to LP64 archs)
[packages/protobuf.git] / protobuf.spec
index 1b5ae0124d5cfe8237b3be649c1bdfd893bf1562..3d209b54dde7e45b93554a13bb35626ead07ae2e 100644 (file)
@@ -1,40 +1,57 @@
 # TODO:
 # - add bindings for java (maven build)
-# - add bindings for ruby
 # - add bindings for javascript
 # - add bindings for csharp
 #
 # Conditional build:
-%bcond_without python  # Python bindings
+%bcond_without python2 # Python 2.x bindings
+%bcond_without python3 # Python 3.x bindings
+%bcond_without ruby    # Ruby bindings
 %bcond_without tests   # perform "make check"
 
 Summary:       Protocol Buffers - Google's data interchange format
 Summary(pl.UTF-8):     Protocol Buffers - format wymiany danych Google
 Name:          protobuf
-Version:       3.1.0
-Release:       0.1
+Version:       3.13.0
+Release:       3
 License:       BSD
 Group:         Libraries
 #Source0Download: https://github.com/google/protobuf/releases
-Source0:       https://github.com/google/protobuf/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 14a532a7538551d5def317bfca41dace
+Source0:       https://github.com/google/protobuf/releases/download/v%{version}/%{name}-all-%{version}.tar.gz
+# Source0-md5: cafa623d51361228c83c874d95f51992
 Source1:       ftdetect-proto.vim
 Patch0:                system-gtest.patch
+Patch1:                no-wrap-memcpy.patch
+Patch2:                %{name}-no-wheel.patch
+Patch3:                %{name}-x32.patch
 URL:           https://github.com/google/protobuf/
 BuildRequires: autoconf >= 2.59
 BuildRequires: automake >= 1:1.9
-%{?with_tests:BuildRequires:   gmock-devel}
-%{?with_tests:BuildRequires:   gtest-devel}
-BuildRequires: libstdc++-devel
+%{?with_tests:BuildRequires:   gmock-devel >= 1.9.0}
+%{?with_tests:BuildRequires:   gtest-devel >= 1.9.0}
+BuildRequires: libstdc++-devel >= 6:4.7
 BuildRequires: libtool
 BuildRequires: pkgconfig
-BuildRequires: rpmbuild(macros) >= 1.219
-BuildRequires: zlib-devel >= 1.2.0.4
-%if %{with python}
-BuildRequires: python-google-apputils
+BuildRequires: sed >= 4.0
+%if %{with python2}
+BuildRequires: python-modules >= 1:2.7
 BuildRequires: python-setuptools
+%endif
+%if %{with python3}
+BuildRequires: python3-modules >= 1:3.3
+BuildRequires: python3-setuptools
+%endif
+%if %{with python2} || %{with python3}
 BuildRequires: rpm-pythonprov
 %endif
+BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with ruby}
+BuildRequires: ruby-devel
+BuildRequires: ruby-rake
+BuildRequires: ruby-rake-compiler
+%endif
+BuildRequires: sed >= 4.0
+BuildRequires: zlib-devel >= 1.2.0.4
 Requires:      %{name}-libs = %{version}-%{release}
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -117,7 +134,7 @@ Group:              Development/Libraries
 Requires:      %{name} = %{version}-%{release}
 Requires:      %{name}-libs = %{version}-%{release}
 Requires:      %{name}-lite = %{version}-%{release}
-Requires:      libstdc++-devel
+Requires:      libstdc++-devel >= 6:4.7
 
 %description devel
 Header files for Protocol Buffers libraries.
@@ -138,18 +155,42 @@ Static Protocol Buffers libraries.
 Statyczne biblioteki buforów protokołowych (Protocol Buffers).
 
 %package -n python-protobuf
-Summary:       Python bindings for Protocol Buffers
-Summary(pl.UTF-8):     Wiązania Pythona do buforów protokołowych (Protocol Buffers)
+Summary:       Python bindings for Protocol Buffers
+Summary(pl.UTF-8):     Wiązania Pythona do buforów protokołowych (Protocol Buffers)
 Group:         Development/Languages/Python
+Requires:      python-modules >= 1:2.7
 # does not use C++ library at this time
-Conflicts:     %{name} < %{version}
-Conflicts:     %{name} > %{version}
 
 %description -n python-protobuf
-Python bindings for Protocol Buffers.
+Python bindings for Protocol Buffers.
 
 %description -n python-protobuf -l pl.UTF-8
-Wiązania Pythona do buforów protokołowych (Protocol Buffers).
+Wiązania Pythona 2 do buforów protokołowych (Protocol Buffers).
+
+%package -n python3-protobuf
+Summary:       Python 3 bindings for Protocol Buffers
+Summary(pl.UTF-8):     Wiązania Pythona 3 do buforów protokołowych (Protocol Buffers)
+Group:         Development/Languages/Python
+Requires:      python3-modules >= 1:3.3
+# does not use C++ library at this time
+
+%description -n python3-protobuf
+Python 3 bindings for Protocol Buffers.
+
+%description -n python3-protobuf -l pl.UTF-8
+Wiązania Pythona 3 do buforów protokołowych (Protocol Buffers).
+
+%package -n ruby-google-protobuf
+Summary:       Ruby bindings for Google Protocol Buffers
+Summary(pl.UTF-8):     Wiązania języka Ruby do biblioteki Google Protocol Buffers
+Group:         Development/Languages
+Requires:      ruby
+
+%description -n ruby-google-protobuf
+Ruby bindings for Google Protocol Buffers.
+
+%description -n ruby-google-protobuf -l pl.UTF-8
+Wiązania języka Ruby do biblioteki Google Protocol Buffers.
 
 %package -n vim-syntax-protobuf
 Summary:       Vim syntax highlighting for Protocol Buffers descriptions
@@ -168,8 +209,22 @@ opisów buforów protokołowych (Protocol Buffers).
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+
+%{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python}\1,' \
+      examples/add_person.py \
+      examples/list_people.py
 
-ln -s /usr/src/gmock/src/gmock*.cc src
+# gcc 10.2 false positive warning (with tag values >= 128):
+#
+#  if (tag < 128) {
+#    return *ptr == tag;
+#           ~~~~~^~~~~~ error: comparison is always false due to limited range of data type [-Werror=type-limits]
+#  } else {
+#
+%{__sed} -i -e 's/-Werror //' src/Makefile.am
 
 %build
 %{__libtoolize}
@@ -180,12 +235,24 @@ ln -s /usr/src/gmock/src/gmock*.cc src
 # Additional variables defined according to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192821
 %configure \
        CFLAGS='%{rpmcflags} -DGOOGLE_PROTOBUF_NO_RTTI' \
-       CPPFLAGS='%{rpmcppflags} -DGOOGLE_PROTOBUF_NO_RTTI'
+       CPPFLAGS='%{rpmcppflags} -DGOOGLE_PROTOBUF_NO_RTTI' \
+       --disable-silent-rules \
+       --disable-external-gtest
 %{__make}
 
-%if %{with python}
 cd python
+%if %{with python2}
 %py_build
+%endif
+%if %{with python3}
+%py3_build
+%endif
+cd ..
+
+%if %{with ruby}
+cd ruby
+rake
+#rake clobber_package gem
 cd ..
 %endif
 
@@ -207,14 +274,23 @@ install -d $RPM_BUILD_ROOT%{_vimdatadir}/{syntax,ftdetect}
 cp -p editors/proto.vim $RPM_BUILD_ROOT%{_vimdatadir}/syntax/proto.vim
 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_vimdatadir}/ftdetect/proto.vim
 
-%if %{with python}
 cd python
+%if %{with python2}
 %py_install
 %py_postclean
-cd ..
 %endif
+%if %{with python3}
+%py3_install
+%endif
+cd ..
 
-cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+%if %{with ruby}
+install -d $RPM_BUILD_ROOT{%{ruby_vendorarchdir}/google,%{ruby_vendorlibdir}/google,%{ruby_specdir}}
+install ruby/lib/google/protobuf_c.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}/google
+cp -pr ruby/lib/google/{protobuf,protobuf.rb} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/google
+cp -p ruby/google-protobuf.gemspec $RPM_BUILD_ROOT%{ruby_specdir}/google-protobuf-%{version}.gemspec
+%endif
+cp -pr examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -233,17 +309,17 @@ rm -rf $RPM_BUILD_ROOT
 %doc CHANGES.txt CONTRIBUTORS.txt LICENSE README.md
 %attr(755,root,root) %{_bindir}/protoc
 %attr(755,root,root) %{_libdir}/libprotoc.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libprotoc.so.11
+%attr(755,root,root) %ghost %{_libdir}/libprotoc.so.24
 
 %files libs
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libprotobuf.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.11
+%attr(755,root,root) %ghost %{_libdir}/libprotobuf.so.24
 
 %files lite
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libprotobuf-lite.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libprotobuf-lite.so.11
+%attr(755,root,root) %ghost %{_libdir}/libprotobuf-lite.so.24
 
 %files devel
 %defattr(644,root,root,755)
@@ -266,7 +342,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/libprotobuf.a
 %{_libdir}/libprotoc.a
 
-%if %{with python}
+%if %{with python2}
 %files -n python-protobuf
 %defattr(644,root,root,755)
 %doc python/README.md
@@ -276,6 +352,28 @@ rm -rf $RPM_BUILD_ROOT
 %{py_sitescriptdir}/protobuf-%{version}-py*-nspkg.pth
 %endif
 
+%if %{with python3}
+%files -n python3-protobuf
+%defattr(644,root,root,755)
+%doc python/README.md
+%dir %{py3_sitescriptdir}/google
+%{py3_sitescriptdir}/google/protobuf
+%{py3_sitescriptdir}/protobuf-%{version}-py*.egg-info
+%{py3_sitescriptdir}/protobuf-%{version}-py*-nspkg.pth
+%endif
+
+%if %{with ruby}
+%files -n ruby-google-protobuf
+%defattr(644,root,root,755)
+%doc ruby/README.md
+%dir %{ruby_vendorarchdir}/google
+%attr(755,root,root) %{ruby_vendorarchdir}/google/protobuf_c.so
+%dir %{ruby_vendorlibdir}/google
+%{ruby_vendorlibdir}/google/protobuf.rb
+%{ruby_vendorlibdir}/google/protobuf
+%{ruby_specdir}/google-protobuf-%{version}.gemspec
+%endif
+
 %files -n vim-syntax-protobuf
 %defattr(644,root,root,755)
 %{_datadir}/vim/ftdetect/proto.vim
This page took 0.153237 seconds and 4 git commands to generate.