Local WIP update

This commit is contained in:
Timothy St. Clair 2014-10-07 13:40:35 -05:00
parent 7988607f2c
commit c804f9a5aa
2 changed files with 77 additions and 132 deletions

View File

@ -1 +1 @@
971c379ba65714fd25dc5fe8f14e9ad1 zookeeper-3.4.6.tar.gz
623bfbaa0efbd2cc196fe06ea9f85566 zookeeper-3.4.6-601207e.tar.gz

View File

@ -1,3 +1,5 @@
%global commit 601207e1151b2691112c431fc3b4130a85ac93b5
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global _hardened_build 1
Name: zookeeper
@ -7,23 +9,16 @@ Summary: A high-performance coordination service for distributed applicati
#Group: Development/Libraries
License: ASL 2.0 and BSD
URL: http://zookeeper.apache.org/
Source0: http://www.apache.org/dist/%{name}/stable/%{name}-%{version}.tar.gz
#Source1: %{name}-test-template.pom
Source2: %{name}-ZooInspector-template.pom
Source3: %{name}.service
# remove non free clover references
# configure ivy to use system libraries
# disable rat-lib and jdiff support
# Patch0: %{name}-3.4.4-build.patch
# https://issues.apache.org/jira/browse/ZOOKEEPER-1557
# Patch1: https://issues.apache.org/jira/secure/attachment/12548109/ZOOKEEPER-1557.patch
Patch2: %{name}-3.4.5-zktreeutil-gcc.patch
#Patch3: %{name}-3.4.5-disable-cygwin-detection.patch
Patch4: %{name}-3.4.5-build-contrib.patch
Patch5: %{name}-3.4.5-add-PIE-and-RELRO.patch
# remove date/time from console output since journald will keep track of date/time
Patch6: %{name}-3.4.5-log4j.patch
Source0: https://github.com/apache/zookeeper/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
Source1: %{name}-ZooInspector-template.pom
Source2: %{name}.service
Patch1: %{name}-3.4.5-zktreeutil-gcc.patch
Patch2: %{name}-3.4.6-ivy-build.patch
#Patch2: %{name}-3.4.5-log4j.patch
#Patch2: %{name}-3.4.5-build-contrib.patch
#Patch5: %{name}-3.4.5-add-PIE-and-RELRO.patch
BuildRequires: autoconf
BuildRequires: automake
@ -48,7 +43,9 @@ BuildRequires: checkstyle
BuildRequires: jline1
BuildRequires: jtoaster
BuildRequires: junit
BuildRequires: log4j12
#BuildRequires: log4j12
BuildRequires: log4j
BuildRequires: json_simple
BuildRequires: mockito
BuildRequires: netty3
@ -56,12 +53,6 @@ BuildRequires: slf4j
BuildRequires: xerces-j2
BuildRequires: xml-commons-apis
# BuildRequires: rat-lib
# BuildRequires: apache-rat-tasks
# BuildRequires: apache-commons-collections
# BuildRequires: apache-commons-lang
# BuildRequires: jdiff
BuildRequires: systemd
%description
@ -94,8 +85,7 @@ Documentation for the ZooKeeper C client library.
%package java
#Group: Development/Libraries
Summary: Zookeeper Java client library
# Requires: felix-framework
# Requires: felix-osgi-compendium
Requires: checkstyle
Requires: jline1
Requires: jtoaster
@ -143,143 +133,98 @@ BuildArch: noarch
ZooKeeper server
%prep
%setup -q
find -name "*.jar" -delete
find -name "*.class" -delete
find -name "*.cmd" -delete
find -name "*.so*" -delete
find -name "*.dll" -delete
%setup -q -n %{name}-%{commit}
#%patch0 -p1
#%patch1 -p0
%patch1 -p0
%patch2 -p1
#%patch3 -p1
#%patch4 -p1
%pom_remove_dep org.vafer:jdeb dist-maven/%{name}-%{version}.pom
# jdiff task deps
%pom_remove_dep jdiff:jdiff dist-maven/%{name}-%{version}.pom
%pom_remove_dep xerces:xerces dist-maven/%{name}-%{version}.pom
# rat-lib task deps
%pom_remove_dep org.apache.rat:apache-rat-tasks dist-maven/%{name}-%{version}.pom
%pom_remove_dep commons-collections:commons-collections dist-maven/%{name}-%{version}.pom
%pom_remove_dep commons-lang:commons-lang dist-maven/%{name}-%{version}.pom
#
%patch2 -p0
#%patch3 -p0
%patch4 -p1
%patch5 -p1
%patch6 -p1
sed -i "s|<version>0.9.94</version>|<version>1.0</version>|" dist-maven/%{name}-%{version}.pom
sed -i "s|<version>3.2.2.Final</version>|<version>3.6.6.Final</version>|" dist-maven/%{name}-%{version}.pom
sed -i "s|org.jboss.netty|io.netty|" dist-maven/%{name}-%{version}.pom
sed -i "s|<packaging>pom</packaging>|<packaging>jar</packaging>|" dist-maven/%{name}-%{version}.pom
sed -i "s|<groupId>checkstyle</groupId>|<groupId>com.puppycrawl.tools</groupId>|" dist-maven/%{name}-%{version}.pom
sed -i "s|<artifactId>mockito-all</artifactId>|<artifactId>mockito-core</artifactId>|" dist-maven/%{name}-%{version}.pom
cp -p %{SOURCE2} dist-maven/%{name}-%{version}-ZooInspector.pom
sed -i "s|@version@|%{version}|" dist-maven/%{name}-%{version}-ZooInspector.pom
#cp -p %{SOURCE1} dist-maven/%{name}-%{version}-ZooInspector.pom
#sed -i "s|@version@|%{version}|" dist-maven/%{name}-%{version}-ZooInspector.pom
iconv -f iso8859-1 -t utf-8 src/c/ChangeLog > src/c/ChangeLog.conv && mv -f src/c/ChangeLog.conv src/c/ChangeLog
sed -i 's/\r//' src/c/ChangeLog
# fix build problem on f18
sed -i 's|<exec executable="hostname" outputproperty="host.name"/>|<!--exec executable="hostname" outputproperty="host.name"/-->|' build.xml
sed -i 's|<attribute name="Built-On" value="${host.name}" />|<attribute name="Built-On" value="${user.name}" />|' build.xml
sed -i 's@^dataDir=.*$@dataDir=%{_sharedstatedir}/zookeeper/data\ndataLogDir=%{_sharedstatedir}/zookeeper/log@' conf/zoo_sample.cfg
%build
%ant -Divy.mode=local \
-Dtarget.jdk=1.5 \
-Djavadoc.link.java=%{_javadocdir}/java \
-Dant.build.javac.source=1.5 \
-Dant.build.javac.target=1.5 \
-Ddist.dir=%{buildroot} \
package-native
# TODO: Specify the output build directory.
%ant -Divy.mode=local package-native
# ensure that source and target are 1.5
#%ant -Dtarget.jdk=1.5 \
# -Djavadoc.link.java=%{_javadocdir}/java \
# -Dant.build.javac.source=1.5 \
# -Dant.build.javac.target=1.5 \
# build-generated jar test-jar javadoc javadoc-dev
#
#(
#cd src/contrib
#%ant -Dversion=%{version} \
# -Dcontribfilesetincludes="zooinspector/build.xml" \
# -Dant.build.javac.source=1.5 \
# -Dant.build.javac.target=1.5 \
# -Dtarget.jdk=1.5 \
# -DlastRevision=-1 \
# -Divy.jar.exists=true \
# -Divy.initialized=true \
# -Ddest.dir=../../build/zookeeper
#)
#pushd src/c
#rm -rf autom4te.cache
#autoreconf -fis
#
#%configure --disable-static --disable-rpath --with-syncapi
# 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
#Compile zktreeutil
# TODO - determine why it's not part of the default build
pushd src/contrib/zktreeutil
rm -rf autom4te.cache
autoreconf -if
%configure
%{__make} %{?_smp_mflags}
#make doxygen-doc
#popd
# Compile zktreeutil
#pushd src/contrib/zktreeutil
#rm -rf autom4te.cache
#autoreconf -if
#%configure
#%{__make} %{?_smp_mflags}
#popd
%if 0
%check
# Execute multi-threaded test suite
mkdir -p build/lib
for jar in jline log4j xerces-j2 xml-commons-apis; do \
ln -sf %{_javadir}/$jar.jar build/lib/$jar.jar; \
done
pushd src/c
%{__make} %{?_smp_mflags} zktest-mt
./zktest-mt
popd
%ifarch i386
# Run core Java test suite against zookeeper
ant -Dversion=%{version} -DlastRevision=-1 test-core-java
%endif
%endif
%check
%ant -Divy.mode=local \
test
%install
mkdir -p %{buildroot}%{_javadir}/%{name}
install -pm 644 build/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}.jar
install -pm 644 build/%{name}-%{version}-test.jar %{buildroot}%{_javadir}/%{name}/%{name}-tests.jar
install -pm 644 build/contrib/ZooInspector/%{name}-ZooInspector-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}-ZooInspector.jar
install -pm 644 build/contrib/ZooInspector/%{name}-%{version}-ZooInspector.jar %{buildroot}%{_javadir}/%{name}/%{name}-ZooInspector.jar
mkdir -p %{buildroot}%{_mavenpomdir}
install -pm 644 dist-maven/%{name}-%{version}.pom %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}.pom
install -pm 644 build/%{name}-%{version}/dist-maven/%{name}.pom %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}.pom
####################################################
# we will need to do our pom cleanup here.
#%pom_remove_dep org.vafer:jdeb dist-maven/%{name}-%{version}.pom
# jdiff task deps
#%pom_remove_dep jdiff:jdiff dist-maven/%{name}-%{version}.pom
#%pom_remove_dep xerces:xerces dist-maven/%{name}-%{version}.pom
# rat-lib task deps
#%pom_remove_dep org.apache.rat:apache-rat-tasks dist-maven/%{name}-%{version}.pom
#%pom_remove_dep commons-collections:commons-collections dist-maven/%{name}-%{version}.pom
#%pom_remove_dep commons-lang:commons-lang dist-maven/%{name}-%{version}.pom
#sed -i "s|<version>0.9.94</version>|<version>1.0</version>|" dist-maven/%{name}-%{version}.pom
#sed -i "s|<version>3.2.2.Final</version>|<version>3.6.6.Final</version>|" dist-maven/%{name}-%{version}.pom
#sed -i "s|org.jboss.netty|io.netty|" dist-maven/%{name}-%{version}.pom
#sed -i "s|<packaging>pom</packaging>|<packaging>jar</packaging>|" dist-maven/%{name}-%{version}.pom
#sed -i "s|<groupId>checkstyle</groupId>|<groupId>com.puppycrawl.tools</groupId>|" dist-maven/%{name}-%{version}.pom
#sed -i "s|<artifactId>mockito-all</artifactId>|<artifactId>mockito-core</artifactId>|" dist-maven/%{name}-%{version}.pom
####################################################
%add_maven_depmap JPP.%{name}-%{name}.pom %{name}/%{name}.jar
%add_maven_depmap org.apache.zookeeper:zookeeper::tests:%{version} %{name}/%{name}-tests.jar
install -pm 644 dist-maven/%{name}-%{version}-ZooInspector.pom %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-ZooInspector.pom
install -pm 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-ZooInspector.pom
sed -i "s|@version@|%{version}|" %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-ZooInspector.pom
%add_maven_depmap JPP.%{name}-%{name}-ZooInspector.pom %{name}/%{name}-ZooInspector.jar
mkdir -p %{buildroot}%{_javadocdir}/%{name}/dev
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -pr build/docs/api/* %{buildroot}%{_javadocdir}/%{name}/
cp -pr build/docs/dev-api/* %{buildroot}%{_javadocdir}/%{name}/dev/
pushd src/c
%{__make} install DESTDIR=%{buildroot}
#pushd build/c
#%{__make} install DESTDIR=%{buildroot}
# cleanup
rm -f docs/html/*.map
popd
#rm -f docs/html/*.map
#popd
pushd src/contrib/zktreeutil
%{__make} install DESTDIR=%{buildroot}
popd
#pushd src/contrib/zktreeutil
#%{__make} install DESTDIR=%{buildroot}
#popd
pushd src/contrib/zkpython
pushd build/contrib/zkpython
%{__python} src/python/setup.py build --build-base=$PWD/build \
install --root=%{buildroot} ;\
chmod 0755 %{buildroot}%{python_sitearch}/zookeeper.so
@ -293,7 +238,7 @@ mkdir -p %{buildroot}%{_localstatedir}/log/zookeeper
mkdir -p %{buildroot}%{_sharedstatedir}/zookeeper
mkdir -p %{buildroot}%{_sharedstatedir}/zookeeper/data
mkdir -p %{buildroot}%{_sharedstatedir}/zookeeper/log
install -p -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}
install -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}
install -p -m 0640 conf/log4j.properties %{buildroot}%{_sysconfdir}/zookeeper
install -p -m 0640 conf/zoo_sample.cfg %{buildroot}%{_sysconfdir}/zookeeper
touch %{buildroot}%{_sysconfdir}/zookeeper/zoo.cfg