Timothy St. Clair c804f9a
%global commit          601207e1151b2691112c431fc3b4130a85ac93b5
Timothy St. Clair da2547b
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
e5b4022
%global _hardened_build 1
Timothy St. Clair da2547b
%global skiptests       1
Timothy St. Clair 671bd17
e5b4022
Name:          zookeeper
Timothy St. Clair ef6470f
Version:       3.4.6
Timothy St. Clair ef6470f
Release:       1%{?dist}
e5b4022
Summary:       A high-performance coordination service for distributed applications
e5b4022
License:       ASL 2.0 and BSD
e5b4022
URL:           http://zookeeper.apache.org/
Timothy St. Clair c804f9a
Source0:       https://github.com/apache/zookeeper/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
Timothy St. Clair c804f9a
Source1:       %{name}-ZooInspector-template.pom
Timothy St. Clair c804f9a
Source2:       %{name}.service
Timothy St. Clair da2547b
Source3:       zkEnv.sh
Timothy St. Clair ef6470f
Timothy St. Clair c804f9a
Patch1:        %{name}-3.4.5-zktreeutil-gcc.patch
Timothy St. Clair c804f9a
Patch2:        %{name}-3.4.6-ivy-build.patch
Timothy St. Clair da2547b
#Patch3:        {name}-3.4.5-add-PIE-and-RELRO.patch
e5b4022
e5b4022
BuildRequires: autoconf
e5b4022
BuildRequires: automake
e5b4022
BuildRequires: boost-devel
e5b4022
BuildRequires: cppunit-devel
e5b4022
BuildRequires: dos2unix
e5b4022
BuildRequires: doxygen
e5b4022
BuildRequires: graphviz
e5b4022
BuildRequires: java-devel
e5b4022
BuildRequires: java-javadoc
e5b4022
BuildRequires: jpackage-utils
e5b4022
BuildRequires: libtool
e5b4022
BuildRequires: libxml2-devel
e5b4022
BuildRequires: log4cxx-devel
e5b4022
BuildRequires: python-devel
e5b4022
e5b4022
BuildRequires: ant
e5b4022
BuildRequires: ant-junit
e5b4022
BuildRequires: apache-ivy
Timothy St. Clair ef6470f
BuildRequires: ivy-local
e5b4022
BuildRequires: checkstyle
Timothy St. Clair a504250
BuildRequires: jline1
e5b4022
BuildRequires: jtoaster
e5b4022
BuildRequires: junit
Timothy St. Clair da2547b
%if 0%{?fedora} >= 21
Timothy St. Clair da2547b
BuildRequires: mvn(org.slf4j:slf4j-log4j12)
Timothy St. Clair 4ae4bc6
BuildRequires: javapackages-tools
Timothy St. Clair da2547b
%else
Timothy St. Clair da2547b
BuildRequires: mvn(log4j:log4j)
Timothy St. Clair da2547b
%endif
Timothy St. Clair c804f9a
BuildRequires: json_simple
Timothy St. Clair ef6470f
e5b4022
BuildRequires: mockito
Timothy St. Clair 671bd17
BuildRequires: netty3
e5b4022
BuildRequires: slf4j
e5b4022
BuildRequires: xerces-j2
e5b4022
BuildRequires: xml-commons-apis
e5b4022
94aec27
BuildRequires: systemd
94aec27
e5b4022
Requires:      checkstyle
Timothy St. Clair a504250
Requires:      jline1
e5b4022
Requires:      jtoaster
e5b4022
Requires:      junit
e5b4022
Requires:      log4j
e5b4022
Requires:      mockito
Timothy St. Clair 671bd17
Requires:      netty3
e5b4022
Requires:      slf4j
e5b4022
Requires:      java
e5b4022
Requires:      jpackage-utils
e5b4022
Timothy St. Clair da2547b
%description
Timothy St. Clair da2547b
ZooKeeper is a centralized service for maintaining configuration information,
Timothy St. Clair da2547b
naming, providing distributed synchronization, and providing group services.
Timothy St. Clair da2547b
Timothy St. Clair da2547b
%package devel
Timothy St. Clair da2547b
Summary:       Development files for the %{name} library
Timothy St. Clair da2547b
Requires:      %{name}-lib%{?_isa} = %{version}-%{release}
Timothy St. Clair da2547b
Timothy St. Clair da2547b
%description devel
Timothy St. Clair da2547b
Development files for the ZooKeeper C client library.
e5b4022
e5b4022
%package javadoc
e5b4022
Summary:       Javadoc for %{name}
e5b4022
e5b4022
%description javadoc
e5b4022
This package contains javadoc for %{name}.
e5b4022
Timothy St. Clair da2547b
%package -n python-%{name}
Timothy St. Clair da2547b
Summary:       Python support for %{name}
e5b4022
Requires:      %{name}-lib%{?_isa} = %{version}-%{release}
e5b4022
Provides:      zkpython%{?_isa} = %{version}-%{release}
Timothy St. Clair da2547b
Requires:      python2
e5b4022
Timothy St. Clair da2547b
%description -n python-%{name}
Timothy St. Clair da2547b
The python-%{name} package contains Python bindings for %{name}.
94aec27
e5b4022
%prep
Timothy St. Clair c804f9a
%setup -q -n %{name}-%{commit}
e5b4022
Timothy St. Clair c804f9a
%patch1 -p0
Timothy St. Clair c804f9a
%patch2 -p1
Timothy St. Clair da2547b
#%%patch3 -p1
e5b4022
e5b4022
iconv -f iso8859-1 -t utf-8 src/c/ChangeLog > src/c/ChangeLog.conv && mv -f src/c/ChangeLog.conv src/c/ChangeLog
e5b4022
sed -i 's/\r//' src/c/ChangeLog
e5b4022
e5b4022
sed -i 's|<exec executable="hostname" outputproperty="host.name"/>||' build.xml
e5b4022
sed -i 's|<attribute name="Built-On" value="${host.name}" />|<attribute name="Built-On" value="${user.name}" />|' build.xml
e5b4022
94aec27
sed -i 's@^dataDir=.*$@dataDir=%{_sharedstatedir}/zookeeper/data\ndataLogDir=%{_sharedstatedir}/zookeeper/log@' conf/zoo_sample.cfg
94aec27
e5b4022
%build
Timothy St. Clair c804f9a
%ant -Divy.mode=local \
Timothy St. Clair c804f9a
-Dtarget.jdk=1.5 \
Timothy St. Clair c804f9a
-Djavadoc.link.java=%{_javadocdir}/java \
Timothy St. Clair c804f9a
-Dant.build.javac.source=1.5 \
Timothy St. Clair c804f9a
-Dant.build.javac.target=1.5 \
Timothy St. Clair da2547b
package
Timothy St. Clair c804f9a
Timothy St. Clair da2547b
pushd src/c
Timothy St. Clair c804f9a
autoreconf -if
Timothy St. Clair 4ae4bc6
%configure --disable-static --disable-rpath
e5b4022
%{__make} %{?_smp_mflags}
Timothy St. Clair c804f9a
popd
e5b4022
Timothy St. Clair da2547b
## TODO: install utilities?
Timothy St. Clair da2547b
e5b4022
%check
Timothy St. Clair da2547b
%if %skiptests
Timothy St. Clair da2547b
  echo "Testing disabled, please enable in mock"
Timothy St. Clair da2547b
%else
Timothy St. Clair da2547b
  %ant -Divy.mode=local test
Timothy St. Clair da2547b
%endif
e5b4022
e5b4022
%install
Timothy St. Clair da2547b
#install the c tools
Timothy St. Clair da2547b
pushd src/c
Timothy St. Clair da2547b
%make_install
Timothy St. Clair da2547b
popd
Timothy St. Clair da2547b
Timothy St. Clair da2547b
# install the java dependencies.
e5b4022
mkdir -p %{buildroot}%{_javadir}/%{name}
e5b4022
install -pm 644 build/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}.jar
Timothy St. Clair 3d94c04
install -pm 644 build/%{name}-%{version}-test.jar %{buildroot}%{_javadir}/%{name}/%{name}-tests.jar
Timothy St. Clair c804f9a
install -pm 644 build/contrib/ZooInspector/%{name}-%{version}-ZooInspector.jar %{buildroot}%{_javadir}/%{name}/%{name}-ZooInspector.jar
e5b4022
Timothy St. Clair da2547b
install -pm 755 bin/zkCleanup.sh %{buildroot}%{_bindir}
Timothy St. Clair da2547b
install -pm 755 bin/zkCli.sh %{buildroot}%{_bindir}
Timothy St. Clair da2547b
install -pm 755 bin/zkServer.sh %{buildroot}%{_bindir}
Timothy St. Clair da2547b
mkdir -p %{buildroot}%{_libexecdir}
Timothy St. Clair da2547b
install -pm 755 %{SOURCE3} %{buildroot}%{_libexecdir}
Timothy St. Clair da2547b
Timothy St. Clair da2547b
%if 0%{?fedora} >= 21
Timothy St. Clair da2547b
mkdir -p %{buildroot}%{_datadir}/maven-metadata
Timothy St. Clair 4ae4bc6
mkdir -p %{buildroot}%{_datadir}/maven-poms
Timothy St. Clair 4ae4bc6
install -pm 644 build/%{name}-%{version}/dist-maven/%{name}-%{version}.pom %{buildroot}%{_datadir}/maven-poms/%{name}-%{name}.pom
Timothy St. Clair da2547b
Timothy St. Clair da2547b
%add_maven_depmap %{name}-%{name}.pom %{name}/%{name}.jar
Timothy St. Clair da2547b
%add_maven_depmap org.apache.zookeeper:zookeeper::tests:%{version} %{name}/%{name}-tests.jar
Timothy St. Clair da2547b
Timothy St. Clair 4ae4bc6
install -pm 644 %{SOURCE1} %{buildroot}%{_datadir}/maven-poms/%{name}-%{name}-ZooInspector.pom
Timothy St. Clair 4ae4bc6
sed -i "s|@version@|%{version}|" %{buildroot}%{_datadir}/maven-poms/%{name}-%{name}-ZooInspector.pom
Timothy St. Clair da2547b
%add_maven_depmap %{name}-%{name}-ZooInspector.pom %{name}/%{name}-ZooInspector.jar
Timothy St. Clair da2547b
%else
e5b4022
mkdir -p %{buildroot}%{_mavenpomdir}
Timothy St. Clair da2547b
install -pm 644 build/%{name}-%{version}/dist-maven/%{name}-%{version}.pom %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}.pom
Timothy St. Clair c804f9a
e5b4022
%add_maven_depmap JPP.%{name}-%{name}.pom %{name}/%{name}.jar
Timothy St. Clair 3d94c04
%add_maven_depmap org.apache.zookeeper:zookeeper::tests:%{version} %{name}/%{name}-tests.jar
Timothy St. Clair c804f9a
Timothy St. Clair c804f9a
install -pm 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-ZooInspector.pom
Timothy St. Clair c804f9a
sed -i "s|@version@|%{version}|" %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-ZooInspector.pom
e5b4022
%add_maven_depmap JPP.%{name}-%{name}-ZooInspector.pom %{name}/%{name}-ZooInspector.jar
Timothy St. Clair da2547b
%endif
Timothy St. Clair da2547b
Timothy St. Clair c804f9a
mkdir -p %{buildroot}%{_javadocdir}/%{name}
e5b4022
cp -pr build/docs/api/* %{buildroot}%{_javadocdir}/%{name}/
e5b4022
Timothy St. Clair da2547b
pushd src/contrib/zkpython
e5b4022
%{__python} src/python/setup.py build --build-base=$PWD/build \
e5b4022
install --root=%{buildroot} ;\
e5b4022
chmod 0755 %{buildroot}%{python_sitearch}/zookeeper.so
e5b4022
popd
e5b4022
e5b4022
find %{buildroot} -name '*.la' -exec rm -f {} ';'
Timothy St. Clair da2547b
find %{buildroot} -name '*.a' -exec rm -f {} ';'
e5b4022
94aec27
mkdir -p %{buildroot}%{_unitdir}
94aec27
mkdir -p %{buildroot}%{_sysconfdir}/zookeeper
94aec27
mkdir -p %{buildroot}%{_localstatedir}/log/zookeeper
94aec27
mkdir -p %{buildroot}%{_sharedstatedir}/zookeeper
94aec27
mkdir -p %{buildroot}%{_sharedstatedir}/zookeeper/data
94aec27
mkdir -p %{buildroot}%{_sharedstatedir}/zookeeper/log
Timothy St. Clair c804f9a
install -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}
94aec27
install -p -m 0640 conf/log4j.properties %{buildroot}%{_sysconfdir}/zookeeper
94aec27
install -p -m 0640 conf/zoo_sample.cfg %{buildroot}%{_sysconfdir}/zookeeper
94aec27
touch %{buildroot}%{_sysconfdir}/zookeeper/zoo.cfg
94aec27
touch %{buildroot}%{_sharedstatedir}/zookeeper/data/myid
94aec27
Timothy St. Clair da2547b
%pre
94aec27
getent group zookeeper >/dev/null || groupadd -r zookeeper
94aec27
getent passwd zookeeper >/dev/null || \
94aec27
    useradd -r -g zookeeper -d %{_sharedstatedir}/zookeeper -s /sbin/nologin \
94aec27
    -c "ZooKeeper service account" zookeeper
Timothy St. Clair da2547b
Timothy St. Clair da2547b
%post
94aec27
%systemd_post zookeeper.service
Timothy St. Clair da2547b
/sbin/ldconfig
94aec27
Timothy St. Clair da2547b
%preun
94aec27
%systemd_preun zookeeper.service
94aec27
Timothy St. Clair da2547b
%postun
94aec27
%systemd_postun_with_restart zookeeper.service
Timothy St. Clair da2547b
/sbin/ldconfig
94aec27
Timothy St. Clair 0b2fc1b
%files
e5b4022
%{_bindir}/cli_mt
e5b4022
%{_bindir}/cli_st
e5b4022
%{_bindir}/load_gen
Timothy St. Clair da2547b
%{_bindir}/zk*.sh
Timothy St. Clair da2547b
%{_libexecdir}/zkEnv.sh
e5b4022
%{_libdir}/lib*.so.*
a8baeb6
%dir %{_javadir}/%{name}
e5b4022
%{_javadir}/%{name}/%{name}.jar
Timothy St. Clair 3d94c04
%{_javadir}/%{name}/%{name}-tests.jar
e5b4022
%{_javadir}/%{name}/%{name}-ZooInspector.jar
Timothy St. Clair da2547b
Timothy St. Clair da2547b
%if 0%{?fedora} >= 21
Timothy St. Clair 4ae4bc6
%{_datadir}/maven-poms/%{name}-%{name}.pom
Timothy St. Clair 4ae4bc6
%{_datadir}/maven-poms/%{name}-%{name}-ZooInspector.pom
Timothy St. Clair da2547b
%{_datadir}/maven-metadata/%{name}.xml
Timothy St. Clair da2547b
%else
Timothy St. Clair da2547b
%{_mavendepmapfragdir}/%{name}
e5b4022
%{_mavenpomdir}/JPP.%{name}-%{name}.pom
e5b4022
%{_mavenpomdir}/JPP.%{name}-%{name}-ZooInspector.pom
Timothy St. Clair da2547b
%endif
e5b4022
Timothy St. Clair f16f8e2
%attr(0755,root,root) %dir %{_sysconfdir}/zookeeper
Timothy St. Clair f16f8e2
%attr(0644,root,root) %ghost %config(noreplace) %{_sysconfdir}/zookeeper/zoo.cfg
Timothy St. Clair f16f8e2
%attr(0644,root,root) %{_sysconfdir}/zookeeper/zoo_sample.cfg
Timothy St. Clair f16f8e2
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/zookeeper/log4j.properties
94aec27
94aec27
%attr(0750,zookeeper,zookeeper) %dir %{_localstatedir}/log/zookeeper
Timothy St. Clair f16f8e2
%attr(0755,root,root) %dir %{_sharedstatedir}/zookeeper
94aec27
%attr(0750,zookeeper,zookeeper) %dir %{_sharedstatedir}/zookeeper/data
94aec27
%attr(0640,zookeeper,zookeeper) %ghost %{_sharedstatedir}/zookeeper/data/myid
94aec27
%attr(0750,zookeeper,zookeeper) %dir %{_sharedstatedir}/zookeeper/log
94aec27
%{_unitdir}/zookeeper.service
Timothy St. Clair da2547b
%doc CHANGES.txt LICENSE.txt NOTICE.txt README.txt
Timothy St. Clair da2547b
Timothy St. Clair da2547b
%files devel
Timothy St. Clair da2547b
%{_includedir}/%{name}/
Timothy St. Clair da2547b
%{_libdir}/*.so
Timothy St. Clair da2547b
%doc src/c/LICENSE src/c/NOTICE.txt
Timothy St. Clair da2547b
Timothy St. Clair da2547b
%files javadoc
Timothy St. Clair da2547b
%{_javadocdir}/%{name}
Timothy St. Clair da2547b
%doc LICENSE.txt NOTICE.txt
Timothy St. Clair da2547b
Timothy St. Clair da2547b
%files -n python-%{name}
Timothy St. Clair da2547b
%{python_sitearch}/ZooKeeper-?.?-py%{python_version}.egg-info
Timothy St. Clair da2547b
%{python_sitearch}/zookeeper.so
Timothy St. Clair da2547b
%doc LICENSE.txt NOTICE.txt src/contrib/zkpython/README
94aec27
e5b4022
%changelog
Timothy St. Clair da2547b
* Wed Oct 8 2014 Timothy St. Clair <tstclair@redhat.com> - 3.4.6-1
Timothy St. Clair da2547b
- Update to latest stable series
Timothy St. Clair da2547b
- Cleanup and overhaul package
Timothy St. Clair da2547b
a39c778
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.5-20
a39c778
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
a39c778
f5104b6
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.5-19
f5104b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
f5104b6
Petr Machata e16f7ab
* Fri May 23 2014 Petr Machata <pmachata@redhat.com> - 3.4.5-18
Petr Machata e16f7ab
- Rebuild for boost 1.55.0
Petr Machata e16f7ab
Timothy St. Clair 7accb41
* Mon Feb 24 2014 Timothy St. Clair <tstclair@redhat.com> - 3.4.5-17
Timothy St. Clair 7accb41
- Update due to cascading dependencies around java-headless
Timothy St. Clair 7accb41
Timothy St. Clair 3d94c04
* Fri Jan 31 2014 Timothy St. Clair <tstclair@redhat.com> - 3.4.5-16
Timothy St. Clair 3d94c04
- Update of tests.jar due to netty3 compat packaging conflicts
Timothy St. Clair 3d94c04
Timothy St. Clair 671bd17
* Fri Jan 24 2014 Timothy St. Clair <tstclair@redhat.com> - 3.4.5-15
Timothy St. Clair a504250
- Update jline and netty3 for f21 builds
Timothy St. Clair 671bd17
Timothy St. Clair b086009
* Fri Oct 25 2013 Timothy St. Clair <tstclair@redhat.com> - 3.4.5-14
Timothy St. Clair fd7e1f3
- Update dependencies to jline1
Timothy St. Clair fd7e1f3
Timothy St. Clair a7f6eee
* Wed Sep 18 2013 Timothy St. Clair <tstclair@redhat.com> - 3.4.5-13
Timothy St. Clair a7f6eee
- Fixed the atomic patch which actually caused recursive crashing on zookeeper_close
Timothy St. Clair a7f6eee
Petr Machata 0c2f9b8
* Tue Jul 30 2013 Petr Machata <pmachata@redhat.com> - 3.4.5-12
Petr Machata 0c2f9b8
- Rebuild for boost 1.54.0
Petr Machata 0c2f9b8
1a8f6bf
* Tue Jul 30 2013 gil cattaneo <puntogil@libero.it> 3.4.5-11
abf296d
- fix changelog entries
1a8f6bf
Timothy St. Clair 680f89e
* Mon Jul 22 2013 Timothy St. Clair <tstclair@redhat.com> - 3.4.5-10
Timothy St. Clair f16f8e2
- update permissions to be in line with default policies
Timothy St. Clair f16f8e2
a8baeb6
* Mon Jul 22 2013 gil cattaneo <puntogil@libero.it> 3.4.5-9
a8baeb6
- removed not needed %%defattr (only required for rpm < 4.4)
a8baeb6
- removed not needed Group fields (new package guideline)
a8baeb6
- fix directory ownership in java sub package
a8baeb6
Timothy St. Clair 680f89e
* Mon Jul 22 2013 Timothy St. Clair <tstclair@redhat.com> - 3.4.5-8
Timothy St. Clair 0b2fc1b
- cleanup file ownership properties.
Timothy St. Clair 0b2fc1b
abf296d
* Sat Jun 15 2013 Jeffrey C. Ollie <jeff@ocjtech.us> - 3.4.5-7
94aec27
- add server subpackage
94aec27
ebc3b4d
* Fri Jun 14 2013 Dan Horák <dan[at]danny.cz> - 3.4.5-6
ebc3b4d
- use fetch_and_add from GCC, fixes build on non-x86 arches
ebc3b4d
e5b4022
* Tue Jun 11 2013  gil cattaneo <puntogil@libero.it> 3.4.5-5
e5b4022
- fixed zookeeper.so non-standard-executable-perm thanks to Björn Esser
e5b4022
e5b4022
* Tue Jun 11 2013  gil cattaneo <puntogil@libero.it> 3.4.5-4
e5b4022
- enabled hardened-builds
e5b4022
- fixed fully versioned dependency in subpackages (lib-devel and python)
e5b4022
- fixed License tag
e5b4022
- moved large documentation in lib-doc subpackage
e5b4022
e5b4022
* Sat Apr 27 2013 gil cattaneo <puntogil@libero.it> 3.4.5-3
e5b4022
- built ZooInspector
e5b4022
- added additional poms files
e5b4022
e5b4022
* Tue Apr 23 2013 gil cattaneo <puntogil@libero.it> 3.4.5-2
e5b4022
- building/packaging of the zookeeper-test.jar thanks to Robert Rati
e5b4022
e5b4022
* Sun Dec 02 2012 gil cattaneo <puntogil@libero.it> 3.4.5-1
e5b4022
- update to 3.4.5
e5b4022
e5b4022
* Tue Oct 30 2012 gil cattaneo <puntogil@libero.it> 3.4.4-3
e5b4022
- fix missing hostname
e5b4022
e5b4022
* Fri Oct 12 2012 gil cattaneo <puntogil@libero.it> 3.4.4-2
e5b4022
- add ant-junit as BR
e5b4022
e5b4022
* Fri Oct 12 2012 gil cattaneo <puntogil@libero.it> 3.4.4-1
e5b4022
- update to 3.4.4
e5b4022
e5b4022
* Fri May 18 2012 gil cattaneo <puntogil@libero.it> 3.4.3-1
94aec27
- initial rpm