Sophie

Sophie

distrib > Mageia > 5 > x86_64 > by-pkgid > b02a68f114011d84d9fbeced280f85d4 > files > 10

bookkeeper-4.2.1-13.mga5.src.rpm

%global _hardened_build 1

%define hedwig_major 0
%define libhedwig %mklibname hedwig %{hedwig_major}
%define libhedwig_devel %mklibname hedwig -d

Name:          bookkeeper
Version:       4.2.1
Release:       %mkrel 13
Summary:       Apache BookKeeper sub-project of ZooKeeper
Group:         Development/Java
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@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@gmail.com
# Fix build with boost >= 1.40.0
Patch3:        bookkeeper-4.2.1-boost153.patch
Patch4:        bookkeeper-4.2.1-jline2.patch
Patch5:        bookkeeper-4.2.1-netty.patch
Patch6:        bookkeeper-4.2.1-guava-17.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: netty3
BuildRequires: protobuf-java
BuildRequires: log4j12
BuildRequires: slf4j
BuildRequires: slf4j-log4j12
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


%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
Summary:       Hedwig C client library

%description  -n %libhedwig
This package provides a C client interface to Hedwig server.

%package -n %libhedwig_devel
Summary:       Development files for the Hedwig C client library
Requires:      %libhedwig = %{version}-%{release}

%description  -n %libhedwig_devel
Development files for the Hedwig C client library.

%package java
Summary:       BookKeeper/Hedwig Java libraries
BuildArch:     noarch

%description java
This package contains BookKeeper/Hedwig Java libraries.

%package javadoc
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
%patch3 -p0
%patch4 -p1
%patch5 -p1
%patch6 -p1

%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

# update log4j dependencies to use log412 compat package
sed -i 's|1.2.15|1.2.17|' `find . | grep pom`

%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_build -f -- -Dmaven.local.depmap.file="%{SOURCE1}"

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 {} ';'

%mvn_install

%files -n %libhedwig
%{_libdir}/libhedwig*.so.%{hedwig_major}*
%doc LICENSE NOTICE

%files -n %libhedwig_devel
%{_includedir}/hedwig-*/
%{_libdir}/libhedwig*.so
%{_libdir}/pkgconfig/hedwig-*.pc
%doc LICENSE NOTICE

%files java -f .mfiles
%dir %{_javadir}/%{name}
%doc CHANGES.txt LICENSE NOTICE README

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



%changelog
* Sun Dec 28 2014 dmorgan <dmorgan> 4.2.1-13.mga5
+ Revision: 807008
- Fix Requires

* Sun Dec 28 2014 dmorgan <dmorgan> 4.2.1-12.mga5
+ Revision: 806989
- Clean spec file
- imported package bookkeeper


* Mon Feb 24 2014 Timothy St. Clair <tstclair@redhat.com> - 4.2.1-7
- Update due to cascading dependencies around java-headless

* Fri Jan 24 2014 Timothy St. Clair<tstclair@redhat.com> - 4.2.1-6
- Update jline dependency to 2.10 and netty3

* Tue Jul 30 2013 Petr Machata <pmachata@redhat.com> - 4.2.1-5
- Rebuild for boost 1.54.0

* Sat Jul 27 2013 gil cattaneo <puntogil@libero.it> 4.2.1-4
- fix changelog entries

* Sat Jun 29 2013 gil cattaneo <puntogil@libero.it> 4.2.1-3
- switch to XMvn, minor changes to adapt to current guideline

* Fri Jun 21 2013 gil cattaneo <puntogil@libero.it> 4.2.1-2
- fix unowned directories

* Thu Apr 04 2013 gil cattaneo <puntogil@libero.it> 4.2.1-1
- initial rpm