diff --git a/0001-Add-generic-GCC-support-for-atomic-operations.patch b/0001-Add-generic-GCC-support-for-atomic-operations.patch new file mode 100644 index 0000000000000000000000000000000000000000..171695f70b102de2301f5b45d9e9ab3167b4a0e8 --- /dev/null +++ b/0001-Add-generic-GCC-support-for-atomic-operations.patch @@ -0,0 +1,209 @@ +From d099ec11fc8c2eb97df2bf2fbb6996066eefca46 Mon Sep 17 00:00:00 2001 +From: Stanislav Ochotnicky +Date: Thu, 2 May 2013 10:43:47 +0200 +Subject: [PATCH] Add generic GCC support for atomic operations + +This is useful for architectures where no specialized code has been +written. +--- + src/google/protobuf/stubs/atomicops.h | 2 +- + .../stubs/atomicops_internals_generic_gcc.h | 139 +++++++++++++++++++++ + src/google/protobuf/stubs/platform_macros.h | 14 ++- + 3 files changed, 153 insertions(+), 2 deletions(-) + create mode 100644 src/google/protobuf/stubs/atomicops_internals_generic_gcc.h + +diff --git a/src/google/protobuf/stubs/atomicops.h b/src/google/protobuf/stubs/atomicops.h +index b8581fa..883b125 100644 +--- a/src/google/protobuf/stubs/atomicops.h ++++ b/src/google/protobuf/stubs/atomicops.h +@@ -185,7 +185,7 @@ GOOGLE_PROTOBUF_ATOMICOPS_ERROR + #elif defined(__pnacl__) + #include + #else +-GOOGLE_PROTOBUF_ATOMICOPS_ERROR ++#include + #endif + + // Unknown. +diff --git a/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h b/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h +new file mode 100644 +index 0000000..3fc2a9b +--- /dev/null ++++ b/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h +@@ -0,0 +1,139 @@ ++// Protocol Buffers - Google's data interchange format ++// Copyright 2013 Red Hat Inc. All rights reserved. ++// http://code.google.com/p/protobuf/ ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions are ++// met: ++// ++// * Redistributions of source code must retain the above copyright ++// notice, this list of conditions and the following disclaimer. ++// * Redistributions in binary form must reproduce the above ++// copyright notice, this list of conditions and the following disclaimer ++// in the documentation and/or other materials provided with the ++// distribution. ++// * Neither the name of Red Hat Inc. nor the names of its ++// contributors may be used to endorse or promote products derived from ++// this software without specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ++// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ++// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ++// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ++// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ ++// This file is an internal atomic implementation, use atomicops.h instead. ++ ++#ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_GENERIC_GCC_H_ ++#define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_GENERIC_GCC_H_ ++ ++namespace google { ++namespace protobuf { ++namespace internal { ++ ++inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, ++ Atomic32 old_value, ++ Atomic32 new_value) { ++ __atomic_compare_exchange_n(ptr, &old_value, new_value, true, ++ __ATOMIC_RELAXED, __ATOMIC_RELAXED); ++ return old_value; ++} ++ ++inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, ++ Atomic32 new_value) { ++ return __atomic_exchange_n(ptr, new_value, __ATOMIC_RELAXED); ++} ++ ++inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, ++ Atomic32 increment) { ++ return __atomic_add_fetch(ptr, increment, __ATOMIC_RELAXED); ++} ++ ++inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, ++ Atomic32 increment) { ++ return __atomic_add_fetch(ptr, increment, __ATOMIC_SEQ_CST); ++} ++ ++inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, ++ Atomic32 old_value, ++ Atomic32 new_value) { ++ __atomic_compare_exchange(ptr, &old_value, &new_value, true, ++ __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE); ++ return old_value; ++} ++ ++inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, ++ Atomic32 old_value, ++ Atomic32 new_value) { ++ __atomic_compare_exchange_n(ptr, &old_value, new_value, true, ++ __ATOMIC_RELEASE, __ATOMIC_ACQUIRE); ++ return old_value; ++} ++ ++inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { ++ __atomic_store_n(ptr, value, __ATOMIC_RELAXED); ++} ++ ++inline void MemoryBarrier() { ++ __sync_synchronize(); ++} ++ ++inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { ++ __atomic_store_n(ptr, value, __ATOMIC_ACQUIRE); ++} ++ ++inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { ++ __atomic_store_n(ptr, value, __ATOMIC_RELEASE); ++} ++ ++inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { ++ return __atomic_load_n(ptr, __ATOMIC_RELAXED); ++} ++ ++inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { ++ return __atomic_load_n(ptr, __ATOMIC_ACQUIRE); ++} ++ ++inline Atomic32 Release_Load(volatile const Atomic32* ptr) { ++ return __atomic_load_n(ptr, __ATOMIC_RELEASE); ++} ++ ++#ifdef __LP64__ ++ ++inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) { ++ __atomic_store_n(ptr, value, __ATOMIC_RELEASE); ++} ++ ++inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) { ++ return __atomic_load_n(ptr, __ATOMIC_ACQUIRE); ++} ++ ++inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr, ++ Atomic64 old_value, ++ Atomic64 new_value) { ++ __atomic_compare_exchange_n(ptr, &old_value, new_value, true, ++ __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE); ++ return old_value; ++} ++ ++inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, ++ Atomic64 old_value, ++ Atomic64 new_value) { ++ __atomic_compare_exchange_n(ptr, &old_value, new_value, true, ++ __ATOMIC_RELAXED, __ATOMIC_RELAXED); ++ return old_value; ++} ++ ++#endif // defined(__LP64__) ++ ++} // namespace internal ++} // namespace protobuf ++} // namespace google ++ ++#endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_GENERIC_GCC_H_ +diff --git a/src/google/protobuf/stubs/platform_macros.h b/src/google/protobuf/stubs/platform_macros.h +index b1df60e..db691d8 100644 +--- a/src/google/protobuf/stubs/platform_macros.h ++++ b/src/google/protobuf/stubs/platform_macros.h +@@ -43,6 +43,9 @@ + #elif defined(_M_IX86) || defined(__i386__) + #define GOOGLE_PROTOBUF_ARCH_IA32 1 + #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 ++#elif defined(__aarch64__) ++#define GOOGLE_PROTOBUF_ARCH_AARCH64 1 ++#define GOOGLE_PROTOBUF_ARCH_64_BIT 1 + #elif defined(__QNX__) + #define GOOGLE_PROTOBUF_ARCH_ARM_QNX 1 + #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 +@@ -54,9 +57,18 @@ + #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 + #elif defined(__pnacl__) + #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 +-#elif defined(__ppc__) ++#elif defined(__ppc64__) || defined(__PPC64__) ++#define GOOGLE_PROTOBUF_ARCH_PPC64 1 ++#define GOOGLE_PROTOBUF_ARCH_64_BIT 1 ++#elif defined(__ppc__) || defined(__PPC__) + #define GOOGLE_PROTOBUF_ARCH_PPC 1 + #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 ++#elif defined(__s390x__) ++#define GOOGLE_PROTOBUF_ARCH_64_BIT 1 ++#define GOOGLE_PROTOBUF_ARCH_S390X 1 ++#elif defined(__s390__) ++#define GOOGLE_PROTOBUF_ARCH_32_BIT 1 ++#define GOOGLE_PROTOBUF_ARCH_S390 1 + #else + #error Host architecture was not detected as supported by protobuf + #endif +-- +1.8.1.4 + diff --git a/ftdetect-proto.vim b/ftdetect-proto.vim new file mode 100644 index 0000000000000000000000000000000000000000..e9b063e8a9504dccda06427210f8848ef819a480 --- /dev/null +++ b/ftdetect-proto.vim @@ -0,0 +1,4 @@ +augroup filetype + au! BufRead,BufNewFile *.proto setfiletype proto +augroup end + diff --git a/protobuf-2.5.0-gtest.patch b/protobuf-2.5.0-gtest.patch new file mode 100644 index 0000000000000000000000000000000000000000..7584d401034708b02bfbecb42ad664fe43700d5a --- /dev/null +++ b/protobuf-2.5.0-gtest.patch @@ -0,0 +1,215 @@ +--- protobuf-2.5.0/autogen.sh.orig 2013-02-26 09:56:44.000000000 -0800 ++++ protobuf-2.5.0/autogen.sh 2013-03-09 19:21:52.512010330 -0800 +@@ -1,41 +1,24 @@ + #!/bin/sh + + # Run this script to generate the configure script and other files that will + # be included in the distribution. These files are not checked in because they + # are automatically generated. + + set -e + + # Check that we're being run from the right directory. + if test ! -f src/google/protobuf/stubs/common.h; then + cat >&2 << __EOF__ + Could not find source code. Make sure you are running this script from the + root of the distribution tree. + __EOF__ + exit 1 + fi + +-# Check that gtest is present. Usually it is already there since the +-# directory is set up as an SVN external. +-if test ! -e gtest; then +- echo "Google Test not present. Fetching gtest-1.5.0 from the web..." +- curl http://googletest.googlecode.com/files/gtest-1.5.0.tar.bz2 | tar jx +- mv gtest-1.5.0 gtest +-fi +- + set -ex + +-# Temporary hack: Must change C runtime library to "multi-threaded DLL", +-# otherwise it will be set to "multi-threaded static" when MSVC upgrades +-# the project file to MSVC 2005/2008. vladl of Google Test says gtest will +-# probably change their default to match, then this will be unnecessary. +-# One of these mappings converts the debug configuration and the other +-# converts the release configuration. I don't know which is which. +-sed -i -e 's/RuntimeLibrary="5"/RuntimeLibrary="3"/g; +- s/RuntimeLibrary="4"/RuntimeLibrary="2"/g;' gtest/msvc/*.vcproj +- + # TODO(kenton): Remove the ",no-obsolete" part and fix the resulting warnings. + autoreconf -f -i -Wall,no-obsolete + + rm -rf autom4te.cache config.h.in~ + exit 0 +--- protobuf-2.5.0/Makefile.am.orig 2013-02-26 09:56:44.000000000 -0800 ++++ protobuf-2.5.0/Makefile.am 2013-03-09 19:22:18.741692020 -0800 +@@ -1,54 +1,33 @@ + ## Process this file with automake to produce Makefile.in + + ACLOCAL_AMFLAGS = -I m4 + + AUTOMAKE_OPTIONS = foreign + + # Build . before src so that our all-local and clean-local hooks kicks in at + # the right time. + SUBDIRS = . src + + # Always include gtest in distributions. + DIST_SUBDIRS = $(subdirs) src + +-# Build gtest before we build protobuf tests. We don't add gtest to SUBDIRS +-# because then "make check" would also build and run all of gtest's own tests, +-# which takes a lot of time and is generally not useful to us. Also, we don't +-# want "make install" to recurse into gtest since we don't want to overwrite +-# the installed version of gtest if there is one. +-check-local: +- @echo "Making lib/libgtest.a lib/libgtest_main.a in gtest" +- @cd gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la +- +-# We would like to clean gtest when "make clean" is invoked. But we have to +-# be careful because clean-local is also invoked during "make distclean", but +-# "make distclean" already recurses into gtest because it's listed among the +-# DIST_SUBDIRS. distclean will delete gtest/Makefile, so if we then try to +-# cd to the directory again and "make clean" it will fail. So, check that the +-# Makefile exists before recursing. +-clean-local: +- @if test -e gtest/Makefile; then \ +- echo "Making clean in gtest"; \ +- cd gtest && $(MAKE) $(AM_MAKEFLAGS) clean; \ +- fi +- + pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = protobuf.pc protobuf-lite.pc + + EXTRA_DIST = \ + autogen.sh \ + generate_descriptor_proto.sh \ + README.txt \ + INSTALL.txt \ + COPYING.txt \ + CONTRIBUTORS.txt \ + CHANGES.txt \ + editors/README.txt \ + editors/proto.vim \ + editors/protobuf-mode.el \ + vsprojects/config.h \ + vsprojects/extract_includes.bat \ + vsprojects/libprotobuf.vcproj \ + vsprojects/libprotobuf-lite.vcproj \ + vsprojects/libprotoc.vcproj \ + vsprojects/protobuf.sln \ +--- protobuf-2.5.0/src/Makefile.am.orig 2013-02-26 09:56:43.000000000 -0800 ++++ protobuf-2.5.0/src/Makefile.am 2013-03-09 19:25:09.076620571 -0800 +@@ -286,44 +286,42 @@ + # building out-of-tree. + unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs) + oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/protoc$(EXEEXT) -I. --cpp_out=$$oldpwd $(protoc_inputs) ) + touch unittest_proto_middleman + + endif + + $(protoc_outputs): unittest_proto_middleman + + COMMON_TEST_SOURCES = \ + google/protobuf/test_util.cc \ + google/protobuf/test_util.h \ + google/protobuf/testing/googletest.cc \ + google/protobuf/testing/googletest.h \ + google/protobuf/testing/file.cc \ + google/protobuf/testing/file.h + + check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \ + protobuf-lite-test test_plugin $(GZCHECKPROGRAMS) + protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \ +- $(top_builddir)/gtest/lib/libgtest.la \ +- $(top_builddir)/gtest/lib/libgtest_main.la ++ -lgtest -lgtest_main +-protobuf_test_CPPFLAGS = -I$(top_srcdir)/gtest/include \ +- -I$(top_builddir)/gtest/include ++protobuf_test_CPPFLAGS = + # Disable optimization for tests unless the user explicitly asked for it, + # since test_util.cc takes forever to compile with optimization (with GCC). + # See configure.ac for more info. + protobuf_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) + protobuf_test_SOURCES = \ + google/protobuf/stubs/common_unittest.cc \ + google/protobuf/stubs/once_unittest.cc \ + google/protobuf/stubs/strutil_unittest.cc \ + google/protobuf/stubs/structurally_valid_unittest.cc \ + google/protobuf/stubs/stringprintf_unittest.cc \ + google/protobuf/stubs/template_util_unittest.cc \ + google/protobuf/stubs/type_traits_unittest.cc \ + google/protobuf/descriptor_database_unittest.cc \ + google/protobuf/descriptor_unittest.cc \ + google/protobuf/dynamic_message_unittest.cc \ + google/protobuf/extension_set_unittest.cc \ + google/protobuf/generated_message_reflection_unittest.cc \ + google/protobuf/message_unittest.cc \ + google/protobuf/reflection_ops_unittest.cc \ + google/protobuf/repeated_field_unittest.cc \ +@@ -335,61 +333,58 @@ + google/protobuf/io/printer_unittest.cc \ + google/protobuf/io/tokenizer_unittest.cc \ + google/protobuf/io/zero_copy_stream_unittest.cc \ + google/protobuf/compiler/command_line_interface_unittest.cc \ + google/protobuf/compiler/importer_unittest.cc \ + google/protobuf/compiler/mock_code_generator.cc \ + google/protobuf/compiler/mock_code_generator.h \ + google/protobuf/compiler/parser_unittest.cc \ + google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc \ + google/protobuf/compiler/cpp/cpp_unittest.h \ + google/protobuf/compiler/cpp/cpp_unittest.cc \ + google/protobuf/compiler/cpp/cpp_plugin_unittest.cc \ + google/protobuf/compiler/java/java_plugin_unittest.cc \ + google/protobuf/compiler/java/java_doc_comment_unittest.cc \ + google/protobuf/compiler/python/python_plugin_unittest.cc \ + $(COMMON_TEST_SOURCES) + nodist_protobuf_test_SOURCES = $(protoc_outputs) + + # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined. + protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \ +- $(top_builddir)/gtest/lib/libgtest.la \ +- $(top_builddir)/gtest/lib/libgtest_main.la ++ -lgtest -lgtest_main +-protobuf_lazy_descriptor_test_CPPFLAGS = -I$(top_srcdir)/gtest/include \ +- -I$(top_builddir)/gtest/include \ +- -DPROTOBUF_TEST_NO_DESCRIPTORS ++protobuf_lazy_descriptor_test_CPPFLAGS = -DPROTOBUF_TEST_NO_DESCRIPTORS + protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) + protobuf_lazy_descriptor_test_SOURCES = \ + google/protobuf/compiler/cpp/cpp_unittest.cc \ + $(COMMON_TEST_SOURCES) + nodist_protobuf_lazy_descriptor_test_SOURCES = $(protoc_outputs) + + # Build lite_unittest separately, since it doesn't use gtest. + protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la + protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) + protobuf_lite_test_SOURCES = \ + google/protobuf/lite_unittest.cc \ + google/protobuf/test_util_lite.cc \ + google/protobuf/test_util_lite.h + nodist_protobuf_lite_test_SOURCES = $(protoc_lite_outputs) + + # Test plugin binary. + test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \ +- $(top_builddir)/gtest/lib/libgtest.la ++ -lgtest + test_plugin_CPPFLAGS = -I$(top_srcdir)/gtest/include \ + -I$(top_builddir)/gtest/include + test_plugin_SOURCES = \ + google/protobuf/compiler/mock_code_generator.cc \ + google/protobuf/testing/file.cc \ + google/protobuf/testing/file.h \ + google/protobuf/compiler/test_plugin.cc + + if HAVE_ZLIB + zcgzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la + zcgzip_SOURCES = google/protobuf/testing/zcgzip.cc + + zcgunzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la + zcgunzip_SOURCES = google/protobuf/testing/zcgunzip.cc + endif + + TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \ + google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS) diff --git a/protobuf-2.5.0-java-fixes.patch b/protobuf-2.5.0-java-fixes.patch new file mode 100644 index 0000000000000000000000000000000000000000..99526273a6e457bfba2533ef7faf11600fedca8b --- /dev/null +++ b/protobuf-2.5.0-java-fixes.patch @@ -0,0 +1,201 @@ +--- protobuf-2.5.0/java/pom.xml.orig 2013-02-26 09:58:21.000000000 -0800 ++++ protobuf-2.5.0/java/pom.xml 2013-03-09 19:16:29.581904896 -0800 +@@ -1,152 +1,79 @@ + + + 4.0.0 +- +- com.google +- google +- 1 +- + com.google.protobuf + protobuf-java + 2.5.0 + bundle + Protocol Buffer Java API + + Protocol Buffers are a way of encoding structured data in an efficient yet + extensible format. + + 2008 + http://code.google.com/p/protobuf + + + New BSD license + http://www.opensource.org/licenses/bsd-license.php + repo + + + + http://code.google.com/p/protobuf/source/browse + + scm:svn:http://protobuf.googlecode.com/svn/trunk/ + + +- +- +- junit +- junit +- 4.4 +- test +- +- +- org.easymock +- easymock +- 2.2 +- test +- +- +- org.easymock +- easymockclassextension +- 2.2.1 +- test +- +- + + + + maven-compiler-plugin + + 1.5 + 1.5 + + + +- maven-surefire-plugin +- +- +- **/*Test.java +- +- +- +- + maven-antrun-plugin + + + generate-sources + generate-sources + + + + + + + + + + target/generated-sources + + + run + + +- +- generate-test-sources +- generate-test-sources +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- target/generated-test-sources +- +- +- run +- +- + + + + org.apache.felix + maven-bundle-plugin + true + + + * + + + + + + + + lite + + + +@@ -161,45 +88,33 @@ + **/FieldSet.java + **/GeneratedMessageLite.java + **/Internal.java + **/InvalidProtocolBufferException.java + **/LazyStringArrayList.java + **/LazyStringList.java + **/MessageLite.java + **/MessageLiteOrBuilder.java + **/SmallSortedMap.java + **/UninitializedMessageException.java + **/UnmodifiableLazyStringList.java + **/WireFormat.java + **/Parser.java + **/AbstractParser.java + **/BoundedByteString.java + **/LiteralByteString.java + **/RopeByteString.java + **/Utf8.java + **/LazyField.java + +- +- **/LiteTest.java +- **/*Lite.java +- +- +- +- +- maven-surefire-plugin +- +- +- **/LiteTest.java +- + + + + maven-jar-plugin + + lite + + + + + + + diff --git a/protobuf-2.5.0-makefile.patch b/protobuf-2.5.0-makefile.patch new file mode 100644 index 0000000000000000000000000000000000000000..626ad1ecad892b7d04f373d7aa25d2df567cbbdd --- /dev/null +++ b/protobuf-2.5.0-makefile.patch @@ -0,0 +1,30 @@ +diff -up protobuf-2.5.0/src/Makefile.am.generic protobuf-2.5.0/src/Makefile.am +--- protobuf-2.5.0/src/Makefile.am.generic 2013-05-16 10:25:07.000000000 +0200 ++++ protobuf-2.5.0/src/Makefile.am 2013-05-16 10:26:15.000000000 +0200 +@@ -42,6 +42,7 @@ nobase_include_HEADERS = + google/protobuf/stubs/atomicops_internals_arm_gcc.h \ + google/protobuf/stubs/atomicops_internals_arm_qnx.h \ + google/protobuf/stubs/atomicops_internals_atomicword_compat.h \ ++ google/protobuf/stubs/atomicops_internals_generic_gcc.h \ + google/protobuf/stubs/atomicops_internals_macosx.h \ + google/protobuf/stubs/atomicops_internals_mips_gcc.h \ + google/protobuf/stubs/atomicops_internals_pnacl.h \ +diff -up protobuf-2.5.0/src/Makefile.in.generic protobuf-2.5.0/src/Makefile.in +--- protobuf-2.5.0/src/Makefile.in.generic 2013-05-16 10:25:14.000000000 +0200 ++++ protobuf-2.5.0/src/Makefile.in 2013-05-16 10:27:00.000000000 +0200 +@@ -309,6 +309,7 @@ am__nobase_include_HEADERS_DIST = google + google/protobuf/stubs/atomicops_internals_arm_gcc.h \ + google/protobuf/stubs/atomicops_internals_arm_qnx.h \ + google/protobuf/stubs/atomicops_internals_atomicword_compat.h \ ++ google/protobuf/stubs/atomicops_internals_generic_gcc.h \ + google/protobuf/stubs/atomicops_internals_macosx.h \ + google/protobuf/stubs/atomicops_internals_mips_gcc.h \ + google/protobuf/stubs/atomicops_internals_pnacl.h \ +@@ -518,6 +519,7 @@ nobase_include_HEADERS = \ + google/protobuf/stubs/atomicops_internals_arm_gcc.h \ + google/protobuf/stubs/atomicops_internals_arm_qnx.h \ + google/protobuf/stubs/atomicops_internals_atomicword_compat.h \ ++ google/protobuf/stubs/atomicops_internals_generic_gcc.h \ + google/protobuf/stubs/atomicops_internals_macosx.h \ + google/protobuf/stubs/atomicops_internals_mips_gcc.h \ + google/protobuf/stubs/atomicops_internals_pnacl.h \ diff --git a/protobuf-2.5.0.tar.bz2 b/protobuf-2.5.0.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..07ab319e6f64ced8cbb0975efc37e032cdc0bd2d Binary files /dev/null and b/protobuf-2.5.0.tar.bz2 differ diff --git a/protobuf-init.el b/protobuf-init.el new file mode 100644 index 0000000000000000000000000000000000000000..008bdeffc15187dada0840c7abcff26c9c0657fd --- /dev/null +++ b/protobuf-init.el @@ -0,0 +1,6 @@ +; Protobuf major mode, init file by Tim Niemueller [www.niemueller.de], BSD +; Add mode to automatically recognized modes +(setq auto-mode-alist (cons '("\\.proto$" . protobuf-mode) auto-mode-alist)) +(autoload 'protobuf-mode "protobuf-mode" "Google protobuf editing mode." t) +; Turn on colorization by default +(add-hook 'protobuf-mode-hook 'turn-on-font-lock) diff --git a/protobuf2.spec b/protobuf2.spec new file mode 100644 index 0000000000000000000000000000000000000000..db646cefbfbe3aaf5f5b3cb28fd23dc3b6f29f00 --- /dev/null +++ b/protobuf2.spec @@ -0,0 +1,245 @@ +%bcond_without java +%bcond_with gtest +%global emacs_version %(pkg-config emacs --modversion) +%global emacs_lispdir %(pkg-config emacs --variable sitepkglispdir) +%global emacs_startdir %(pkg-config emacs --variable sitestartdir) +Summary: Protocol Buffers - Google's data interchange format +Name: protobuf2 +Version: 2.5.0 +Release: 1 +License: BSD +Source: http://protobuf.googlecode.com/files/protobuf-%{version}.tar.bz2 +Source1: ftdetect-proto.vim +Source2: protobuf-init.el +Patch1: protobuf-2.5.0-gtest.patch +Patch2: protobuf-2.5.0-java-fixes.patch +Patch3: 0001-Add-generic-GCC-support-for-atomic-operations.patch +Patch4: protobuf-2.5.0-makefile.patch +URL: http://code.google.com/p/protobuf/ +BuildRequires: automake autoconf libtool pkgconfig zlib-devel emacs emacs-el >= 24.1 maven-plugin-bundle +%if %{with gtest} +BuildRequires: gtest-devel +%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. +Protocol buffers are a flexible, efficient, automated mechanism for +serializing structured data – think XML, but smaller, faster, and +simpler. You define how you want your data to be structured once, then +you can use special generated source code to easily write and read +your structured data to and from a variety of data streams and using a +variety of languages. You can even update your data structure without +breaking deployed programs that are compiled against the "old" format. + +%package compiler +Summary: Protocol Buffers compiler +Requires: %{name} = %{version}-%{release} +%description compiler +This package contains Protocol Buffers compiler for all programming +languages + +%package devel +Summary: Protocol Buffers C++ headers and libraries +Requires: %{name} = %{version}-%{release} %{name}-compiler = %{version}-%{release} +Requires: zlib-devel pkgconfig +%description devel +This package contains Protocol Buffers compiler for all languages and +C++ headers and libraries + +%package static +Summary: Static development files for %{name} +Requires: %{name} = %{version}-%{release} +%description static +Static libraries for Protocol Buffers + +%package lite +Summary: Protocol Buffers LITE_RUNTIME libraries +%description 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 lite-devel +Summary: Protocol Buffers LITE_RUNTIME development libraries +Requires: %{name}-devel = %{version}-%{release} %{name}-lite = %{version}-%{release} +%description 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 lite-static +Summary: Static development files for %{name}-lite +Requires: %{name}-devel = %{version}-%{release} +%description lite-static +This package contains static 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 vim +Summary: Vim syntax highlighting for Google Protocol Buffers descriptions +Requires: vim-enhanced +%description vim +This package contains syntax highlighting for Google Protocol Buffers +descriptions in Vim editor + +%package emacs +Summary: Emacs mode for Google Protocol Buffers descriptions +Requires: emacs >= 0%{emacs_version} +%description emacs +This package contains syntax highlighting for Google Protocol Buffers +descriptions in the Emacs editor. + +%package emacs-el +Summary: Elisp source files for Google protobuf Emacs mode +Requires: protobuf-emacs = %{version} +%description emacs-el +This package contains the elisp source files for %{name}-emacs +under GNU Emacs. You do not need to install this package to use +%{name}-emacs. +%if %{with java} + +%package java +Summary: Java Protocol Buffers runtime library +BuildRequires: java-devel >= 1.6 jpackage-utils maven-local maven-compiler-plugin +BuildRequires: maven-install-plugin maven-jar-plugin maven-javadoc-plugin +BuildRequires: maven-resources-plugin maven-surefire-plugin maven-antrun-plugin +Conflicts: %{name}-compiler > %{version} +Conflicts: %{name}-compiler < %{version} +%description java +This package contains Java Protocol Buffers runtime library. + +%package javadoc +Summary: Javadocs for %{name}-java +Requires: %{name}-java = %{version}-%{release} +%description javadoc +This package contains the API documentation for %{name}-java. +%endif + +%prep +%setup -q -n protobuf-2.5.0 +%if %{with gtest} +rm -rf gtest +%patch1 -p1 -b .gtest +%endif +chmod 644 examples/* +%if %{with java} +%patch2 -p1 -b .java-fixes +rm -rf java/src/test +%endif +%patch3 -p1 -b .generic-atomics +%patch4 -p1 -b .generic-atomics-makefile + +%build +iconv -f iso8859-1 -t utf-8 CONTRIBUTORS.txt > CONTRIBUTORS.txt.utf8 +mv CONTRIBUTORS.txt.utf8 CONTRIBUTORS.txt +export PTHREAD_LIBS="-lpthread" +./autogen.sh +%configure +make %{?_smp_mflags} +%if %{with java} +pushd java +%mvn_file : %{name} +%mvn_build +popd +%endif +emacs -batch -f batch-byte-compile editors/protobuf-mode.el + +%check + +%install +rm -rf %{buildroot} +make %{?_smp_mflags} install DESTDIR=%{buildroot} STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p" +find %{buildroot} -type f -name "*.la" -exec rm -f {} \; +install -p -m 644 -D %{SOURCE1} %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/proto.vim +install -p -m 644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/proto.vim +%if %{with java} +pushd java +%mvn_install +popd +%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} + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%post lite -p /sbin/ldconfig + +%postun lite -p /sbin/ldconfig + +%post compiler -p /sbin/ldconfig + +%postun compiler -p /sbin/ldconfig + +%files +%defattr(-, root, root, -) +%{_libdir}/libprotobuf.so.* +%doc CHANGES.txt CONTRIBUTORS.txt COPYING.txt README.txt + +%files compiler +%defattr(-, root, root, -) +%{_bindir}/protoc +%{_libdir}/libprotoc.so.* +%doc COPYING.txt README.txt + +%files devel +%defattr(-, root, root, -) +%dir %{_includedir}/google +%{_includedir}/google/protobuf/ +%{_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.txt + +%files static +%defattr(-, root, root, -) +%{_libdir}/libprotobuf.a +%{_libdir}/libprotoc.a + +%files lite +%defattr(-, root, root, -) +%{_libdir}/libprotobuf-lite.so.* + +%files lite-devel +%defattr(-, root, root, -) +%{_libdir}/libprotobuf-lite.so +%{_libdir}/pkgconfig/protobuf-lite.pc + +%files lite-static +%defattr(-, root, root, -) +%{_libdir}/libprotobuf-lite.a + +%files vim +%defattr(-, root, root, -) +%{_datadir}/vim/vimfiles/ftdetect/proto.vim +%{_datadir}/vim/vimfiles/syntax/proto.vim + +%files emacs +%defattr(-,root,root,-) +%{emacs_startdir}/protobuf-init.el +%{emacs_lispdir}/protobuf-mode.elc + +%files emacs-el +%defattr(-,root,root,-) +%{emacs_lispdir}/protobuf-mode.el +%if %{with java} + +%files java -f java/.mfiles +%doc examples/AddPerson.java examples/ListPeople.java + +%files javadoc -f java/.mfiles-javadoc +%endif + +%changelog +* Fri Feb 26 2021 Ge Wang - 2.5.0-1 +- Package init diff --git a/protobuf2.yaml b/protobuf2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c651911c56ccada49514d416e1c41d268dc3695c --- /dev/null +++ b/protobuf2.yaml @@ -0,0 +1,4 @@ +version_control: NA +src_repo: NA +tag_prefix: NA +separator: NA