# # spec file for package protobuf # # Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # %define soname 9 %bcond_without check Name: protobuf Version: 2.6.1 Release: 2.1 Summary: Protocol Buffers - Google's data interchange format License: BSD-3-Clause Group: Development/Libraries/C and C++ Url: https://github.com/google/protobuf/ Source0: https://github.com/google/protobuf/releases/download/v%{version}/%{name}-%{version}.tar.bz2 Source1: manifest.txt.in Source2: baselibs.conf Patch0: protobuf-setuptools-2.4.1.patch # fix no-return-in-nonvoid-function google/protobuf/extension_set.cc:74 Patch1: protobuf-return-no-nonvoid.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?fedora_version} > 8 || 0%{?mandriva_version} > 2008 || 0%{?suse_version} > 1030 %bcond_with protobuf_java %else %bcond_with protobuf_java %endif %if 0%{?suse_version} > 1210 && 0%{?suse_version} != 1315 %bcond_without protobuf_python %else %bcond_without protobuf_python %endif %if 0%{?suse_version} > 1010 BuildRequires: fdupes %endif %if %{with protobuf_java} BuildRequires: java-devel >= 1.6.0 %endif %if %{with protobuf_python} BuildRequires: python-dateutil BuildRequires: python-devel BuildRequires: python-google-apputils >= 0.4.2 BuildRequires: python-python-gflags BuildRequires: python-pytz BuildRequires: python-setuptools BuildRequires: zlib-devel %endif BuildRequires: gcc-c++ BuildRequires: pkg-config %description Protocol Buffers are a way of encoding structured data in an efficient yet extensible format. Google uses Protocol Buffers for almost all of its internal RPC protocols and file formats. %package -n libprotobuf%{soname} Summary: Protocol Buffers - Google's data interchange format Group: System/Libraries %description -n libprotobuf%{soname} Protocol Buffers are a way of encoding structured data in an efficient yet extensible format. Google uses Protocol Buffers for almost all of its internal RPC protocols and file formats. %package -n libprotoc%{soname} Summary: Protocol Buffers - Google's data interchange format Group: System/Libraries %description -n libprotoc%{soname} Protocol Buffers are a way of encoding structured data in an efficient yet extensible format. Google uses Protocol Buffers for almost all of its internal RPC protocols and file formats. %package -n libprotobuf-lite%{soname} Summary: Protocol Buffers - Google's data interchange format Group: System/Libraries %description -n libprotobuf-lite%{soname} Protocol Buffers are a way of encoding structured data in an efficient yet extensible format. Google uses Protocol Buffers for almost all of its internal RPC protocols and file formats. %package devel Summary: Header files, libraries and development documentation for %{name} Group: Development/Libraries/C and C++ Requires: gcc-c++ Requires: libprotobuf%{soname} = %{version} Requires: libprotobuf-lite%{soname} Requires: zlib-devel Provides: libprotobuf-devel = %{version} %description devel Protocol Buffers are a way of encoding structured data in an efficient yet extensible format. Google uses Protocol Buffers for almost all of its internal RPC protocols and file formats. %if %{with protobuf_java} %package -n %{name}-java Summary: Java Bindings for Google Protocol Buffers Group: Development/Libraries/Java Requires: java >= 1.6.0 %description -n %{name}-java This package contains the Java bindings for Google Protocol Buffers. %endif %if %{with protobuf_python} %package -n python-%{name} Summary: Python Bindings for Google Protocol Buffers Group: Development/Libraries/Python %if 0%{?suse_version} %py_requires %else Requires: python %endif %description -n python-%{name} This package contains the Python bindings for Google Protocol Buffers. %endif %prep %setup -q %patch0 %patch1 -p1 %build %if 0%{?mandriva_version} #XXX something wents wrong with detecting this export PTHREAD_LIBS=-lpthread %endif %configure \ --disable-static make %{?_smp_mflags} %if %{with protobuf_java} pushd java ../src/protoc --java_out=src/main/java -I../src ../src/google/protobuf/descriptor.proto mkdir classes %if 0%{?suse_version} == 1110 # 11.1 only workaround # http://en.opensuse.org/Java/Packaging/Cookbook#bytecode_version_error extra_java_flags="-target 1.5 -source 1.5" %endif javac $extra_java_flags -d classes src/main/java/com/google/protobuf/*.java sed -e 's/@VERSION@/%{version}/' < %{SOURCE1} > manifest.txt jar cfm %{name}-java-%{version}.jar manifest.txt -C classes com popd %endif %if %{with protobuf_python} pushd python python setup.py build popd %endif %if %{with check} %check make %{?_smp_mflags} check %endif %install make DESTDIR=%{buildroot} install %{?_smp_mflags} install -Dm 0644 editors/proto.vim %{buildroot}%{_datadir}/vim/site/syntax/proto.vim # no need for that find %{buildroot} -type f -name "*.la" -delete -print %if %{with protobuf_java} pushd java install -D -m 0644 %{name}-java-%{version}.jar %{buildroot}%{_javadir}/%{name}-java-%{version}.jar ln -s %{name}-java-%{version}.jar %{buildroot}%{_javadir}/%{name}-java.jar ln -s %{name}-java-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar popd %endif %if %{with protobuf_python} pushd python python setup.py install --skip-build \ --prefix=%{_prefix} \ --install-data=%{_datadir} \ --root %{buildroot} \ --record-rpm=INSTALLED_FILES popd %endif %if 0%{?suse_version} > 1010 %fdupes -s %{buildroot}%{py_sitedir} %endif %post -n libprotobuf%{soname} -p /sbin/ldconfig %postun -n libprotobuf%{soname} -p /sbin/ldconfig %post -n libprotoc%{soname} -p /sbin/ldconfig %postun -n libprotoc%{soname} -p /sbin/ldconfig %post -n libprotobuf-lite%{soname} -p /sbin/ldconfig %postun -n libprotobuf-lite%{soname} -p /sbin/ldconfig %files -n libprotobuf%{soname} %defattr(-, root, root) %{_libdir}/libprotobuf.so.%{soname}* %files -n libprotoc%{soname} %defattr(-, root, root) %{_libdir}/libprotoc.so.%{soname}* %files -n libprotobuf-lite%{soname} %defattr(-, root, root) %{_libdir}/libprotobuf-lite.so.%{soname}* %files devel %defattr(-,root,root) %doc CHANGES.txt CONTRIBUTORS.txt README.md %{_bindir}/protoc %{_includedir}/google %{_libdir}/*.so %{_libdir}/pkgconfig/* %{_datadir}/vim %if %{with protobuf_java} %files -n %{name}-java %defattr(-,root,root) %{_javadir}/protobuf* %endif %if %{with protobuf_python} %files -n python-%{name} -f python/INSTALLED_FILES %defattr(-,root,root) %endif %changelog * Wed Jul 29 2015 dimstar@opensuse.org - Fix baselibs.conf: last time the sonames were bumped, baselibs.conf has not been updated accordingly. * Sat Feb 28 2015 mpluskal@suse.com - Add protobuf-return-no-nonvoid.patch - Do not install examples - Remove 0001-Add-generic-GCC-support-for-atomic-operations.patch * Fri Feb 27 2015 mpluskal@suse.com - Use current url's - Update dependencies * python bindings now require recent python-google-apputils which are available only in recet (13.1 and higher releases of openSUSE) - Update to 2.6.1 * Added atomicops support for Solaris. * Released memory allocated by InitializeDefaultRepeatedFields() and GetEmptyString(). Some memory sanitizers reported them as memory leaks. * Updated DynamicMessage.setField() to handle repeated enum values correctly. * Fixed a bug that caused NullPointerException to be thrown when converting manually constructed FileDescriptorProto to FileDescriptor. - Changes for 2.6.0 * Added oneofs(unions) feature. Fields in the same oneof will share memory and at most one field can be set at the same time. * Files, services, enums, messages, methods and enum values can be marked as deprecated now. * Added Support for list values, including lists of mesaages, when parsing text-formatted protos in C++ and Java. * Enhanced customization on TestFormat printing. * Added SwapFields() in reflection API to swap a subset of fields. * Added SetAllocatedMessage() in reflection API. * Repeated primitive extensions are now packable. The [packed=true] option only affects serializers. Therefore, it is possible to switch a repeated extension field to packed format without breaking backwards-compatibility. * Various speed optimizations. * writeTo() method in ByteString can now write a substring to an output stream. Added endWith() method for ByteString. * ByteString and ByteBuffer are now supported in CodedInputStream and CodedOutputStream. * java_generate_equals_and_hash can now be used with the LITE_RUNTIME. * A new C++-backed extension module (aka "cpp api v2") that replaces the old ("cpp api v1") one. Much faster than the pure Python code. This one resolves many bugs and is recommended for general use over the pure Python when possible. * Tue Nov 5 2013 sleep_walker@suse.cz - fix java flags to build package for SLE_11_SP3 * Fri Jun 7 2013 dvaleev@suse.com - package google/protobuf/stubs/atomicops_internals_generic_gcc.h mosh reqires it * Mon May 27 2013 dvaleev@suse.com - Build on architectures where no specialized code has been written 0001-Add-generic-GCC-support-for-atomic-operations.patch * Fri Apr 12 2013 ftake@geeko.jp - Upstream update to 2.5.0 * New construct "import public" * New enum option "allow_alias" * C++: New generated method set_allocated_foo(Type* foo) * C++: Added SetAllocatedExtension() and ReleaseExtension() to extensions API * Java: Added getters/setters to access the underlying ByteString of a string field * Java: New operations for substring(), prepend(), and append() * Java: New method findInitializationErrors() * Python: Support for dynamic message creation * Python: Fixed custom options were not correctly populated * Python: Added EnumTypeWrapper * Python: Added ParseMessage(descriptor, bytes) * Various bug fixes and optimazations - Drop gtest-1.5, which is now included by the archive from the upstream * Sat May 19 2012 crrodriguez@opensuse.org - BuildRequire zlib-devel otherwise gzip_stream is not built thus breaking newer releases of mosh. * Fri Mar 16 2012 dimstar@opensuse.org - Add gtest-1.5.0.tar.bz2: This is the release tarball of gtest 1.5 which is being used by make check. The included 1.4.0 does not work with gcc 4.7, thus replacing the gtest folder with this snapshot. - Wrapped the gtest extraction with a version check... on next version the package will fail in order to remember to take this out again (next release of protobuf bundles gtest 1.5.0) - Add libtool BuildRequires and call to autoreconf, as gtest 1.5.0 needs to be bootstrapped. * Wed Dec 21 2011 coolo@suse.com - remove %%release from requires * Wed Oct 12 2011 tony@daylessday.org - Update to Protobuf 2.4.1: C++ * Fixed the frendship problem for old compilers to make the library now gcc 3 compatible again. * Fixed vcprojects/extract_includes.bat to extract compiler/plugin.h. Java * Removed usages of JDK 1.6 only features to make the library now JDK 1.5 compatible again. * Fixed a bug about negative enum values. * serialVersionUID is now defined in generated messages for java serializing. * Fixed protoc to use java.lang.Object, which makes "Object" now a valid message name again. Python * Experimental C++ implementation now requires C++ protobuf library installed. See the README.txt in the python directory for details. * Mon Apr 18 2011 ro@suse.de - update baselibs.conf * Wed Dec 15 2010 lnussel@suse.de - provide libprotobuf-devel for compatibility * Mon Apr 26 2010 lnussel@suse.de - merge features with version from devel:tools:building * build java and python versions * disable static libraries * Sat Apr 24 2010 lnussel@suse.de - new version 2.3.0 * Sat Apr 24 2010 lnussel@suse.de - separate soname define * Mon Dec 7 2009 lnussel@suse.de - new version 2.2.0a * Tue Mar 31 2009 lnussel@suse.de - move protoc to devel package - split according to library policy - install vim syntax file * Tue Sep 2 2008 Lenz Grimmer - Update to version 2.0.1 * Tue Aug 12 2008 Lenz Grimmer - Initial package the openSUSE build service (Version 2.0.0beta)