|
|
|
|
@@ -1,7 +1,7 @@
|
|
|
|
|
#
|
|
|
|
|
# spec file for package protobuf
|
|
|
|
|
# spec file for package protobuf21
|
|
|
|
|
#
|
|
|
|
|
# Copyright (c) 2023 SUSE LLC
|
|
|
|
|
# Copyright (c) 2024 SUSE LLC
|
|
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
@@ -20,12 +20,14 @@
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
|
|
|
%define sover 3_21_12
|
|
|
|
|
%define tarname protobuf
|
|
|
|
|
%define src_install_dir %{_prefix}/src/%{name}
|
|
|
|
|
%define extra_java_flags -source 7 -target 7
|
|
|
|
|
# requires gmock, which is not yet in the distribution
|
|
|
|
|
%bcond_with check
|
|
|
|
|
%bcond_with java
|
|
|
|
|
%bcond_with python3
|
|
|
|
|
%if 0%{?gcc_version} < 11
|
|
|
|
|
%define with_gcc 11
|
|
|
|
|
%endif
|
|
|
|
|
Name: protobuf21
|
|
|
|
|
Version: 21.12
|
|
|
|
|
Release: 0
|
|
|
|
|
@@ -44,10 +46,9 @@ Provides: protobuf = %{version}
|
|
|
|
|
BuildRequires: %{python_module devel}
|
|
|
|
|
BuildRequires: %{python_module python-dateutil}
|
|
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
|
BuildRequires: autoconf
|
|
|
|
|
BuildRequires: automake
|
|
|
|
|
BuildRequires: cmake
|
|
|
|
|
BuildRequires: fdupes
|
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
|
BuildRequires: gcc%{?with_gcc}-c++
|
|
|
|
|
BuildRequires: libtool
|
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
|
@@ -119,18 +120,6 @@ 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 source
|
|
|
|
|
Summary: Source code of protobuf
|
|
|
|
|
Group: Development/Sources
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
|
|
%description source
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
This package contains source code for Protocol Buffers.
|
|
|
|
|
|
|
|
|
|
%package -n %{name}-java
|
|
|
|
|
Summary: Java Bindings for Google Protocol Buffers
|
|
|
|
|
Group: Development/Libraries/Java
|
|
|
|
|
@@ -176,11 +165,16 @@ sed -i '/google_test_dir/d' python/setup.py
|
|
|
|
|
sed -i -e '/env python/d' python/google/protobuf/internal/*.py
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
autoreconf -fvi
|
|
|
|
|
%configure \
|
|
|
|
|
--disable-static
|
|
|
|
|
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
|
|
|
|
|
|
|
|
|
|
%make_build
|
|
|
|
|
%if 0%{?with_gcc}
|
|
|
|
|
export CXX=g++-%{with_gcc}
|
|
|
|
|
export CC=gcc-%{with_gcc}
|
|
|
|
|
%endif
|
|
|
|
|
%cmake \
|
|
|
|
|
-Dprotobuf_BUILD_TESTS=OFF \
|
|
|
|
|
%{nil}
|
|
|
|
|
%cmake_build
|
|
|
|
|
|
|
|
|
|
%if %{with java}
|
|
|
|
|
pushd java
|
|
|
|
|
@@ -204,7 +198,7 @@ popd
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%make_install
|
|
|
|
|
%cmake_install
|
|
|
|
|
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
|
|
|
|
|
@@ -229,23 +223,6 @@ popd
|
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}%{src_install_dir}
|
|
|
|
|
tar -xzf %{SOURCE0} --strip-components=1 -C %{buildroot}%{src_install_dir}
|
|
|
|
|
%fdupes %{buildroot}%{src_install_dir}
|
|
|
|
|
# Fix env-script-interpreter rpmlint error
|
|
|
|
|
find %{buildroot}%{src_install_dir} -type f -name "*.js" -exec sed -i 's|#!.*%{_bindir}/env node|#!%{_bindir}/node|' "{}" +
|
|
|
|
|
find %{buildroot}%{src_install_dir} -type f -name "*.py" -exec sed -i 's|#!.*%{_bindir}/env python2.7|#!%{_bindir}/python2.7|' "{}" +
|
|
|
|
|
find %{buildroot}%{src_install_dir} -type f -name "*.py" -exec sed -i 's|#!.*%{_bindir}/env python|#!%{_bindir}/python|' "{}" +
|
|
|
|
|
find %{buildroot}%{src_install_dir} -type f -name "*.rb" -exec sed -i 's|#!.*%{_bindir}/env ruby|#!%{_bindir}/ruby|' "{}" +
|
|
|
|
|
find %{buildroot}%{src_install_dir} -type f -name "*.sh" -exec sed -i 's|#!.*%{_bindir}/env bash|#!/bin/bash|' "{}" +
|
|
|
|
|
# And stop requiring ridiculously old Python version
|
|
|
|
|
find %{buildroot}%{src_install_dir} -type f -name "*.py" -exec sed -i 's|#!%{_bindir}/python2.4|#!%{_bindir}/python2.7|' "{}" +
|
|
|
|
|
# Fix spurious-executable-perm rpmlint error
|
|
|
|
|
chmod -x %{buildroot}%{src_install_dir}/src/google/protobuf/arenastring.h
|
|
|
|
|
chmod -x %{buildroot}%{src_install_dir}/src/google/protobuf/reflection.h
|
|
|
|
|
# Fix version-control-internal-file rpmlint warning
|
|
|
|
|
find %{buildroot}%{src_install_dir} -type f -name ".gitignore" -exec rm -f "{}" +
|
|
|
|
|
|
|
|
|
|
%fdupes %{buildroot}%{_prefix}
|
|
|
|
|
|
|
|
|
|
%post -n libprotobuf%{sover} -p /sbin/ldconfig
|
|
|
|
|
@@ -257,27 +234,26 @@ find %{buildroot}%{src_install_dir} -type f -name ".gitignore" -exec rm -f "{}"
|
|
|
|
|
|
|
|
|
|
%files -n libprotobuf%{sover}
|
|
|
|
|
%license LICENSE
|
|
|
|
|
%{_libdir}/libprotobuf-3.%{version}.so
|
|
|
|
|
%{_libdir}/libprotobuf.so.3.%{version}*
|
|
|
|
|
|
|
|
|
|
%files -n libprotoc%{sover}
|
|
|
|
|
%{_libdir}/libprotoc-3.%{version}.so
|
|
|
|
|
%{_libdir}/libprotoc.so.3.%{version}*
|
|
|
|
|
|
|
|
|
|
%files -n libprotobuf-lite%{sover}
|
|
|
|
|
%{_libdir}/libprotobuf-lite-3.%{version}.so
|
|
|
|
|
%{_libdir}/libprotobuf-lite.so.3.%{version}*
|
|
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
|
%doc CHANGES.txt CONTRIBUTORS.txt README.md
|
|
|
|
|
%{_bindir}/protoc
|
|
|
|
|
%{_bindir}/protoc-3.%{version}*
|
|
|
|
|
%{_includedir}/google
|
|
|
|
|
%{_libdir}/pkgconfig/*
|
|
|
|
|
%{_libdir}/libprotobuf-lite.so
|
|
|
|
|
%{_libdir}/libprotobuf.so
|
|
|
|
|
%{_libdir}/libprotoc.so
|
|
|
|
|
%{_libdir}/cmake/protobuf
|
|
|
|
|
%{_datadir}/vim
|
|
|
|
|
|
|
|
|
|
%files source
|
|
|
|
|
%{src_install_dir}
|
|
|
|
|
|
|
|
|
|
%if %{with java}
|
|
|
|
|
%files -n %{name}-java -f java/.mfiles
|
|
|
|
|
%{_javadir}/%{name}.jar
|
|
|
|
|
|