From 2ab0821db4e2f37a4ecfae4a8cc204c22a7b72f4 Mon Sep 17 00:00:00 2001 From: "Patrick D. Hunt" Date: Thu, 3 Mar 2016 16:12:55 +0000 Subject: [PATCH] ZOOKEEPER-1604 remove rpm/deb/... packaging (cnauroth via phunt) git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1733489 13f79535-47bb-0310-9956-ffa450edef68 --- README_packaging.txt | 53 ++---- build.xml | 174 ------------------ ivy.xml | 3 - src/contrib/build-contrib.xml | 15 -- src/contrib/build.xml | 18 -- src/contrib/zkpython/build.xml | 87 --------- src/contrib/zkpython/ivy.xml | 8 - .../src/packages/deb/zkpython.control/control | 23 --- .../src/packages/rpm/spec/zkpython.spec | 81 -------- src/packages/deb/init.d/zookeeper | 140 -------------- src/packages/deb/zookeeper.control/conffile | 15 -- src/packages/deb/zookeeper.control/control | 23 --- src/packages/deb/zookeeper.control/postinst | 23 --- src/packages/deb/zookeeper.control/postrm | 19 -- src/packages/deb/zookeeper.control/preinst | 20 -- src/packages/deb/zookeeper.control/prerm | 24 --- src/packages/rpm/init.d/zookeeper | 84 --------- src/packages/rpm/spec/zookeeper.spec | 166 ----------------- src/packages/templates/conf/zookeeper-env.sh | 16 -- src/packages/update-zookeeper-env.sh | 163 ---------------- src/recipes/build-recipes.xml | 16 -- src/recipes/build.xml | 18 -- 22 files changed, 16 insertions(+), 1173 deletions(-) delete mode 100644 src/contrib/zkpython/src/packages/deb/zkpython.control/control delete mode 100644 src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec delete mode 100644 src/packages/deb/init.d/zookeeper delete mode 100644 src/packages/deb/zookeeper.control/conffile delete mode 100644 src/packages/deb/zookeeper.control/control delete mode 100644 src/packages/deb/zookeeper.control/postinst delete mode 100644 src/packages/deb/zookeeper.control/postrm delete mode 100644 src/packages/deb/zookeeper.control/preinst delete mode 100644 src/packages/deb/zookeeper.control/prerm delete mode 100644 src/packages/rpm/init.d/zookeeper delete mode 100644 src/packages/rpm/spec/zookeeper.spec delete mode 100644 src/packages/templates/conf/zookeeper-env.sh delete mode 100644 src/packages/update-zookeeper-env.sh diff --git a/README_packaging.txt b/README_packaging.txt index 2a01cf14..9776f74c 100644 --- a/README_packaging.txt +++ b/README_packaging.txt @@ -20,47 +20,26 @@ apt-get --install python-setuptools Package build command --------------------- -Command to build Debian package: ant deb -Command to build RPM Package: ant rpm +The ZooKeeper project publishes releases as tarballs. For ZooKeeper packages +specific to your OS (such as rpm and deb), consider using Apache Bigtop: -rpm and deb packages are generated and placed in: +http://bigtop.apache.org/ -build/zookeeper*.[rpm|deb] -build/contrib/**.[rpm|deb] +Command to build tarball package: ant tar -Default package file structure layout +zookeeper-.tar.gz tarball file structure layout - /usr/bin - User executable - /usr/sbin - System executable - /usr/libexec - Configuration boot trap script - /usr/lib - Native libraries - /usr/share/doc/zookeeper - Documents - /usr/share/zookeeper - Project files - /usr/share/zookeeper/template/conf - Configuration template files - /etc/zookeeper - Configuration files - /etc/init.d/zookeeper - OS startup script + /bin - User executable + /sbin - System executable + /libexec - Configuration boot trap script + /lib - Library dependencies + /docs - Documents + /share/zookeeper - Project files -Source file structure layout ---------------------- - -src/packages/update-zookeeper-env.sh - - setup environment variables and symlink $PREFIX/etc/zookeeper to - /etc/zookeeper. - - This script is designed to run in post installation, and pre-remove - phase of ZooKeeper package. - - Run update-zookeeper-env.sh -h to get a list of supported parameters. - -src/packages/template - - Standard configuration template - -src/packages/deb - Meta data for creating Debian package - -src/packages/deb/init.d - Daemon start/stop script for Debian flavor of Linux +Command to build tarball package with native components: ant package-native tar -src/packages/rpm - Meta data for creating RPM package +zookeeper--lib.tar.gz tarball file structure layout -src/packages/rpm/init.d - Daemon start/stop script for Redhat flavor of Linux + /bin - User executable + /lib - Native libraries + /include/zookeeper - Native library headers diff --git a/build.xml b/build.xml index 13eb01fb..43155fcf 100644 --- a/build.xml +++ b/build.xml @@ -171,17 +171,6 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant"> - - - - - - - - - - - @@ -250,11 +239,6 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant"> - - - - - @@ -836,12 +820,10 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant"> - - @@ -925,16 +907,6 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant"> - - - - - - - - /tmp/zookeeper - ${VAR_DIR}/data - @@ -1030,151 +1002,6 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1262,7 +1089,6 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant"> - diff --git a/ivy.xml b/ivy.xml index 942609b0..ef82de47 100644 --- a/ivy.xml +++ b/ivy.xml @@ -31,7 +31,6 @@ - @@ -55,8 +54,6 @@ - - diff --git a/src/contrib/build-contrib.xml b/src/contrib/build-contrib.xml index 73853f46..2d6a523a 100644 --- a/src/contrib/build-contrib.xml +++ b/src/contrib/build-contrib.xml @@ -160,21 +160,6 @@ - - - - - - - - - - - - - - - diff --git a/src/contrib/build.xml b/src/contrib/build.xml index 41fd432e..c1a716ce 100644 --- a/src/contrib/build.xml +++ b/src/contrib/build.xml @@ -67,22 +67,4 @@ - - - - - - - - - - - - - - - - - - diff --git a/src/contrib/zkpython/build.xml b/src/contrib/zkpython/build.xml index 029d4f29..82ff9028 100644 --- a/src/contrib/zkpython/build.xml +++ b/src/contrib/zkpython/build.xml @@ -25,10 +25,6 @@ - - - - @@ -111,88 +107,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/contrib/zkpython/ivy.xml b/src/contrib/zkpython/ivy.xml index 6931f468..f8bad401 100644 --- a/src/contrib/zkpython/ivy.xml +++ b/src/contrib/zkpython/ivy.xml @@ -32,12 +32,4 @@ - - - - - - - - diff --git a/src/contrib/zkpython/src/packages/deb/zkpython.control/control b/src/contrib/zkpython/src/packages/deb/zkpython.control/control deleted file mode 100644 index 6ec76d06..00000000 --- a/src/contrib/zkpython/src/packages/deb/zkpython.control/control +++ /dev/null @@ -1,23 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -Package: zkpython -Version: @version@ -Section: misc -Priority: optional -Architecture: all -Depends: python -Maintainer: Apache Software Foundation -Description: ZooKeeper python binding library -Distribution: development diff --git a/src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec b/src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec deleted file mode 100644 index d1f98143..00000000 --- a/src/contrib/zkpython/src/packages/rpm/spec/zkpython.spec +++ /dev/null @@ -1,81 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# RPM Spec file for ZooKeeper version @version@ -# - -%define name zkpython -%define version @version@ -%define release @package.release@ - -# Installation Locations -%define _prefix @package.prefix@ - -# Build time settings -%define _build_dir @package.build.dir@ -%define _final_name @final.name@ -%define _python_lib @python.lib@ -%define debug_package %{nil} - -# Disable brp-java-repack-jars for aspect J -%define __os_install_post \ - /usr/lib/rpm/redhat/brp-compress \ - %{!?__debug_package:/usr/lib/rpm/redhat/brp-strip %{__strip}} \ - /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \ - /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \ - /usr/lib/rpm/brp-python-bytecompile %{nil} - -# RPM searches perl files for dependancies and this breaks for non packaged perl lib -# like thrift so disable this -%define _use_internal_dependency_generator 0 - -Summary: ZooKeeper python binding library -Group: Development/Libraries -License: Apache License, Version 2.0 -URL: http://zookeeper.apache.org/ -Vendor: Apache Software Foundation -Name: %{name} -Version: %{version} -Release: %{release} -Source0: %{_python_lib} -Prefix: %{_prefix} -Requires: zookeeper-lib == %{version} -AutoReqProv: no -Provides: zkpython - -%description -ZooKeeper python binding library - -%prep -tar fxz %{_python_lib} -C %{_build_dir} - -%build - -######################### -#### INSTALL SECTION #### -######################### -%install - -%pre - -%post - -%preun - -%files -%defattr(-,root,root) -%{_prefix} - diff --git a/src/packages/deb/init.d/zookeeper b/src/packages/deb/init.d/zookeeper deleted file mode 100644 index d0f7216d..00000000 --- a/src/packages/deb/init.d/zookeeper +++ /dev/null @@ -1,140 +0,0 @@ -#! /usr/bin/env bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -### BEGIN INIT INFO -# Provides: zookeeper -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: -# Short-Description: Apache ZooKeeper server -### END INIT INFO - -set -e - -# /etc/init.d/zookeeper: start and stop the Apache ZooKeeper daemon - -umask 022 - -. /usr/libexec/zkEnv.sh - -. /lib/lsb/init-functions - -ZOOPIDDIR=/var/lib/zookeeper/data -ZOOPIDFILE=${ZOOPIDDIR}/zookeeper_server.pid - -check_privsep_dir() { - # Create the PrivSep empty dir if necessary - if [ ! -d ${ZOOPIDDIR} ]; then - mkdir -p ${ZOOPIDDIR} - chown zookeeper:hadoop ${ZOOPIDDIR} - chmod 0775 ${ZOOPIDDIR} - fi -} - -# Are we running from init? -run_by_init() { - ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ] -} - -check_for_no_start() { - # forget it if we're trying to start, and /etc/zookeeper/zookeeper_not_to_be_run exists - if [ -e /etc/zookeeper/zookeeper_not_to_be_run ]; then - if [ "$1" = log_end_msg ]; then - log_end_msg 0 - fi - if ! run_by_init; then - log_action_msg "Apache ZooKeeper server not in use (/etc/zookeeper/zookeeper_not_to_be_run)" - fi - exit 0 - fi -} - -export PATH="${PATH:+$PATH:}/usr/sbin:/usr/bin" - -case "$1" in - start) - check_for_no_start - check_privsep_dir - log_daemon_msg "Starting Apache ZooKeeper server" "zookeeper" - if start-stop-daemon --start --quiet --oknodo --pidfile ${ZOOPIDFILE} -c zookeeper -x ${ZOOKEEPER_PREFIX}/sbin/zkServer.sh start; then - log_end_msg 0 - else - log_end_msg 1 - fi - ;; - stop) - log_daemon_msg "Stopping Apache ZooKeeper server" "zookeeper" - if start-stop-daemon --stop --quiet --oknodo --pidfile ${ZOOPIDFILE}; then - log_end_msg 0 - else - log_end_msg 1 - fi - ;; - - restart) - check_privsep_dir - log_daemon_msg "Restarting Apache ZooKeeper server" "zookeeper" - start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile ${ZOOPIDFILE} - check_for_no_start log_end_msg - if start-stop-daemon --start --quiet --oknodo --pidfile ${ZOOPIDFILE} -c zookeeper -x ${ZOOKEEPER_PREFIX}/sbin/zkServer.sh start; then - log_end_msg 0 - else - log_end_msg 1 - fi - ;; - - try-restart) - check_privsep_dir - log_daemon_msg "Restarting Apache ZooKeeper server" "zookeeper" - set +e - start-stop-daemon --stop --quiet --retry 30 --pidfile ${ZOOPIDFILE} - RET="$?" - set -e - case $RET in - 0) - # old daemon stopped - check_for_no_start log_end_msg - if start-stop-daemon --start --quiet --oknodo --pidfile ${ZOOPIDFILE} -c zookeeper -x ${ZOOKEEPER_PREFIX}/sbin/zkServer.sh start; then - log_end_msg 0 - else - log_end_msg 1 - fi - ;; - 1) - # daemon not running - log_progress_msg "(not running)" - log_end_msg 0 - ;; - *) - # failed to stop - log_progress_msg "(failed to stop)" - log_end_msg 1 - ;; - esac - ;; - - status) - status_of_proc -p ${ZOOPIDFILE} ${JAVA_HOME}/bin/java zookeeper && exit 0 || exit $? - ;; - - *) - log_action_msg "Usage: /etc/init.d/zookeeper {start|stop|restart|try-restart|status}" - exit 1 -esac - -exit 0 diff --git a/src/packages/deb/zookeeper.control/conffile b/src/packages/deb/zookeeper.control/conffile deleted file mode 100644 index 6fdd65be..00000000 --- a/src/packages/deb/zookeeper.control/conffile +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -/etc/zookeeper diff --git a/src/packages/deb/zookeeper.control/control b/src/packages/deb/zookeeper.control/control deleted file mode 100644 index c7469060..00000000 --- a/src/packages/deb/zookeeper.control/control +++ /dev/null @@ -1,23 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -Package: zookeeper -Version: @version@ -Section: misc -Priority: optional -Architecture: all -Depends: sun-java6-jre -Maintainer: Apache Software Foundation -Description: ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. -Distribution: development diff --git a/src/packages/deb/zookeeper.control/postinst b/src/packages/deb/zookeeper.control/postinst deleted file mode 100644 index a6cbd22d..00000000 --- a/src/packages/deb/zookeeper.control/postinst +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -bash /usr/sbin/update-zookeeper-env.sh \ - --prefix=/usr \ - --conf-dir=/etc/zookeeper \ - --log-dir=/var/log/zookeeper \ - --pid-dir=/var/run/zookeeper \ - --var-dir=/var/lib/zookeeper diff --git a/src/packages/deb/zookeeper.control/postrm b/src/packages/deb/zookeeper.control/postrm deleted file mode 100644 index 27842b75..00000000 --- a/src/packages/deb/zookeeper.control/postrm +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -/usr/sbin/userdel zookeeper 2> /dev/null >/dev/null -exit 0 diff --git a/src/packages/deb/zookeeper.control/preinst b/src/packages/deb/zookeeper.control/preinst deleted file mode 100644 index d4ca7f71..00000000 --- a/src/packages/deb/zookeeper.control/preinst +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -getent group hadoop 2>/dev/null >/dev/null || /usr/sbin/groupadd -r hadoop - -/usr/sbin/useradd --comment "ZooKeeper" --shell /bin/bash -M -r --groups hadoop --home /usr/share/zookeeper zookeeper 2> /dev/null || : diff --git a/src/packages/deb/zookeeper.control/prerm b/src/packages/deb/zookeeper.control/prerm deleted file mode 100644 index c986688a..00000000 --- a/src/packages/deb/zookeeper.control/prerm +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -/etc/init.d/zookeeper stop 2>/dev/null >/dev/null -bash /usr/sbin/update-zookeeper-env.sh \ - --prefix=/usr \ - --conf-dir=/etc/zookeeper \ - --log-dir=/var/log/zookeeper \ - --pid-dir=/var/run/zookeeper \ - --uninstal diff --git a/src/packages/rpm/init.d/zookeeper b/src/packages/rpm/init.d/zookeeper deleted file mode 100644 index 624e1a58..00000000 --- a/src/packages/rpm/init.d/zookeeper +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# ZooKeeper -# -# chkconfig: 2345 89 9 -# description: zookeeper - -source /etc/rc.d/init.d/functions -source /usr/libexec/zkEnv.sh - -RETVAL=0 -PIDFILE="${ZOOPIDFILE}" -desc="ZooKeeper daemon" - -start() { - echo -n $"Starting $desc (zookeeper): " - daemon --user zookeeper zkServer.sh start - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zookeeper - return $RETVAL -} - -stop() { - echo -n $"Stopping $desc (zookeeper): " - daemon --user zookeeper zkServer.sh stop - RETVAL=$? - sleep 5 - echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zookeeper $PIDFILE -} - -restart() { - stop - start -} - -checkstatus(){ - status -p $PIDFILE ${JAVA_HOME}/bin/java - RETVAL=$? -} - -condrestart(){ - [ -e /var/lock/subsys/zookeeper ] && restart || : -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - checkstatus - ;; - restart) - restart - ;; - condrestart) - condrestart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart}" - exit 1 -esac - -exit $RETVAL diff --git a/src/packages/rpm/spec/zookeeper.spec b/src/packages/rpm/spec/zookeeper.spec deleted file mode 100644 index 8e195c71..00000000 --- a/src/packages/rpm/spec/zookeeper.spec +++ /dev/null @@ -1,166 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# RPM Spec file for ZooKeeper version @version@ -# - -%define name zookeeper -%define version @version@ -%define release @package.release@ - -# Installation Locations -%define _prefix @package.prefix@ -%define _bin_dir %{_prefix}/bin -%define _conf_dir @package.conf.dir@ -%define _include_dir %{_prefix}/include -%define _lib_dir %{_prefix}/lib -%define _lib64_dir %{_prefix}/lib64 -%define _libexec_dir %{_prefix}/libexec -%define _log_dir @package.log.dir@ -%define _man_dir %{_prefix}/man -%define _pid_dir @package.pid.dir@ -%define _sbin_dir %{_prefix}/sbin -%define _share_dir %{_prefix}/share/zookeeper -%define _src_dir %{_prefix}/src -%define _var_dir @package.var.dir@ - -# Build time settings -%define _build_dir @package.build.dir@ -%define _final_name @final.name@ -%define _c_lib @c.lib@ -%define debug_package %{nil} - -# Disable brp-java-repack-jars for aspect J -%define __os_install_post \ - /usr/lib/rpm/redhat/brp-compress \ - %{!?__debug_package:/usr/lib/rpm/redhat/brp-strip %{__strip}} \ - /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \ - /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \ - /usr/lib/rpm/brp-python-bytecompile %{nil} - -# RPM searches perl files for dependancies and this breaks for non packaged perl lib -# like thrift so disable this -%define _use_internal_dependency_generator 0 - -Summary: ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. -License: Apache License, Version 2.0 -URL: http://zookeeper.apache.org/ -Vendor: Apache Software Foundation -Group: Development/Libraries -Name: %{name} -Version: %{version} -Release: %{release} -Source0: %{_final_name}.tar.gz -Source1: %{_final_name}-lib.tar.gz -Prefix: %{_prefix} -Prefix: %{_conf_dir} -Prefix: %{_log_dir} -Prefix: %{_pid_dir} -Prefix: %{_var_dir} -Requires: sh-utils, textutils, /usr/sbin/useradd, /usr/sbin/usermod, /sbin/chkconfig, /sbin/service, jdk >= 1.6 -AutoReqProv: no -Provides: zookeeper - -%description -ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. All of these kinds of services are used in some form or another by distributed applications. Each time they are implemented there is a lot of work that goes into fixing the bugs and race conditions that are inevitable. Because of the difficulty of implementing these kinds of services, applications initially usually skimp on them ,which make them brittle in the presence of change and difficult to manage. Even when done correctly, different implementations of these services lead to management complexity when the applications are deployed. - -%package lib -Summary: ZooKeeper C binding library -Group: System/Libraries -#Requires: %{name} == %{version} -Provides: zookeeper-lib - -%description lib -ZooKeeper C client library for communicating with ZooKeeper Server. - -%prep -%setup -D -b 1 -n %{_final_name} -%setup -D -a 0 -n %{_final_name} - -%build -mkdir -p ${RPM_BUILD_DIR}%{_prefix} -mkdir -p ${RPM_BUILD_DIR}%{_bin_dir} -mkdir -p ${RPM_BUILD_DIR}%{_include_dir} -mkdir -p ${RPM_BUILD_DIR}%{_lib_dir} -%ifarch amd64 x86_64 -mkdir -p ${RPM_BUILD_DIR}%{_lib64_dir} -%endif -mkdir -p ${RPM_BUILD_DIR}%{_libexec_dir} -mkdir -p ${RPM_BUILD_DIR}%{_log_dir} -mkdir -p ${RPM_BUILD_DIR}%{_conf_dir} -mkdir -p ${RPM_BUILD_DIR}%{_man_dir} -mkdir -p ${RPM_BUILD_DIR}%{_pid_dir} -mkdir -p ${RPM_BUILD_DIR}%{_sbin_dir} -mkdir -p ${RPM_BUILD_DIR}%{_share_dir} -mkdir -p ${RPM_BUILD_DIR}%{_var_dir} -mkdir -p ${RPM_BUILD_DIR}/etc/init.d - -cp ${RPM_BUILD_DIR}/%{_final_name}/src/packages/rpm/init.d/zookeeper ${RPM_BUILD_DIR}/etc/init.d/zookeeper -cp ${RPM_BUILD_DIR}/%{_final_name}/src/packages/update-zookeeper-env.sh ${RPM_BUILD_DIR}/%{_final_name}/sbin/update-zookeeper-env.sh -chmod 0755 ${RPM_BUILD_DIR}/%{_final_name}/sbin/* -chmod 0755 ${RPM_BUILD_DIR}/etc/init.d/zookeeper - -######################### -#### INSTALL SECTION #### -######################### -%install -pushd ${RPM_BUILD_DIR} -mv ${RPM_BUILD_DIR}/%{_final_name}/bin/* ${RPM_BUILD_DIR}%{_bin_dir} -mv ${RPM_BUILD_DIR}/%{_final_name}/libexec/* ${RPM_BUILD_DIR}%{_libexec_dir} -mv ${RPM_BUILD_DIR}/%{_final_name}/share/zookeeper/* ${RPM_BUILD_DIR}%{_share_dir} -mv ${RPM_BUILD_DIR}/%{_final_name}/conf/* ${RPM_BUILD_DIR}%{_conf_dir} -mv ${RPM_BUILD_DIR}/%{_final_name}/sbin/* ${RPM_BUILD_DIR}%{_sbin_dir} -cp -f ${RPM_BUILD_DIR}%{_conf_dir}/zoo_sample.cfg ${RPM_BUILD_DIR}%{_conf_dir}/zoo.cfg -popd ${RPM_BUILD_DIR} -rm -rf ${RPM_BUILD_DIR}/%{_final_name} - -%pre -getent group hadoop 2>/dev/null >/dev/null || /usr/sbin/groupadd -r hadoop - -/usr/sbin/useradd --comment "ZooKeeper" --shell /bin/bash -M -r --groups hadoop --home %{_share_dir} zookeeper 2> /dev/null || : - -%post -bash ${RPM_INSTALL_PREFIX0}/sbin/update-zookeeper-env.sh \ - --prefix=${RPM_INSTALL_PREFIX0} \ - --conf-dir=${RPM_INSTALL_PREFIX1} \ - --log-dir=${RPM_INSTALL_PREFIX2} \ - --pid-dir=${RPM_INSTALL_PREFIX3} \ - --var-dir=${RPM_INSTALL_PREFIX4} - -%preun -bash ${RPM_INSTALL_PREFIX0}/sbin/update-zookeeper-env.sh \ - --prefix=${RPM_INSTALL_PREFIX0} \ - --conf-dir=${RPM_INSTALL_PREFIX1} \ - --log-dir=${RPM_INSTALL_PREFIX2} \ - --pid-dir=${RPM_INSTALL_PREFIX3} \ - --var-dir=${RPM_INSTALL_PREFIX4} \ - --uninstall - -%files -%defattr(-,root,root) -%attr(0755,root,hadoop) %{_log_dir} -%attr(0775,root,hadoop) %{_pid_dir} -%attr(0775,root,hadoop) /etc/init.d/zookeeper -%config(noreplace) %{_conf_dir}/* -%{_prefix} - -%post lib -/sbin/ldconfig - -%files lib -%defattr(-,root,root) -%{_prefix}/lib/* -%{_prefix}/bin diff --git a/src/packages/templates/conf/zookeeper-env.sh b/src/packages/templates/conf/zookeeper-env.sh deleted file mode 100644 index a9efb63f..00000000 --- a/src/packages/templates/conf/zookeeper-env.sh +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -export JAVA_HOME=${JAVA_HOME} -export ZOO_LOG_DIR=${LOG_DIR} diff --git a/src/packages/update-zookeeper-env.sh b/src/packages/update-zookeeper-env.sh deleted file mode 100644 index 84284874..00000000 --- a/src/packages/update-zookeeper-env.sh +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/env bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This script configures zookeeper-env.sh and zoo.cfg. - -usage() { - echo " -usage: $0 - Required parameters: - --prefix=PREFIX path to install into - - Optional parameters: - --arch=i386 OS Architecture - --conf-dir=/etc/zookeeper Configuration directory - --log-dir=/var/log/zookeeper Log directory - --pid-dir=/var/run PID file location - " - exit 1 -} - -template_generator() { - REGEX='(\$\{[a-zA-Z_][a-zA-Z_0-9]*\})' - cat $1 | - while read line ; do - while [[ "$line" =~ $REGEX ]] ; do - LHS=${BASH_REMATCH[1]} - RHS="$(eval echo "\"$LHS\"")" - line=${line//$LHS/$RHS} - done - echo $line >> $2 - done -} - -OPTS=$(getopt \ - -n $0 \ - -o '' \ - -l 'arch:' \ - -l 'prefix:' \ - -l 'conf-dir:' \ - -l 'log-dir:' \ - -l 'pid-dir:' \ - -l 'var-dir:' \ - -l 'uninstall' \ - -- "$@") - -if [ $? != 0 ] ; then - usage -fi - -eval set -- "${OPTS}" -while true ; do - case "$1" in - --arch) - ARCH=$2 ; shift 2 - ;; - --prefix) - PREFIX=$2 ; shift 2 - ;; - --log-dir) - LOG_DIR=$2 ; shift 2 - ;; - --lib-dir) - LIB_DIR=$2 ; shift 2 - ;; - --conf-dir) - CONF_DIR=$2 ; shift 2 - ;; - --pid-dir) - PID_DIR=$2 ; shift 2 - ;; - --uninstall) - UNINSTALL=1; shift - ;; - --var-dir) - VAR_DIR=$2 ; shift 2 - ;; - --) - shift ; break - ;; - *) - echo "Unknown option: $1" - usage - exit 1 - ;; - esac -done - -for var in PREFIX; do - if [ -z "$(eval "echo \$$var")" ]; then - echo Missing param: $var - usage - fi -done - -ARCH=${ARCH:-i386} -CONF_DIR=${CONF_DIR:-$PREFIX/etc/zookeeper} -LIB_DIR=${LIB_DIR:-$PREFIX/lib} -LOG_DIR=${LOG_DIR:-$PREFIX/var/log} -PID_DIR=${PID_DIR:-$PREFIX/var/run} -VAR_DIR=${VAR_DIR:-$PREFIX/var/lib} -UNINSTALL=${UNINSTALL:-0} - -if [ "${ARCH}" != "i386" ]; then - LIB_DIR=${LIB_DIR}64 -fi - -if [ "${UNINSTALL}" -eq "1" ]; then - # Remove symlinks - if [ -e ${PREFIX}/etc/zookeeper ]; then - rm -f ${PREFIX}/etc/zookeeper - fi -else - # Create symlinks - if [ ${CONF_DIR} != ${PREFIX}/etc/zookeeper ]; then - mkdir -p ${PREFIX}/etc - ln -sf ${CONF_DIR} ${PREFIX}/etc/zookeeper - fi - - mkdir -p ${LOG_DIR} - chown zookeeper:hadoop ${LOG_DIR} - chmod 755 ${LOG_DIR} - - if [ ! -d ${PID_DIR} ]; then - mkdir -p ${PID_DIR} - chown zookeeper:hadoop ${PID_DIR} - chmod 755 ${PID_DIR} - fi - - if [ ! -d ${VAR_DIR} ]; then - mkdir -p ${VAR_DIR}/data - chown -R zookeeper:hadoop ${VAR_DIR} - chmod -R 755 ${VAR_DIR} - fi - - TFILE="/tmp/$(basename $0).$$.tmp" - if [ -z "${JAVA_HOME}" ]; then - if [ -e /etc/debian_version ]; then - JAVA_HOME=/usr/lib/jvm/java-6-sun/jre - else - JAVA_HOME=/usr/java/default - fi - fi - template_generator ${PREFIX}/share/zookeeper/templates/conf/zookeeper-env.sh $TFILE - cp ${TFILE} ${CONF_DIR}/zookeeper-env.sh - rm -f ${TFILE} - template_generator ${PREFIX}/share/zookeeper/templates/conf/zoo.cfg $TFILE - cp ${TFILE} ${CONF_DIR}/zoo.cfg - rm -f ${TFILE} -fi diff --git a/src/recipes/build-recipes.xml b/src/recipes/build-recipes.xml index 7200bf67..2aad55a4 100644 --- a/src/recipes/build-recipes.xml +++ b/src/recipes/build-recipes.xml @@ -139,22 +139,6 @@ - - - - - - - - - - - - - - - - diff --git a/src/recipes/build.xml b/src/recipes/build.xml index cd731047..559d5a53 100644 --- a/src/recipes/build.xml +++ b/src/recipes/build.xml @@ -58,22 +58,4 @@ - - - - - - - - - - - - - - - - - -