2010-05-05 23:41:16 +02:00
|
|
|
#
|
2011-10-26 07:45:30 +02:00
|
|
|
# spec file for package protobuf
|
2010-05-05 23:41:16 +02:00
|
|
|
#
|
2017-01-10 18:45:02 +01:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2010-05-05 23:41:16 +02:00
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
2012-04-17 21:19:12 +02:00
|
|
|
|
2017-06-12 09:50:56 +02:00
|
|
|
%define soname 13
|
2017-01-10 18:45:02 +01:00
|
|
|
%define tarname protobuf
|
|
|
|
# requires gmock, which is not yet in the distribution
|
|
|
|
%bcond_with check
|
2016-12-12 08:14:04 +01:00
|
|
|
%bcond_without protobuf_java
|
|
|
|
%bcond_without protobuf_python
|
2017-01-10 18:45:02 +01:00
|
|
|
|
2017-06-12 09:50:56 +02:00
|
|
|
%if %{with protobuf_python}
|
|
|
|
%if 0%{?suse_version} > 1320
|
|
|
|
%define protobuf_python3 1
|
|
|
|
%define python2_prefix python2
|
|
|
|
%else
|
|
|
|
%define protobuf_python3 0
|
|
|
|
%define python2_prefix python
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
2015-03-03 17:23:28 +01:00
|
|
|
Name: protobuf
|
2017-06-12 09:50:56 +02:00
|
|
|
Version: 3.3.0
|
2015-03-03 17:23:28 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Protocol Buffers - Google's data interchange format
|
|
|
|
License: BSD-3-Clause
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Url: https://github.com/google/protobuf/
|
2017-01-10 18:45:02 +01:00
|
|
|
Source0: https://github.com/google/protobuf/archive/v%{version}.tar.gz#/%{tarname}-%{version}.tar.gz
|
2015-03-03 17:23:28 +01:00
|
|
|
Source1: manifest.txt.in
|
2015-07-29 17:54:39 +02:00
|
|
|
Source2: baselibs.conf
|
2015-03-03 17:23:28 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2017-01-10 18:45:02 +01:00
|
|
|
BuildRequires: autoconf
|
|
|
|
BuildRequires: automake
|
2010-05-05 23:41:16 +02:00
|
|
|
BuildRequires: fdupes
|
2016-12-12 08:14:04 +01:00
|
|
|
BuildRequires: gcc-c++
|
2017-01-10 18:45:02 +01:00
|
|
|
%if %{with check}
|
|
|
|
BuildRequires: libgmock-devel
|
|
|
|
%endif
|
|
|
|
BuildRequires: libtool
|
2016-12-12 08:14:04 +01:00
|
|
|
BuildRequires: pkg-config
|
2010-05-05 23:41:16 +02:00
|
|
|
%if %{with protobuf_java}
|
|
|
|
BuildRequires: java-devel >= 1.6.0
|
|
|
|
%endif
|
|
|
|
%if %{with protobuf_python}
|
2017-06-12 09:50:56 +02:00
|
|
|
BuildRequires: %{python2_prefix}-devel
|
|
|
|
BuildRequires: %{python2_prefix}-python-dateutil
|
|
|
|
BuildRequires: %{python2_prefix}-python-gflags
|
|
|
|
BuildRequires: %{python2_prefix}-pytz
|
|
|
|
BuildRequires: %{python2_prefix}-setuptools
|
|
|
|
%if %{protobuf_python3}
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
BuildRequires: python3-python-dateutil
|
|
|
|
BuildRequires: python3-python-gflags
|
|
|
|
BuildRequires: python3-pytz
|
|
|
|
BuildRequires: python3-setuptools
|
|
|
|
%endif
|
2013-04-17 10:11:57 +02:00
|
|
|
BuildRequires: zlib-devel
|
2010-05-05 23:41:16 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%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
|
2013-04-17 10:11:57 +02:00
|
|
|
RPC protocols and file formats.
|
2010-05-05 23:41:16 +02:00
|
|
|
|
|
|
|
%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
|
2013-04-17 10:11:57 +02:00
|
|
|
RPC protocols and file formats.
|
2010-05-05 23:41:16 +02:00
|
|
|
|
|
|
|
%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
|
2013-04-17 10:11:57 +02:00
|
|
|
RPC protocols and file formats.
|
2010-05-05 23:41:16 +02:00
|
|
|
|
|
|
|
%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
|
2013-04-17 10:11:57 +02:00
|
|
|
RPC protocols and file formats.
|
2010-05-05 23:41:16 +02:00
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Header files, libraries and development documentation for %{name}
|
|
|
|
Group: Development/Libraries/C and C++
|
2012-05-19 20:48:39 +02:00
|
|
|
Requires: gcc-c++
|
2015-03-03 17:23:28 +01:00
|
|
|
Requires: libprotobuf%{soname} = %{version}
|
2012-05-19 20:48:39 +02:00
|
|
|
Requires: libprotobuf-lite%{soname}
|
|
|
|
Requires: zlib-devel
|
2015-03-03 17:23:28 +01:00
|
|
|
Provides: libprotobuf-devel = %{version}
|
2017-01-10 18:45:02 +01:00
|
|
|
Conflicts: protobuf2-devel
|
2010-05-05 23:41:16 +02:00
|
|
|
|
|
|
|
%description devel
|
2015-03-03 17:23:28 +01:00
|
|
|
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.
|
2010-05-05 23:41:16 +02:00
|
|
|
|
|
|
|
%if %{with protobuf_java}
|
|
|
|
%package -n %{name}-java
|
|
|
|
Summary: Java Bindings for Google Protocol Buffers
|
2011-12-19 13:00:38 +01:00
|
|
|
Group: Development/Libraries/Java
|
2015-03-03 17:23:28 +01:00
|
|
|
Requires: java >= 1.6.0
|
2010-05-05 23:41:16 +02:00
|
|
|
|
|
|
|
%description -n %{name}-java
|
|
|
|
This package contains the Java bindings for Google Protocol Buffers.
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with protobuf_python}
|
2017-06-12 09:50:56 +02:00
|
|
|
%package -n %{python2_prefix}-%{name}
|
|
|
|
Summary: Python2 Bindings for Google Protocol Buffers
|
2015-03-03 17:23:28 +01:00
|
|
|
Group: Development/Libraries/Python
|
2017-06-12 09:50:56 +02:00
|
|
|
%if 0%{?protobuf_python3}
|
|
|
|
Provides: python-%{name} = %{version}
|
|
|
|
Obsoletes: python-%{name} < %{version}
|
|
|
|
%endif
|
2010-05-05 23:41:16 +02:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
%py_requires
|
|
|
|
%else
|
|
|
|
Requires: python
|
|
|
|
%endif
|
|
|
|
|
2017-06-12 09:50:56 +02:00
|
|
|
%description -n %{python2_prefix}-%{name}
|
|
|
|
This package contains the Python bindings for Google Protocol Buffers.
|
|
|
|
|
|
|
|
%if 0%{?protobuf_python3}
|
|
|
|
%package -n python3-%{name}
|
|
|
|
Summary: Python3 Bindings for Google Protocol Buffers
|
|
|
|
Group: Development/Libraries/Python
|
|
|
|
Requires: python3
|
|
|
|
|
|
|
|
%description -n python3-%{name}
|
2010-05-05 23:41:16 +02:00
|
|
|
This package contains the Python bindings for Google Protocol Buffers.
|
|
|
|
%endif
|
2017-06-12 09:50:56 +02:00
|
|
|
%endif
|
2010-05-05 23:41:16 +02:00
|
|
|
|
|
|
|
%prep
|
|
|
|
|
2017-01-10 18:45:02 +01:00
|
|
|
%setup -q -n %{tarname}-%{version}
|
|
|
|
mkdir gmock
|
|
|
|
|
2015-12-07 05:19:50 +01:00
|
|
|
%if %{with protobuf_python}
|
|
|
|
# only needed for test suite which we don't call anyways.
|
|
|
|
# googleapis is broken on sle12
|
|
|
|
sed -i '/apputils/d' python/setup.py
|
|
|
|
sed -i '/google_test_dir/d' python/setup.py
|
|
|
|
%endif
|
2010-05-05 23:41:16 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
%if 0%{?mandriva_version}
|
|
|
|
#XXX something wents wrong with detecting this
|
|
|
|
export PTHREAD_LIBS=-lpthread
|
|
|
|
%endif
|
2015-03-03 17:23:28 +01:00
|
|
|
|
2017-01-10 18:45:02 +01:00
|
|
|
./autogen.sh
|
2015-03-03 17:23:28 +01:00
|
|
|
%configure \
|
|
|
|
--disable-static
|
|
|
|
|
|
|
|
make %{?_smp_mflags}
|
|
|
|
|
2010-05-05 23:41:16 +02:00
|
|
|
%if %{with protobuf_java}
|
|
|
|
pushd java
|
2017-01-10 18:45:02 +01:00
|
|
|
../src/protoc --java_out=core/src/main/java -I../src ../src/google/protobuf/descriptor.proto
|
2015-03-03 17:23:28 +01:00
|
|
|
mkdir classes
|
2017-01-10 18:45:02 +01:00
|
|
|
javac $extra_java_flags -d classes core/src/main/java/com/google/protobuf/*.java
|
2015-03-03 17:23:28 +01:00
|
|
|
sed -e 's/@VERSION@/%{version}/' < %{SOURCE1} > manifest.txt
|
2010-05-05 23:41:16 +02:00
|
|
|
jar cfm %{name}-java-%{version}.jar manifest.txt -C classes com
|
|
|
|
popd
|
|
|
|
%endif
|
2015-03-03 17:23:28 +01:00
|
|
|
|
2010-05-05 23:41:16 +02:00
|
|
|
%if %{with protobuf_python}
|
2017-06-12 09:50:56 +02:00
|
|
|
cp -Ra python python2
|
|
|
|
pushd python2
|
|
|
|
python2 setup.py build
|
2017-01-22 10:04:28 +01:00
|
|
|
# setup.py seems to be broken, some files are only installed on the second invocation
|
2017-06-12 09:50:56 +02:00
|
|
|
python2 setup.py build
|
2010-05-05 23:41:16 +02:00
|
|
|
popd
|
2017-06-12 09:50:56 +02:00
|
|
|
|
|
|
|
%if 0%{?protobuf_python3}
|
|
|
|
cp -Ra python python3
|
|
|
|
pushd python3
|
|
|
|
python3 setup.py build
|
|
|
|
# setup.py seems to be broken, some files are only installed on the second invocation
|
|
|
|
python3 setup.py build
|
|
|
|
popd
|
|
|
|
%endif
|
2010-05-05 23:41:16 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with check}
|
|
|
|
%check
|
2015-03-03 17:23:28 +01:00
|
|
|
make %{?_smp_mflags} check
|
2010-05-05 23:41:16 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%install
|
2015-03-03 17:23:28 +01:00
|
|
|
make DESTDIR=%{buildroot} install %{?_smp_mflags}
|
|
|
|
install -Dm 0644 editors/proto.vim %{buildroot}%{_datadir}/vim/site/syntax/proto.vim
|
2010-05-05 23:41:16 +02:00
|
|
|
# no need for that
|
2015-03-03 17:23:28 +01:00
|
|
|
find %{buildroot} -type f -name "*.la" -delete -print
|
|
|
|
|
2010-05-05 23:41:16 +02:00
|
|
|
%if %{with protobuf_java}
|
|
|
|
pushd java
|
2015-03-03 17:23:28 +01:00
|
|
|
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
|
2010-05-05 23:41:16 +02:00
|
|
|
popd
|
|
|
|
%endif
|
2015-03-03 17:23:28 +01:00
|
|
|
|
2010-05-05 23:41:16 +02:00
|
|
|
%if %{with protobuf_python}
|
2017-06-12 09:50:56 +02:00
|
|
|
pushd python2
|
|
|
|
python2 setup.py install --skip-build \
|
2010-05-05 23:41:16 +02:00
|
|
|
--prefix=%{_prefix} \
|
|
|
|
--root %{buildroot} \
|
2017-06-12 09:50:56 +02:00
|
|
|
--install-lib=%{python_sitearch} \
|
2016-12-24 11:20:14 +01:00
|
|
|
--install-data=%{_datadir} \
|
2010-05-05 23:41:16 +02:00
|
|
|
--record-rpm=INSTALLED_FILES
|
|
|
|
popd
|
2017-06-12 09:50:56 +02:00
|
|
|
%fdupes -s %{buildroot}%{python_sitearch}
|
2015-03-03 17:23:28 +01:00
|
|
|
|
2017-06-12 09:50:56 +02:00
|
|
|
%if 0%{?protobuf_python3}
|
|
|
|
pushd python3
|
|
|
|
python3 setup.py install --skip-build \
|
|
|
|
--prefix=%{_prefix} \
|
|
|
|
--root %{buildroot} \
|
|
|
|
--install-lib=%{python3_sitearch} \
|
|
|
|
--install-data=%{_datadir} \
|
|
|
|
--record-rpm=INSTALLED_FILES
|
|
|
|
popd
|
|
|
|
%fdupes -s %{buildroot}%{python3_sitearch}
|
|
|
|
%endif
|
|
|
|
%endif
|
2010-05-05 23:41:16 +02:00
|
|
|
|
|
|
|
%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)
|
2017-06-16 10:02:37 +02:00
|
|
|
%doc LICENSE
|
2010-05-05 23:41:16 +02:00
|
|
|
%{_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)
|
2015-03-03 17:23:28 +01:00
|
|
|
%doc CHANGES.txt CONTRIBUTORS.txt README.md
|
2010-05-05 23:41:16 +02:00
|
|
|
%{_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}
|
2017-06-12 09:50:56 +02:00
|
|
|
%files -n %{python2_prefix}-%{name} -f python2/INSTALLED_FILES
|
2010-05-05 23:41:16 +02:00
|
|
|
%defattr(-,root,root)
|
2017-06-12 09:50:56 +02:00
|
|
|
|
|
|
|
%if 0%{?protobuf_python3}
|
|
|
|
%files -n python3-%{name} -f python3/INSTALLED_FILES
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%endif
|
2010-05-05 23:41:16 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%changelog
|