Репозиторий Sisyphus
Последнее обновление: 21 августа 2019 | Пакетов: 17343 | Посещений: 14693992
en ru br
Репозитории ALT
S:3.6.1.3-alt2
5.1: 2.1.0-alt1
www.altlinux.org/Changes

Группа :: Система/Библиотеки
Пакет: protobuf

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%define oname protobuf
%define soversion 17

# set 'enable' to build legacy package

%def_disable legacy

%if_disabled legacy
%define _unpackaged_files_terminate_build 1

# Tests on e2k takes 3-4 days (!)

%ifarch %e2k
%def_disable check
%endif

# normal package may include python3 or java support

%def_with python3
%def_with java
%else
# for legacy package python3 and java should always be disabled since it's not packed anyway
%def_without python3
%def_without java
%endif

%if_disabled legacy
Name: %oname
%else
Name: %oname%soversion
%endif
Version: 3.6.1.3
Release: alt2
Summary: Protocol Buffers - Google's data interchange format
License: Apache License 2.0
%if_disabled legacy
Group: System/Libraries
%else
Group: System/Legacy libraries
%endif
Url: https://github.com/protocolbuffers/protobuf

# https://github.com/protocolbuffers/protobuf.git

Source: %oname-%version.tar
Patch: %name-%version-%release.patch

Obsoletes: libprotobuf <= 2.0.0-alt1

# Automatically added by buildreq on Wed Nov 19 2008

BuildRequires: gcc-c++ python-devel libnumpy-devel zlib-devel

BuildRequires: python-module-setuptools
BuildRequires: python-module-google-apputils
BuildRequires: python-module-mox python-module-mox python-module-dateutil
BuildRequires: python-module-pytz python-module-gflags
%if_with python3
BuildRequires(pre): rpm-build-python3
BuildRequires: python3-devel libnumpy-py3-devel
BuildRequires: python3-module-setuptools python-tools-2to3
BuildRequires: python3-module-google-apputils
BuildRequires: python3-module-mox python3-module-mox python3-module-dateutil
BuildRequires: python3-module-pytz python3-module-gflags
%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 RPC protocols and file formats.

%package compiler
Summary: Protocol Buffers Compiler
Group: Development/Other
Requires: lib%oname%soversion = %EVR

%description compiler
Compiler for protocol buffer definition files

%package -n lib%oname%soversion
Summary: Protocol Buffer c++ library
%if_disabled legacy
Group: System/Libraries
%else
Group: System/Legacy libraries
%endif

Provides: libprotobuf = %EVR

%description -n lib%oname%soversion
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 lib%oname%soversion-lite
Summary: Protocol Buffers LITE_RUNTIME libraries
%if_disabled legacy
Group: System/Libraries
%else
Group: System/Legacy libraries
%endif
Provides: libprotobuf-lite = %EVR

%description -n lib%oname%soversion-lite
Protocol Buffers built with optimize_for = LITE_RUNTIME.

The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code
which only depends libprotobuf-lite, which is much smaller than libprotobuf but
lacks descriptors, reflection, and some other features.

%package -n lib%oname-devel
Summary: Development files for %oname
Group: Development/C
Requires: lib%oname%soversion = %EVR

%description -n lib%oname-devel
This package contains development files required for packaging
%oname.

%package -n lib%oname-lite-devel
Summary: Protocol Buffers LITE_RUNTIME development libraries
Group: Development/C
Requires: lib%oname%soversion-lite = %EVR
Requires: lib%oname-devel = %EVR

%description -n lib%oname-lite-devel
This package contains development libraries built with
optimize_for = LITE_RUNTIME.

The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code
which only depends libprotobuf-lite, which is much smaller than libprotobuf but
lacks descriptors, reflection, and some other features.

%package -n python-module-%oname
Summary: Python module files for %oname
Group: Development/Python
Requires: lib%oname%soversion = %EVR
%py_requires google.apputils
Conflicts: %name-compiler > %version
Conflicts: %name-compiler < %version

%description -n python-module-%oname
Python bindings for protocol buffers

%package -n python3-module-%oname
Summary: Python module files for %oname
Group: Development/Python3
Requires: lib%oname%soversion = %EVR
%py3_requires google.apputils
Conflicts: %name-compiler > %version
Conflicts: %name-compiler < %version

%description -n python3-module-%oname
Python bindings for protocol buffers

%if_with java
%package java
Summary: Java Protocol Buffers runtime library
Group: Development/Java
BuildArch:      noarch
BuildRequires:  maven-local
BuildRequires:  mvn(com.google.code.gson:gson)
BuildRequires:  mvn(com.google.guava:guava)
BuildRequires:  mvn(junit:junit)
BuildRequires:  mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires:  mvn(org.apache.maven.plugins:maven-antrun-plugin)
BuildRequires:  mvn(org.apache.maven.plugins:maven-source-plugin)
BuildRequires:  mvn(org.codehaus.mojo:build-helper-maven-plugin)
BuildRequires:  mvn(org.easymock:easymock)
BuildRequires:  rpm-build-java java-devel-default
BuildRequires:  libgmock-devel libgtest-devel
Conflicts: %name-compiler > %version
Conflicts: %name-compiler < %version
Obsoletes: %name-javanano < 3.6.0
# remove when xmvn will be patched to not insert this dep automatically
%filter_from_requires /^java-headless/d

%description java
This package contains Java Protocol Buffers runtime library.

%package javadoc
Summary: Javadocs for %oname-java
Group: Development/Documentation
BuildArch: noarch
Requires: %name-java = %EVR

%description javadoc
This package contains the API documentation for %oname-java.

%package java-util
Group: System/Libraries
Summary:        Utilities for Protocol Buffers
BuildArch:      noarch

%description java-util
Utilities to work with protos. It contains JSON support
as well as utilities to work with proto3 well-known types.

%package parent
Group: System/Libraries
Summary:        Protocol Buffer Parent POM
BuildArch:      noarch

%description parent
Protocol Buffer Parent POM.
%endif

%prep
%setup -n %oname-%version

%patch -p1

find -name \*.cc -o -name \*.h | xargs chmod -x
chmod 644 examples/*

# remove test with broken dependencies

rm -f python/google/protobuf/internal/json_format_test.py

%if_with python3
cp -fR python python3
%endif

%if %{with java}
%pom_remove_parent java/pom.xml
%pom_remove_dep org.easymock:easymockclassextension java/pom.xml java/*/pom.xml
# These use easymockclassextension
rm java/core/src/test/java/com/google/protobuf/ServiceTest.java

# Make OSGi dependency on sun.misc package optional

%pom_xpath_inject "pom:configuration/pom:instructions" "<Import-Package>sun.misc;resolution:=optional,*</Import-Package>" java/core

# Backward compatibility symlink

%mvn_file :protobuf-java:jar: %oname/%oname-java %oname

# This test is incredibly slow on arm/e2k, probably even worse on mipsel

# https://github.com/google/protobuf/issues/2389
%ifnarch %ix86 x86_64
mv java/core/src/test/java/com/google/protobuf/IsValidUtf8Test.java \
  java/core/src/test/java/com/google/protobuf/IsValidUtf8Test.java.slow
%endif
%endif

rm -f src/solaris/libstdc++.la

%build
%ifarch %e2k
# lcc 1.23: be explicit with C++11
%add_optflags -fno-error-always-inline -std=gnu++11
%endif

iconv -f iso8859-1 -t utf-8 CONTRIBUTORS.txt > CONTRIBUTORS.txt.utf8
mv CONTRIBUTORS.txt.utf8 CONTRIBUTORS.txt

rm -f m4/{lt*,libtool*}.m4
export PTHREAD_LIBS="-lpthread"
%autoreconf
%configure \
--disable-static \
--localstatedir=%_var \

%make_build
pushd python
%python_build --cpp_implementation
popd

%if_with python3
pushd python3
%python3_build --cpp_implementation
popd
%endif

%if_with java
%mvn_build -s -- -f java/pom.xml
%endif

%install
%makeinstall_std

pushd python
%python_install --cpp_implementation
popd

%if_with python3
pushd python3
%python3_install --cpp_implementation
popd
%endif

%if_with java
%mvn_install
%endif

%if_disabled legacy
%files compiler
%_bindir/protoc
%endif

%files -n lib%oname%soversion
%doc CONTRIBUTORS.txt README* examples/
%_libdir/*.so.*
%exclude %_libdir/libprotobuf-lite.so.*

%if_disabled legacy
%files -n lib%oname-devel
%dir %_includedir/google/
%_includedir/google/protobuf/
%_pkgconfigdir/protobuf.pc
%_libdir/*.so
%exclude %_libdir/libprotobuf-lite.so
%endif

%files -n lib%oname%soversion-lite
%_libdir/libprotobuf-lite.so.*

%if_disabled legacy
%files -n lib%oname-lite-devel
%_libdir/libprotobuf-lite.so
%_pkgconfigdir/protobuf-lite.pc

%files -n python-module-%oname
%python_sitelibdir/*

%files -n python3-module-%oname
%python3_sitelibdir/*

%if_with java
%files java -f .mfiles-protobuf-java
%doc examples/AddPerson.java examples/ListPeople.java
%doc java/README.md
%doc LICENSE

%files java-util -f .mfiles-protobuf-java-util

%files javadoc -f .mfiles-javadoc
%doc LICENSE

%files parent -f .mfiles-protobuf-parent
%doc LICENSE
%endif
%endif

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin