[bookkeeper] Initial import (#948589).

gil gil at fedoraproject.org
Wed Jun 12 17:27:13 UTC 2013


commit b464d7221931539a5d9ca4f1285a1cb3751664ad
Author: gil <puntogil at libero.it>
Date:   Wed Jun 12 19:26:55 2013 +0200

    Initial import (#948589).

 .gitignore                                    |    1 +
 BOOKKEEPER-598.patch                          |   22 +++
 bookkeeper-4.2.1-boost153.patch               |   35 ++++
 bookkeeper-4.2.1-depmap                       |   14 ++
 bookkeeper-4.2.1-lib-add-PIE-and-RELRO.patch  |   14 ++
 bookkeeper-4.2.1-test-add-PIE-and-RELRO.patch |   16 ++
 bookkeeper.spec                               |  239 +++++++++++++++++++++++++
 sources                                       |    1 +
 8 files changed, 342 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..aa965bd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/bookkeeper-4.2.1-src-svn.tar.gz
diff --git a/BOOKKEEPER-598.patch b/BOOKKEEPER-598.patch
new file mode 100644
index 0000000..996c45f
--- /dev/null
+++ b/BOOKKEEPER-598.patch
@@ -0,0 +1,22 @@
+Index: hedwig-client/src/main/cpp/lib/subscriberimpl.cpp
+===================================================================
+--- hedwig-client/src/main/cpp/lib/subscriberimpl.cpp	(revision 1464565)
++++ hedwig-client/src/main/cpp/lib/subscriberimpl.cpp	(working copy)
+@@ -39,7 +39,7 @@
+ const bool DEFAULT_SUBSCRIBER_AUTOCONSUME = true;
+ const int DEFAULT_SUBSCRIPTION_MESSAGE_BOUND = 0;
+ 
+-static const std::type_info& RESUBSCRIBE_EXCEPTION = typeid(ResubscribeException());
++static const std::type_info& RESUBSCRIBE_EXCEPTION_TYPEID = typeid(ResubscribeException());
+ 
+ ConsumeWriteCallback::ConsumeWriteCallback(const ActiveSubscriberPtr& activeSubscriber,
+                                            const PubSubDataPtr& data,
+@@ -147,7 +147,7 @@
+ }
+ 
+ void ResubscribeCallback::operationFailed(const std::exception& exception) {
+-  if (RESUBSCRIBE_EXCEPTION == typeid(exception)) {
++  if (RESUBSCRIBE_EXCEPTION_TYPEID == typeid(exception)) {
+     // it might be caused by closesub when resubscribing.
+     // so we don't need to retry resubscribe again
+     LOG4CXX_WARN(logger, "Failed to resubscribe " << *activeSubscriber
diff --git a/bookkeeper-4.2.1-boost153.patch b/bookkeeper-4.2.1-boost153.patch
new file mode 100644
index 0000000..0d104d1
--- /dev/null
+++ b/bookkeeper-4.2.1-boost153.patch
@@ -0,0 +1,35 @@
+Index: bookkeeper-4.2.1/hedwig-client/src/main/cpp/lib/channel.cpp
+===================================================================
+--- hedwig-client/src/main/cpp/lib/channel.cpp
++++ hedwig-client/src/main/cpp/lib/channel.cpp
+@@ -702,7 +702,7 @@ void AsioSSLDuplexChannel::sslChannelCon
+ void AsioSSLDuplexChannel::startHandShake(const OperationCallbackPtr& callback) {
+   ssl_socket->async_handshake(boost::asio::ssl::stream_base::client,
+                               boost::bind(&AsioSSLDuplexChannel::handleHandshake,
+-                                          boost::shared_dynamic_cast<AsioSSLDuplexChannel>(shared_from_this()),
++                                          boost::dynamic_pointer_cast<AsioSSLDuplexChannel>(shared_from_this()),
+                                           callback, boost::asio::placeholders::error));
+ }
+ 
+@@ -749,7 +749,7 @@ void AsioSSLDuplexChannel::readMsgBody(b
+ // boost asio doesn't provide time out mechanism to shutdown ssl
+ void AsioSSLDuplexChannel::sslShutdown() {
+   ssl_socket->async_shutdown(boost::bind(&AsioSSLDuplexChannel::handleSSLShutdown,
+-                                         boost::shared_dynamic_cast<AsioSSLDuplexChannel>(shared_from_this()),
++                                         boost::dynamic_pointer_cast<AsioSSLDuplexChannel>(shared_from_this()),
+                                          boost::asio::placeholders::error));
+ }
+ 
+Index: bookkeeper-4.2.1/hedwig-client/src/main/cpp/lib/data.h
+===================================================================
+--- hedwig-client/src/main/cpp/lib/data.h
++++ hedwig-client/src/main/cpp/lib/data.h
+@@ -33,7 +33,7 @@
+ 
+ #include "util.h"
+ #include <boost/shared_ptr.hpp>
+-#include <boost/thread/mutex.hpp>
++#include <boost/thread/thread.hpp>	// needed for boost::thread and boost::mutex
+ 
+ namespace Hedwig {
+   /**
diff --git a/bookkeeper-4.2.1-depmap b/bookkeeper-4.2.1-depmap
new file mode 100644
index 0000000..d737c52
--- /dev/null
+++ b/bookkeeper-4.2.1-depmap
@@ -0,0 +1,14 @@
+<dependencies>
+<dependency>
+    <maven>
+        <groupId>jline</groupId>
+        <artifactId>jline</artifactId>
+        <version>0.9.94</version>
+    </maven>
+    <jpp>
+        <groupId>JPP</groupId>
+        <artifactId>jline</artifactId>
+        <version>1.0</version>
+    </jpp>
+</dependency>
+</dependencies>
\ No newline at end of file
diff --git a/bookkeeper-4.2.1-lib-add-PIE-and-RELRO.patch b/bookkeeper-4.2.1-lib-add-PIE-and-RELRO.patch
new file mode 100644
index 0000000..5f0ff67
--- /dev/null
+++ b/bookkeeper-4.2.1-lib-add-PIE-and-RELRO.patch
@@ -0,0 +1,14 @@
+--- hedwig-client/src/main/cpp/lib/Makefile.am	2012-11-02 21:47:32.000000000 +0100
++++ hedwig-client/src/main/cpp/lib/Makefile.am-gil	2013-06-11 18:32:22.177362719 +0200
+@@ -20,9 +20,9 @@
+ 
+ lib_LTLIBRARIES = libhedwig01.la
+ libhedwig01_la_SOURCES = protocol.cpp channel.cpp client.cpp util.cpp clientimpl.cpp publisherimpl.cpp subscriberimpl.cpp eventdispatcher.cpp data.cpp filterablemessagehandler.cpp simplesubscriberimpl.cpp multiplexsubscriberimpl.cpp
+-libhedwig01_la_CPPFLAGS = -I$(top_srcdir)/inc $(DEPS_CFLAGS)
++libhedwig01_la_CPPFLAGS = -I$(top_srcdir)/inc $(DEPS_CFLAGS) -fPIE
+ libhedwig01_la_LIBADD = $(DEPS_LIBS) $(BOOST_CPPFLAGS) 
+-libhedwig01_la_LDFLAGS = -no-undefined $(BOOST_ASIO_LIB) $(BOOST_LDFLAGS) $(BOOST_THREAD_LIB)
++libhedwig01_la_LDFLAGS = -no-undefined $(BOOST_ASIO_LIB) $(BOOST_LDFLAGS) $(BOOST_THREAD_LIB) -pie -Wl,-z,relro -Wl,-z,now
+ 
+ protocol.cpp: $(PROTODEF)
+ 	protoc --cpp_out=. -I`dirname $(PROTODEF)` $(PROTODEF)
diff --git a/bookkeeper-4.2.1-test-add-PIE-and-RELRO.patch b/bookkeeper-4.2.1-test-add-PIE-and-RELRO.patch
new file mode 100644
index 0000000..b37b713
--- /dev/null
+++ b/bookkeeper-4.2.1-test-add-PIE-and-RELRO.patch
@@ -0,0 +1,16 @@
+--- hedwig-client/src/main/cpp/test/Makefile.am	2012-11-02 21:47:32.000000000 +0100
++++ hedwig-client/src/main/cpp/test/Makefile.am-gil	2013-06-11 18:33:46.335004441 +0200
+@@ -19,10 +19,10 @@
+ if HAVE_GTEST
+ bin_PROGRAMS = hedwigtest
+ hedwigtest_SOURCES = main.cpp utiltest.cpp publishtest.cpp subscribetest.cpp pubsubtest.cpp messageboundtest.cpp messagefiltertest.cpp throttledeliverytest.cpp multiplextest.cpp
+-hedwigtest_CPPFLAGS = -I$(top_srcdir)/inc $(DEPS_CFLAGS) $(GTEST_CPPFLAGS) $(BOOST_CPPFLAGS)
+-hedwigtest_CXXFLAGS = $(GTEST_CXXFLAGS)
++hedwigtest_CPPFLAGS = -I$(top_srcdir)/inc $(DEPS_CFLAGS) $(GTEST_CPPFLAGS) $(BOOST_CPPFLAGS) -fPIE
++hedwigtest_CXXFLAGS = $(GTEST_CXXFLAGS) -fPIE
+ hedwigtest_LDADD = $(DEPS_LIBS) $(GTEST_LIBS) -L$(top_builddir)/lib -lhedwig01
+-hedwigtest_LDFLAGS = -no-undefined $(BOOST_ASIO_LIB) $(BOOST_LDFLAGS) $(BOOST_THREAD_LIB) $(GTEST_LDFLAGS)
++hedwigtest_LDFLAGS = -no-undefined $(BOOST_ASIO_LIB) $(BOOST_LDFLAGS) $(BOOST_THREAD_LIB) $(GTEST_LDFLAGS) -pie -Wl,-z,relro -Wl,-z,now
+ 
+ check: hedwigtest
+ 	bash ../scripts/tester.sh all
diff --git a/bookkeeper.spec b/bookkeeper.spec
new file mode 100644
index 0000000..dae56fe
--- /dev/null
+++ b/bookkeeper.spec
@@ -0,0 +1,239 @@
+%global _hardened_build 1
+Name:          bookkeeper
+Version:       4.2.1
+Release:       1%{?dist}
+Summary:       Apache BookKeeper sub-project of ZooKeeper
+Group:         Development/Libraries
+License:       ASL 2.0
+URL:           http://zookeeper.apache.org/bookkeeper/
+# svn export http://svn.apache.org/repos/asf/zookeeper/bookkeeper/tags/release-4.2.1/ bookkeeper-4.2.1
+# tar czf bookkeeper-4.2.1-src-svn.tar.gz bookkeeper-4.2.1
+Source0:       %{name}-%{version}-src-svn.tar.gz
+# bookkeeper require jline 0.9.94
+Source1:       %{name}-%{version}-depmap
+# thanks to Matthew Farrellee matt at redhat.com
+# Patch to avoid complication issue w/ RESUBSCRIBE_EXCEPTION
+Patch0:        https://issues.apache.org/jira/secure/attachment/12577006/BOOKKEEPER-598.patch
+Patch1:        bookkeeper-4.2.1-lib-add-PIE-and-RELRO.patch
+Patch2:        bookkeeper-4.2.1-test-add-PIE-and-RELRO.patch
+# thanks to Björn Esser bjoern.esser at gmail.com
+# Fix build with boost >= 1.40.0
+Patch3:        bookkeeper-4.2.1-boost153.patch
+
+BuildRequires: java-devel
+
+BuildRequires: apache-commons-cli
+BuildRequires: apache-commons-collections
+BuildRequires: apache-commons-codec
+BuildRequires: apache-commons-configuration
+BuildRequires: apache-commons-io
+BuildRequires: derby
+BuildRequires: guava
+BuildRequires: jline
+BuildRequires: log4j
+# BuildRequires: mvn(org.apache.hadoop:hadoop-common) >= 0.23.1
+# BuildRequires: mvn(org.apache.hadoop:hadoop-hdfs)
+BuildRequires: netty
+BuildRequires: protobuf-java
+BuildRequires: slf4j
+BuildRequires: zookeeper-java
+
+# bookkeeper-server runtime deps
+BuildRequires: apache-commons-lang
+BuildRequires: apache-commons-logging
+BuildRequires: hawtjni
+BuildRequires: jansi
+BuildRequires: jansi-native
+
+# hedwig-client cpp
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: boost-devel
+BuildRequires: libtool
+BuildRequires: log4cxx-devel
+BuildRequires: openssl-devel
+BuildRequires: protobuf-devel
+
+# test deps
+BuildRequires: junit
+# org.apache.zookeeper:zookeeper test-jar
+
+# BuildRequires: apache-rat-plugin
+BuildRequires: maven-local
+BuildRequires: maven-antrun-plugin
+BuildRequires: maven-assembly-plugin
+BuildRequires: maven-dependency-plugin
+BuildRequires: maven-remote-resources-plugin
+BuildRequires: maven-site-plugin
+BuildRequires: maven-surefire-plugin
+
+
+%description
+The Apache BookKeeper sub-project of ZooKeeper is made up of
+a distributed logging service called BookKeeper and
+a distributed publish/subscribe system built on top of
+BookKeeper called Hedwig.
+
+%package -n libhedwig
+Group:         System Environment/Libraries
+Summary:       Hedwig C client library
+
+%description  -n libhedwig
+This package provides a C client interface to Hedwig server.
+
+%package -n libhedwig-devel
+Group:         Development/Libraries
+Summary:       Development files for the Hedwig C client library
+Requires:      libhedwig%{?_isa} = %{version}-%{release}
+
+%description  -n libhedwig-devel
+Development files for the Hedwig C client library.
+
+%package java
+Group:         Development/Libraries
+Summary:       BookKeeper/Hedwig Java libraries
+Requires:      apache-commons-cli
+Requires:      apache-commons-collections
+Requires:      apache-commons-codec
+Requires:      apache-commons-configuration
+Requires:      apache-commons-io
+Requires:      derby
+Requires:      guava
+Requires:      jline
+Requires:      log4j
+#Requires:      mvn(org.apache.hadoop:hadoop-common) >= 0.23.1
+#Requires:      mvn(org.apache.hadoop:hadoop-hdfs)
+Requires:      netty
+Requires:      protobuf-java
+Requires:      slf4j
+Requires:      zookeeper-java
+Requires:      java
+Requires:      jpackage-utils
+BuildArch:     noarch
+
+%description java
+This package contains BookKeeper/Hedwig Java libraries.
+
+%package javadoc
+Group:         Documentation
+Summary:       Javadoc for %{name}
+BuildArch:     noarch
+
+%description javadoc
+This package contains javadoc for %{name}.
+
+%prep
+%setup -q -n %{name}-%{version}
+%patch0 -p0
+%patch1 -p0
+%patch2 -p0
+%if %{?fedora} > 18
+%patch3 -p0
+%endif
+
+%pom_remove_plugin org.codehaus.mojo:findbugs-maven-plugin
+%pom_remove_plugin org.codehaus.mojo:findbugs-maven-plugin bookkeeper-server
+%pom_remove_plugin org.codehaus.mojo:findbugs-maven-plugin hedwig-protocol
+%pom_remove_plugin org.codehaus.mojo:findbugs-maven-plugin hedwig-server
+
+%pom_remove_plugin org.apache.maven.plugins:maven-pmd-plugin
+# somersaults
+%pom_disable_module compat-deps
+# Requires org.apache.hadoop:hadoop-common hadoop-hdfs >= 0.23.1
+%pom_disable_module bookkeeper-benchmark
+
+%pom_add_dep commons-collections:commons-collections bookkeeper-server
+# Unavailable test deps
+%pom_remove_dep org.apache.bookkeeper:bookkeeper-server-compat400 bookkeeper-server
+%pom_remove_dep org.apache.bookkeeper:bookkeeper-server-compat410 bookkeeper-server
+
+%pom_remove_plugin :maven-assembly-plugin hedwig-server
+%pom_remove_plugin :maven-dependency-plugin hedwig-server
+
+%pom_xpath_remove "pom:project/pom:dependencies/pom:dependency[pom:scope='test']" bookkeeper-server
+%pom_xpath_remove "pom:project/pom:dependencies/pom:dependency[pom:scope='test']" hedwig-client
+%pom_xpath_remove "pom:project/pom:dependencies/pom:dependency[pom:scope='test']" hedwig-protocol
+%pom_xpath_remove "pom:project/pom:dependencies/pom:dependency[pom:scope='test']" hedwig-server
+
+%build
+
+(
+ cd bookkeeper-server/
+ rm -r src/main/java/org/apache/bookkeeper/proto/DataFormats.java
+ protoc --java_out=src/main/java src/main/proto/DataFormats.proto
+)
+(
+ cd hedwig-protocol/
+ rm -r src/main/java/org/apache/hedwig/protocol/PubSubProtocol.java
+ protoc --java_out=src/main/java src/main/protobuf/PubSubProtocol.proto
+)
+# test skipped for unavailable test deps
+mvn-rpmbuild -Dmaven.test.skip=true -Dmaven.local.depmap.file="%{SOURCE1}" package javadoc:aggregate
+
+pushd hedwig-client/src/main/cpp
+rm -rf autom4te.cache
+libtoolize
+autoreconf -fi
+%configure --disable-static --disable-rpath
+# thanks to Björn Esser get rid of unused-shlib-dep
+sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool
+# Remove rpath
+sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+%{__make} %{?_smp_mflags}
+popd
+
+%install
+
+pushd hedwig-client/src/main/cpp
+%{__make} install DESTDIR=%{buildroot}
+popd
+
+find %{buildroot} -name '*.la' -exec rm -f {} ';'
+
+mkdir -p %{buildroot}%{_mavenpomdir}
+install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}.pom
+%add_maven_depmap JPP.%{name}-%{name}.pom
+
+mkdir -p %{buildroot}%{_javadir}/%{name}
+# bookkeeper-benchmark
+for m in hedwig-client \
+     hedwig-server \
+     hedwig-protocol \
+     bookkeeper-server; do
+    install -m 644 ${m}/target/${m}-%{version}.jar %{buildroot}%{_javadir}/%{name}/${m}.jar
+    install -pm 644 ${m}/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-${m}.pom
+%add_maven_depmap JPP.%{name}-${m}.pom %{name}/${m}.jar
+done
+
+mkdir -p %{buildroot}%{_javadocdir}/%{name}
+cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/
+
+%post -n libhedwig -p /sbin/ldconfig
+%postun -n libhedwig -p /sbin/ldconfig
+
+%files -n libhedwig
+%{_libdir}/libhedwig*.so.*
+%doc LICENSE NOTICE
+
+%files -n libhedwig-devel
+%dir %{_includedir}/hedwig-*/hedwig
+%{_includedir}/hedwig-*/hedwig/*.h
+%{_libdir}/libhedwig*.so
+%{_libdir}/pkgconfig/hedwig-*.pc
+%doc LICENSE NOTICE
+
+%files java
+%dir %{_javadir}/%{name}
+%{_javadir}/%{name}/*.jar
+%{_mavenpomdir}/JPP.%{name}-*.pom
+%{_mavendepmapfragdir}/%{name}
+%doc CHANGES.txt LICENSE NOTICE README
+
+%files javadoc
+%{_javadocdir}/%{name}
+%doc LICENSE NOTICE
+
+%changelog
+* Thu Apr 04 2013 gil cattaneo <puntogil at libero.it> 4.2.1-1
+- initial rpm
\ No newline at end of file
diff --git a/sources b/sources
index e69de29..de4331e 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+e45208dda69e97d7165fe67762e5cadf  bookkeeper-4.2.1-src-svn.tar.gz


More information about the scm-commits mailing list