Package init

This commit is contained in:
dogsheng 2019-12-25 16:04:26 +08:00
parent 9efc2a95a6
commit c9f5b10822
7 changed files with 79 additions and 90 deletions

View File

@ -0,0 +1,12 @@
diff --git a/src/Makefile.am b/src/Makefile.am
index f869d56..c8170f2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,6 +19,7 @@ PTHREAD_DEF =
endif
PROTOBUF_VERSION = 20:0:0
+PROTOBUF_OPT_FLAG += -Wl,-z,now
if GCC
# Turn on all warnings except for sign comparison (we ignore sign comparison

View File

@ -1,26 +0,0 @@
From 3db1323d1d6132f08d0bafbd8602da7d71456745 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Tue, 28 Nov 2017 20:58:00 +0100
Subject: [PATCH] fix build on s390x
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
src/google/protobuf/stubs/atomicops.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/google/protobuf/stubs/atomicops.h b/src/google/protobuf/stubs/atomicops.h
index cb4553b1..34278f3a 100644
--- a/src/google/protobuf/stubs/atomicops.h
+++ b/src/google/protobuf/stubs/atomicops.h
@@ -214,7 +214,7 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
#elif defined(GOOGLE_PROTOBUF_ARCH_PPC)
#include <google/protobuf/stubs/atomicops_internals_ppc_gcc.h>
#elif (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4))
-#include <google/protobuf/stubs/atomicops_internals_generic_gcc.h>
+#include <google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h>
#elif defined(__clang__)
#if __has_extension(c_atomic)
#include <google/protobuf/stubs/atomicops_internals_generic_gcc.h>
--
2.15.0

Binary file not shown.

Binary file not shown.

BIN
protobuf-all-3.9.0.tar.gz Normal file

Binary file not shown.

View File

@ -2,29 +2,24 @@
%bcond_without python
# Build -java subpackage
%bcond_with java
%bcond_without python3
%global emacs_version %(pkg-config emacs --modversion)
%global emacs_lispdir %(pkg-config emacs --variable sitepkglispdir)
%global emacs_startdir %(pkg-config emacs --variable sitestartdir)
#global rcver rc2
Summary: Protocol Buffers - Google's data interchange format
Name: protobuf
Version: 3.5.0
Release: 11
Version: 3.9.0
Release: 6
License: BSD
URL: https://github.com/protocolbuffers/protobuf
Source: https://github.com/protocolbuffers/protobuf/archive/v%{version}.tar.gz
Source: https://github.com/protocolbuffers/protobuf/releases/download/v%{version}%{?rcver}/%{name}-all-%{version}%{?rcver}.tar.gz
Source1: ftdetect-proto.vim
Source2: protobuf-init.el
Source3: https://github.com/google/googlemock/archive/release-1.7.0.tar.gz#/googlemock-1.7.0.tar.gz
Source4: https://github.com/google/googletest/archive/release-1.7.0.tar.gz#/googletest-1.7.0.tar.gz
Patch9000: 0001-add-secure-compile-option-in-Makefile.patch
Patch0: 0001-fix-build-on-s390x.patch
BuildRequires: autoconf automake emacs(bin) emacs-el
BuildRequires: gcc-c++ libtool pkgconfig zlib-devel
BuildRequires: autoconf automake emacs gcc-c++ libtool pkgconfig zlib-devel
Requires: emacs-filesystem >= %{_emacs_version} vim-enhanced
Provides: %{name}-vim
Provides: %{name}-emacs
Provides: %{name}-emacs-el
@ -81,20 +76,25 @@ lacks descriptors, reflection, and some other features.
Summary: Python 2 bindings for Google Protocol Buffers
BuildArch: noarch
BuildRequires: python2-devel python2-setuptools
BuildRequires: python2-google-apputils
Requires: python2-six
Conflicts: %{name}-compiler > %{version}
Conflicts: %{name}-compiler < %{version}
Obsoletes: %{name}-python < 3.1.0-4
Provides: %{name}-python = %{version}-%{release}
%{?python_provide:%python_provide python2-%{name}}
%description -n python2-%{name}
This package contains Python 2 libraries for Google Protocol Buffers
%if %{with python3}
%package -n python%{python3_pkgversion}-%{name}
Summary: Python 3 bindings for Google Protocol Buffers
BuildArch: noarch
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
# For tests
BuildRequires: python%{python3_pkgversion}-google-apputils
Requires: python%{python3_pkgversion}-six >= 1.9
Conflicts: %{name}-compiler > %{version}
Conflicts: %{name}-compiler < %{version}
@ -104,6 +104,7 @@ Provides: %{name}-python3 = %{version}-%{release}
%description -n python%{python3_pkgversion}-%{name}
This package contains Python 3 libraries for Google Protocol Buffers
%endif
%endif
%if %{with java}
@ -121,6 +122,7 @@ BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
BuildRequires: mvn(org.easymock:easymock)
Conflicts: %{name}-compiler > %{version}
Conflicts: %{name}-compiler < %{version}
Obsoletes: %{name}-javanano < 3.6.0
%description java
This package contains Java Protocol Buffers runtime library.
@ -140,15 +142,6 @@ BuildArch: noarch
%description javadoc
This package contains the API documentation for %{name}-java.
%package javanano
Summary: Protocol Buffer JavaNano API
BuildArch: noarch
%description javanano
JavaNano is a special code generator and runtime
library designed specially for resource-restricted
systems, like Android.
%package parent
Summary: Protocol Buffer Parent POM
BuildArch: noarch
@ -159,24 +152,16 @@ Protocol Buffer Parent POM.
%endif
%prep
%setup -q -n %{name}-%{version}%{?rcver} -a 3 -a 4
%setup -q -n %{name}-%{version}%{?rcver}
%autopatch -p1
mv googlemock-release-1.7.0 gmock
mv googletest-release-1.7.0 gmock/gtest
find -name \*.cc -o -name \*.h | xargs chmod -x
chmod 644 examples/*
%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
# used by https://github.com/google/libphonenumber
%pom_xpath_inject "pom:project/pom:modules" "<module>../javanano</module>" java
%pom_remove_parent javanano
%pom_remove_dep org.easymock:easymockclassextension javanano
#rm -r java/core/src/test
# 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
@ -201,12 +186,14 @@ export PTHREAD_LIBS="-lpthread"
./autogen.sh
%configure
make %{?_smp_mflags}
%make_build
%if %{with python}
pushd python
%py2_build
%if %{with python3}
%py3_build
%endif
popd
%endif
@ -214,22 +201,30 @@ popd
%mvn_build -s -- -f java/pom.xml
%endif
emacs -batch -f batch-byte-compile editors/protobuf-mode.el
%{_emacs_bytecompile} editors/protobuf-mode.el
%check
# TODO: failures; get them fixed and remove || :
# https://github.com/protocolbuffers/protobuf/issues/631
make %{?_smp_mflags} check || :
# Java tests fail on s390x
%ifarch s390x
fail=0
%else
fail=1
%endif
make %{?_smp_mflags} check || exit $fail
%install
make %{?_smp_mflags} install DESTDIR=%{buildroot} STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p"
%make_install %{?_smp_mflags} STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p"
find %{buildroot} -type f -name "*.la" -exec rm -f {} \;
%if %{with python}
pushd python
#python ./setup.py install --root=%{buildroot} --single-version-externally-managed --record=INSTALLED_FILES --optimize=1
%py2_install
%if %{with python3}
%py3_install
%endif
find %{buildroot}%{python2_sitelib} %{buildroot}%{python3_sitelib} -name \*.py |
xargs sed -i -e '1{\@^#!@d}'
popd
@ -241,39 +236,41 @@ install -p -m 644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/synt
%mvn_install
%endif
mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir}
mkdir -p $RPM_BUILD_ROOT%{emacs_startdir}
install -p -m 0644 editors/protobuf-mode.el $RPM_BUILD_ROOT%{emacs_lispdir}
install -p -m 0644 editors/protobuf-mode.elc $RPM_BUILD_ROOT%{emacs_lispdir}
install -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{emacs_startdir}
mkdir -p %{buildroot}%{_emacs_sitelispdir}/%{name}
install -p -m 0644 editors/protobuf-mode.el %{buildroot}%{_emacs_sitelispdir}/%{name}
install -p -m 0644 editors/protobuf-mode.elc %{buildroot}%{_emacs_sitelispdir}/%{name}
mkdir -p %{buildroot}%{_emacs_sitestartdir}
install -p -m 0644 %{SOURCE2} %{buildroot}%{_emacs_sitestartdir}
%ldconfig_scriptlets
%ldconfig_scriptlets lite
%ldconfig_scriptlets compiler
%files
%{_libdir}/libprotobuf.so.15*
%{_datadir}/vim/vimfiles/ftdetect/proto.vim
%{_datadir}/vim/vimfiles/syntax/proto.vim
%{emacs_startdir}/protobuf-init.el
%{emacs_lispdir}/protobuf-mode.elc
%{emacs_lispdir}/protobuf-mode.el
%doc CHANGES.txt CONTRIBUTORS.txt README.md
%license LICENSE
%{_libdir}/libprotobuf.so.20*
%doc README.md
%license LICENSE
%{_bindir}/protoc
%{_libdir}/libprotoc.so.20*
%{_emacs_sitelispdir}/%{name}/
%{_emacs_sitestartdir}/protobuf-init.el
%{_datadir}/vim/vimfiles/ftdetect/proto.vim
%{_datadir}/vim/vimfiles/syntax/proto.vim
%files devel
%dir %{_includedir}/google
%{_includedir}/google/protobuf/
%{_bindir}/protoc
%{_libdir}/libprotoc.so.15*
%{_libdir}/libprotobuf.so
%{_libdir}/libprotoc.so
%{_libdir}/pkgconfig/protobuf.pc
%doc examples/add_person.cc examples/addressbook.proto examples/list_people.cc examples/Makefile examples/README.md
%{_libdir}/libprotobuf.a
%{_libdir}/libprotoc.a
%doc README.md examples/add_person.cc examples/addressbook.proto examples/list_people.cc examples/Makefile examples/README.md
%files lite
%{_libdir}/libprotobuf-lite.so.15*
%{_libdir}/libprotobuf-lite.so.20*
%files lite-devel
%{_libdir}/libprotobuf-lite.so
@ -289,6 +286,7 @@ install -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{emacs_startdir}
%doc python/README.md
%doc examples/add_person.py examples/list_people.py examples/addressbook.proto
%if %{with python3}
%files -n python%{python3_pkgversion}-protobuf
%dir %{python3_sitelib}/google
%{python3_sitelib}/google/protobuf/
@ -297,7 +295,7 @@ install -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{emacs_startdir}
%doc python/README.md
%doc examples/add_person.py examples/list_people.py examples/addressbook.proto
%endif
%endif
%if %{with java}
%files java -f .mfiles-protobuf-java
@ -310,26 +308,31 @@ install -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{emacs_startdir}
%files javadoc -f .mfiles-javadoc
%license LICENSE
%files javanano -f .mfiles-protobuf-javanano
%doc javanano/README.md
%license LICENSE
%files parent -f .mfiles-protobuf-parent
%license LICENSE
%endif
%changelog
* Tue Oct 29 2019 chengquan <chengquan3@openeuler.org> - 3.5.0-11
* Tue Dec 12 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.9.0-8.h3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:remove useless requires of google-apputils
- DESC:add bind now secure compile option
* Thu Oct 17 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.5.0-10
* Tue Nov 27 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.9.0-8.h2
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:compatible to centos 7.5
* Tue Nov 26 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.9.0-8.h1
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:add bcondwith java
- DESC:upgrade from 3.5.0 to 3.9.0
* Thu Oct 17 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.35-1
- Package init
* Fri Nov 01 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.5.0-8.h1
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:change patch's names according to new rules

Binary file not shown.