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
|
|
|
#
|
2024-01-02 14:59:46 +01:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
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.
|
|
|
|
|
2018-09-12 10:27:09 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2010-05-05 23:41:16 +02:00
|
|
|
#
|
|
|
|
|
2012-04-17 21:19:12 +02:00
|
|
|
|
2017-01-10 18:45:02 +01:00
|
|
|
%define tarname protobuf
|
2023-10-30 12:23:36 +01:00
|
|
|
%define extra_java_flags -source 8 -target 8
|
2017-01-10 18:45:02 +01:00
|
|
|
# requires gmock, which is not yet in the distribution
|
2020-11-23 08:23:19 +01:00
|
|
|
%bcond_with check
|
2020-05-05 11:16:54 +02:00
|
|
|
%bcond_without java
|
|
|
|
%bcond_without python3
|
2023-12-21 14:53:39 +01:00
|
|
|
%{?sle15_python_module_pythons}
|
2015-03-03 17:23:28 +01:00
|
|
|
Name: protobuf
|
2024-03-11 08:19:58 +01:00
|
|
|
Version: 25.3
|
|
|
|
%global sover 25_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++
|
2020-11-23 08:23:19 +01:00
|
|
|
URL: https://github.com/protocolbuffers/protobuf
|
2024-03-11 08:19:58 +01:00
|
|
|
Source0: https://github.com/protocolbuffers/protobuf/releases/download/v%{version}/%{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
|
2023-05-04 10:11:13 +02:00
|
|
|
BuildRequires: %{python_module abseil}
|
2023-12-21 14:53:39 +01:00
|
|
|
BuildRequires: %{python_module devel >= 3.7}
|
2018-01-22 18:03:30 +01:00
|
|
|
BuildRequires: %{python_module python-dateutil}
|
|
|
|
BuildRequires: %{python_module setuptools}
|
2023-05-04 10:11:13 +02:00
|
|
|
BuildRequires: abseil-cpp-devel >= 20230125
|
|
|
|
BuildRequires: cmake
|
2010-05-05 23:41:16 +02:00
|
|
|
BuildRequires: fdupes
|
2016-12-12 08:14:04 +01:00
|
|
|
BuildRequires: gcc-c++
|
2018-01-22 18:03:30 +01:00
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: python-rpm-macros
|
2022-12-15 22:21:13 +01:00
|
|
|
BuildRequires: pkgconfig(zlib)
|
2017-01-10 18:45:02 +01:00
|
|
|
%if %{with check}
|
2017-12-12 10:39:15 +01:00
|
|
|
BuildRequires: libgmock-devel >= 1.7.0
|
2017-01-10 18:45:02 +01:00
|
|
|
%endif
|
2018-01-22 18:03:30 +01:00
|
|
|
%if %{with java}
|
2023-10-30 12:23:36 +01:00
|
|
|
BuildRequires: java-devel >= 1.8
|
|
|
|
BuildRequires: javapackages-local >= 6
|
2010-05-05 23:41:16 +02:00
|
|
|
%endif
|
|
|
|
|
2023-12-21 14:53:39 +01:00
|
|
|
%if 0%{?suse_version} >= 1500
|
|
|
|
# generate subpackages for every python3 flavor
|
2020-11-24 08:31:34 +01:00
|
|
|
%define python_subpackage_only 1
|
|
|
|
%python_subpackages
|
|
|
|
%else
|
|
|
|
# same "defaults" for all distributions, used in files section
|
|
|
|
%define python_files() -n python3-%{**}
|
|
|
|
%define python_sitelib %{python3_sitelib}
|
|
|
|
%endif
|
|
|
|
|
2010-05-05 23:41:16 +02:00
|
|
|
%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
|
|
|
|
2017-12-12 10:39:15 +01:00
|
|
|
%package -n libprotobuf%{sover}
|
2010-05-05 23:41:16 +02:00
|
|
|
Summary: Protocol Buffers - Google's data interchange format
|
|
|
|
Group: System/Libraries
|
|
|
|
|
2017-12-12 10:39:15 +01:00
|
|
|
%description -n libprotobuf%{sover}
|
2010-05-05 23:41:16 +02: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
|
2013-04-17 10:11:57 +02:00
|
|
|
RPC protocols and file formats.
|
2010-05-05 23:41:16 +02:00
|
|
|
|
2017-12-12 10:39:15 +01:00
|
|
|
%package -n libprotoc%{sover}
|
2010-05-05 23:41:16 +02:00
|
|
|
Summary: Protocol Buffers - Google's data interchange format
|
|
|
|
Group: System/Libraries
|
|
|
|
|
2017-12-12 10:39:15 +01:00
|
|
|
%description -n libprotoc%{sover}
|
2010-05-05 23:41:16 +02: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
|
2013-04-17 10:11:57 +02:00
|
|
|
RPC protocols and file formats.
|
2010-05-05 23:41:16 +02:00
|
|
|
|
2017-12-12 10:39:15 +01:00
|
|
|
%package -n libprotobuf-lite%{sover}
|
2010-05-05 23:41:16 +02:00
|
|
|
Summary: Protocol Buffers - Google's data interchange format
|
|
|
|
Group: System/Libraries
|
|
|
|
|
2017-12-12 10:39:15 +01:00
|
|
|
%description -n libprotobuf-lite%{sover}
|
2010-05-05 23:41:16 +02: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
|
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++
|
2023-06-13 19:02:28 +02:00
|
|
|
Requires: abseil-cpp-devel >= 20230125
|
2012-05-19 20:48:39 +02:00
|
|
|
Requires: gcc-c++
|
2023-07-03 10:06:54 +02:00
|
|
|
Requires: libprotobuf%{sover} = %{VERSION}
|
2017-12-12 10:39:15 +01:00
|
|
|
Requires: libprotobuf-lite%{sover}
|
2022-03-17 10:44:21 +01:00
|
|
|
Requires: pkgconfig(zlib)
|
2017-01-10 18:45:02 +01:00
|
|
|
Conflicts: protobuf2-devel
|
2023-06-12 23:29:59 +02:00
|
|
|
Conflicts: protobuf21-devel
|
2023-07-03 10:06:54 +02:00
|
|
|
Provides: libprotobuf-devel = %{VERSION}
|
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
|
|
|
|
2020-11-24 08:31:34 +01:00
|
|
|
%if 0%{?python_subpackage_only}
|
|
|
|
%package -n python-%{name}
|
2023-07-03 10:06:54 +02:00
|
|
|
Version: 4.%{VERSION}
|
2020-11-24 08:31:34 +01:00
|
|
|
Summary: Python Bindings for Google Protocol Buffers
|
|
|
|
Group: Development/Libraries/Python
|
2024-03-11 08:19:58 +01:00
|
|
|
BuildArch: noarch
|
2020-11-24 08:31:34 +01:00
|
|
|
|
|
|
|
%description -n python-%{name}
|
|
|
|
This package contains the Python bindings for Google Protocol Buffers.
|
|
|
|
|
|
|
|
%else
|
2021-03-18 08:50:33 +01:00
|
|
|
|
2017-06-12 09:50:56 +02:00
|
|
|
%package -n python3-%{name}
|
2023-07-03 10:06:54 +02:00
|
|
|
Version: 4.%{VERSION}
|
2017-06-12 09:50:56 +02:00
|
|
|
Summary: Python3 Bindings for Google Protocol Buffers
|
|
|
|
Group: Development/Libraries/Python
|
2024-03-11 08:19:58 +01:00
|
|
|
BuildArch: noarch
|
2017-06-12 09:50:56 +02:00
|
|
|
|
|
|
|
%description -n python3-%{name}
|
2010-05-05 23:41:16 +02:00
|
|
|
This package contains the Python bindings for Google Protocol Buffers.
|
2020-11-24 08:31:34 +01:00
|
|
|
%endif
|
2010-05-05 23:41:16 +02:00
|
|
|
|
2023-05-04 10:11:13 +02:00
|
|
|
%package -n %{name}-java
|
|
|
|
Summary: Java Bindings for Google Protocol Buffers
|
|
|
|
Group: Development/Libraries/Java
|
|
|
|
Requires: java >= 1.6.0
|
2024-03-11 08:19:58 +01:00
|
|
|
BuildArch: noarch
|
2023-05-04 10:11:13 +02:00
|
|
|
|
|
|
|
%description -n %{name}-java
|
|
|
|
This package contains the Java bindings for Google Protocol Buffers.
|
|
|
|
|
2010-05-05 23:41:16 +02:00
|
|
|
%prep
|
2023-07-03 10:06:54 +02:00
|
|
|
%autosetup -p1 -n %{tarname}-%{VERSION}
|
2023-04-27 17:09:22 +02:00
|
|
|
|
2023-07-03 10:06:54 +02:00
|
|
|
# python module have their own version specified in python/google/protobuf/__init__.py
|
2023-07-03 10:00:47 +02:00
|
|
|
grep -qF "'4.%{VERSION}'" python/google/protobuf/__init__.py
|
|
|
|
|
2023-04-27 17:09:22 +02:00
|
|
|
# The previous blank line is crucial for older system being able
|
|
|
|
# to use the autosetup macro
|
2017-01-10 18:45:02 +01:00
|
|
|
mkdir gmock
|
|
|
|
|
2023-06-11 21:57:32 +02:00
|
|
|
%if %{with python3}
|
2015-12-07 05:19:50 +01:00
|
|
|
# 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
|
2018-01-22 18:03:30 +01:00
|
|
|
# kill shebang that we do not really want
|
|
|
|
sed -i -e '/env python/d' python/google/protobuf/internal/*.py
|
2010-05-05 23:41:16 +02:00
|
|
|
|
|
|
|
%build
|
2023-06-11 21:57:32 +02:00
|
|
|
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
|
|
|
|
|
2023-05-04 10:11:13 +02:00
|
|
|
# tests are not part of offical tar ball
|
|
|
|
%cmake \
|
|
|
|
-Dprotobuf_BUILD_TESTS=OFF \
|
|
|
|
-Dprotobuf_ABSL_PROVIDER=package
|
|
|
|
%cmake_build
|
2015-03-03 17:23:28 +01:00
|
|
|
|
2018-01-22 18:03:30 +01:00
|
|
|
%if %{with java}
|
2023-05-04 10:11:13 +02:00
|
|
|
pushd ../java
|
|
|
|
../build/protoc --java_out=core/src/main/java -I../src ../src/google/protobuf/descriptor.proto
|
2015-03-03 17:23:28 +01:00
|
|
|
mkdir classes
|
2019-06-08 18:22:03 +02: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
|
|
|
|
2023-05-04 10:11:13 +02:00
|
|
|
pushd ../python
|
|
|
|
export PROTOC=../build/protoc
|
2018-01-22 18:03:30 +01:00
|
|
|
%python_build
|
2017-06-12 09:50:56 +02:00
|
|
|
popd
|
2010-05-05 23:41:16 +02:00
|
|
|
|
|
|
|
%if %{with check}
|
|
|
|
%check
|
2023-03-23 10:41:15 +01:00
|
|
|
%make_build check
|
2010-05-05 23:41:16 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%install
|
2023-05-04 10:11:13 +02:00
|
|
|
%cmake_install
|
2015-03-03 17:23:28 +01:00
|
|
|
install -Dm 0644 editors/proto.vim %{buildroot}%{_datadir}/vim/site/syntax/proto.vim
|
|
|
|
|
2018-01-22 18:03:30 +01:00
|
|
|
%if %{with java}
|
2010-05-05 23:41:16 +02:00
|
|
|
pushd java
|
2023-10-30 12:23:36 +01:00
|
|
|
install -d -m 0755 %{buildroot}%{_javadir}
|
|
|
|
install -p -m 0644 %{name}-java-%{version}.jar %{buildroot}%{_javadir}/%{name}-java.jar
|
2019-09-27 09:59:04 +02:00
|
|
|
ln -s %{name}-java.jar %{buildroot}%{_javadir}/%{name}.jar
|
2023-10-30 12:23:36 +01:00
|
|
|
install -d -m 0755 %{buildroot}%{_mavenpomdir}
|
|
|
|
%{mvn_install_pom} core/pom.xml %{buildroot}%{_mavenpomdir}/%{name}-java.pom
|
2019-09-27 09:59:04 +02:00
|
|
|
%add_maven_depmap %{name}-java.pom %{name}-java.jar
|
2010-05-05 23:41:16 +02:00
|
|
|
popd
|
|
|
|
%endif
|
2015-03-03 17:23:28 +01:00
|
|
|
|
2018-01-22 18:03:30 +01:00
|
|
|
pushd python
|
2023-05-04 10:11:13 +02:00
|
|
|
export PROTOC=../build/protoc
|
2018-01-22 18:03:30 +01:00
|
|
|
%python_install
|
2010-05-05 23:41:16 +02:00
|
|
|
popd
|
2018-01-22 18:03:30 +01:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2010-05-05 23:41:16 +02:00
|
|
|
|
2019-01-18 16:52:56 +01:00
|
|
|
%fdupes %{buildroot}%{_prefix}
|
|
|
|
|
2024-03-08 19:02:59 +01:00
|
|
|
%ldconfig_scriptlets -n libprotobuf%{sover}
|
|
|
|
%ldconfig_scriptlets -n libprotoc%{sover}
|
|
|
|
%ldconfig_scriptlets -n libprotobuf-lite%{sover}
|
2010-05-05 23:41:16 +02:00
|
|
|
|
2017-12-12 10:39:15 +01:00
|
|
|
%files -n libprotobuf%{sover}
|
2018-01-22 18:03:30 +01:00
|
|
|
%license LICENSE
|
2023-07-03 10:06:54 +02:00
|
|
|
%{_libdir}/libprotobuf.so.%{VERSION}.0
|
2010-05-05 23:41:16 +02:00
|
|
|
|
2017-12-12 10:39:15 +01:00
|
|
|
%files -n libprotoc%{sover}
|
2024-03-08 19:02:59 +01:00
|
|
|
%license LICENSE
|
2023-07-03 10:06:54 +02:00
|
|
|
%{_libdir}/libprotoc.so.%{VERSION}.0
|
2010-05-05 23:41:16 +02:00
|
|
|
|
2017-12-12 10:39:15 +01:00
|
|
|
%files -n libprotobuf-lite%{sover}
|
2024-03-08 19:02:59 +01:00
|
|
|
%license LICENSE
|
2023-07-03 10:06:54 +02:00
|
|
|
%{_libdir}/libprotobuf-lite.so.%{VERSION}.0
|
2010-05-05 23:41:16 +02:00
|
|
|
|
|
|
|
%files devel
|
2024-03-08 19:02:59 +01:00
|
|
|
%license LICENSE
|
2023-05-04 10:11:13 +02:00
|
|
|
%doc CONTRIBUTORS.txt README.md
|
|
|
|
%{_bindir}/protoc*
|
2010-05-05 23:41:16 +02:00
|
|
|
%{_includedir}/google
|
2024-01-02 14:59:46 +01:00
|
|
|
%dir %{_includedir}/java
|
|
|
|
%dir %{_includedir}/java/core
|
|
|
|
%dir %{_includedir}/java/core/src
|
|
|
|
%dir %{_includedir}/java/core/src/main
|
|
|
|
%dir %{_includedir}/java/core/src/main/java
|
|
|
|
%dir %{_includedir}/java/core/src/main/java/com
|
|
|
|
%dir %{_includedir}/java/core/src/main/java/com/google
|
|
|
|
%dir %{_includedir}/java/core/src/main/java/com/google/protobuf
|
|
|
|
%{_includedir}/java/core/src/main/java/com/google/protobuf/java_features.proto
|
2023-05-04 10:11:13 +02:00
|
|
|
%{_includedir}/*.h
|
|
|
|
%{_libdir}/cmake/protobuf
|
|
|
|
%{_libdir}/cmake/utf8_range
|
2010-05-05 23:41:16 +02:00
|
|
|
%{_libdir}/pkgconfig/*
|
2022-08-04 22:59:41 +02:00
|
|
|
%{_libdir}/libprotobuf-lite.so
|
|
|
|
%{_libdir}/libprotobuf.so
|
|
|
|
%{_libdir}/libprotoc.so
|
2023-06-11 21:57:32 +02:00
|
|
|
%{_libdir}/libutf8_range.a
|
|
|
|
%{_libdir}/libutf8_validity.a
|
2010-05-05 23:41:16 +02:00
|
|
|
%{_datadir}/vim
|
|
|
|
|
2018-01-22 18:03:30 +01:00
|
|
|
%if %{with java}
|
2019-09-27 09:59:04 +02:00
|
|
|
%files -n %{name}-java -f java/.mfiles
|
2024-03-08 19:02:59 +01:00
|
|
|
%license LICENSE
|
2019-09-27 09:59:04 +02:00
|
|
|
%{_javadir}/%{name}.jar
|
2010-05-05 23:41:16 +02:00
|
|
|
%endif
|
|
|
|
|
2023-06-11 21:57:32 +02:00
|
|
|
%if %{with python3}
|
2020-11-24 08:31:34 +01:00
|
|
|
%files %{python_files %{name}}
|
2018-01-22 18:03:30 +01:00
|
|
|
%license LICENSE
|
2023-06-11 21:57:32 +02:00
|
|
|
%dir %{python_sitelib}/google
|
|
|
|
%{python_sitelib}/google/protobuf
|
|
|
|
%{python_sitelib}/protobuf*nspkg.pth
|
|
|
|
%{python_sitelib}/protobuf*info
|
2010-05-05 23:41:16 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%changelog
|