aboutsummaryrefslogtreecommitdiff
path: root/bigtop-packages/src/deb/sqoop
diff options
context:
space:
mode:
authorAndrew Bayer <abayer@apache.org>2011-08-31 22:57:21 +0000
committerAndrew Bayer <abayer@apache.org>2011-08-31 22:57:21 +0000
commit44e22d9f4082614bbd4876ca1110586afe2943ca (patch)
treeb1f60ae4760e4e8504794b606974f805240e66a5 /bigtop-packages/src/deb/sqoop
parent6f3cbe0f3fafa252995453986e8f3fcab685d8c1 (diff)
Fixes BIGTOP-51. Reorganizes source repository.
Leaving site modules as is for the moment. Will clean them up later once we figure out how we want to reconcile the two existing ones. git-svn-id: https://svn.apache.org/repos/asf/incubator/bigtop/trunk@1163857 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'bigtop-packages/src/deb/sqoop')
-rw-r--r--bigtop-packages/src/deb/sqoop/changelog1
-rw-r--r--bigtop-packages/src/deb/sqoop/compat1
-rw-r--r--bigtop-packages/src/deb/sqoop/control35
-rw-r--r--bigtop-packages/src/deb/sqoop/copyright15
-rwxr-xr-xbigtop-packages/src/deb/sqoop/rules75
-rw-r--r--bigtop-packages/src/deb/sqoop/sqoop-metastore.init183
-rw-r--r--bigtop-packages/src/deb/sqoop/sqoop-metastore.postinst35
-rw-r--r--bigtop-packages/src/deb/sqoop/sqoop-metastore.preinst63
8 files changed, 408 insertions, 0 deletions
diff --git a/bigtop-packages/src/deb/sqoop/changelog b/bigtop-packages/src/deb/sqoop/changelog
new file mode 100644
index 00000000..547ed021
--- /dev/null
+++ b/bigtop-packages/src/deb/sqoop/changelog
@@ -0,0 +1 @@
+--- This is auto-generated
diff --git a/bigtop-packages/src/deb/sqoop/compat b/bigtop-packages/src/deb/sqoop/compat
new file mode 100644
index 00000000..1e8b3149
--- /dev/null
+++ b/bigtop-packages/src/deb/sqoop/compat
@@ -0,0 +1 @@
+6
diff --git a/bigtop-packages/src/deb/sqoop/control b/bigtop-packages/src/deb/sqoop/control
new file mode 100644
index 00000000..45c49db2
--- /dev/null
+++ b/bigtop-packages/src/deb/sqoop/control
@@ -0,0 +1,35 @@
+# 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.
+Source: sqoop
+Section: misc
+Priority: extra
+Maintainer: Alex Newman <newalex@cloudera.com>
+Build-Depends: debhelper (>= 6), ant, sun-java6-jdk, ant-optional, git-core, sed, asciidoc, xmlto
+Standards-Version: 3.8.0
+Homepage: http://www.cloudera.com
+
+Package: sqoop
+Architecture: all
+Depends: sun-java6-jre, hadoop
+Description: Tool for easy imports and exports of data sets between databases and HDFS
+ Sqoop is a tool that provides the ability to import and export data sets between
+ the Hadoop Distributed File System (HDFS) and relational databases.
+
+Package: sqoop-metastore
+Architecture: all
+Depends: sqoop (= ${source:Version}), adduser
+Description: Shared metadata repository for Sqoop.
+ This optional package hosts a metadata server for Sqoop clients across a network to use.
+
diff --git a/bigtop-packages/src/deb/sqoop/copyright b/bigtop-packages/src/deb/sqoop/copyright
new file mode 100644
index 00000000..ba747ef6
--- /dev/null
+++ b/bigtop-packages/src/deb/sqoop/copyright
@@ -0,0 +1,15 @@
+Format: http://dep.debian.net/deps/dep5
+Source: http://incubator.apache.org/projects/sqoop.html
+Upstream-Name: Sqoop
+
+Files: *
+Copyright: 2010-2011, Cloudera, Inc.
+License: Apache-2.0
+
+Files debian/*
+Copyright: 2011, The Apache Software Foundation
+License: Apache-2.0
+
+License: Apache-2.0
+ On Debian systems, the complete text of the Apache 2.0 license
+ can be found in "/usr/share/common-licenses/Apache-2.0".
diff --git a/bigtop-packages/src/deb/sqoop/rules b/bigtop-packages/src/deb/sqoop/rules
new file mode 100755
index 00000000..5fa7c934
--- /dev/null
+++ b/bigtop-packages/src/deb/sqoop/rules
@@ -0,0 +1,75 @@
+#!/usr/bin/make -f
+#
+# 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.
+
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+patch: patch-stamp
+patch-stamp:
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f *-stamp
+ dh_clean
+ rm -Rf debian/tmp debian/sqoop
+ find debian -name .\*swp -exec rm -f {} \;
+
+build-indep: build-indep-stamp
+build-indep-stamp: patch-stamp
+ ant -Divy.home=`pwd`/debian/.ivy -f build.xml package
+ touch $@
+
+install: install-indep
+install-indep:
+ dh_testdir
+ dh_testroot
+ sh -x debian/install_sqoop.sh \
+ --build-dir=. \
+ --prefix=debian/sqoop
+ dh_install -i
+
+binary-common:
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installman
+ dh_link
+ dh_strip
+ dh_compress
+ dh_fixperms
+ dh_makeshlibs
+ dh_installinit
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary-indep: build-indep install-indep
+ $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+
+binary-arch:
+binary: binary-indep
+.PHONY: build clean binary-indep binary install-indep binary-arc
diff --git a/bigtop-packages/src/deb/sqoop/sqoop-metastore.init b/bigtop-packages/src/deb/sqoop/sqoop-metastore.init
new file mode 100644
index 00000000..9901e5f8
--- /dev/null
+++ b/bigtop-packages/src/deb/sqoop/sqoop-metastore.init
@@ -0,0 +1,183 @@
+#!/bin/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.
+#
+# chkconfig: 2345 85 15
+# description: Sqoop allows easy imports and exports of data sets between \
+# databases and the Hadoop Distributed File System (HDFS). The Sqoop \
+# metastore allows users to define saved jobs for repeated execution and \
+# share them with other users of the cluster.
+# processname: java
+# pidfile: /var/run/sqoop/sqoop-metastore.pid
+### BEGIN INIT INFO
+# Provides: Sqoop
+# Required-Start: $network $local_fs $remote_fs
+# Required-Stop: $remote_fs
+# Should-Start: $named
+# Should-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Sqoop allows easy imports and exports of data sets between databases and the Hadoop Distributed File System (HDFS).
+### END INIT INFO
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+NAME=sqoop-metastore
+DESC="Sqoop metastore"
+PID_FILE=/var/run/sqoop/sqoop-metastore.pid
+LOGDIR=/var/log/sqoop
+
+DODTIME=3
+
+# Returns 0 if pid is alive, 1 if not.
+hadoop_is_process_alive() {
+ local pid="$1"
+ ps -fp $pid | grep $pid | grep sqoop > /dev/null 2>&1
+}
+
+hadoop_check_pidfile() {
+ local pidfile="$1" # IN
+ local pid
+
+ pid=`cat "$pidfile" 2>/dev/null`
+ if [ "$pid" = '' ]; then
+ # The file probably does not exist or is empty.
+ return 1
+ fi
+
+ set -- $pid
+ pid="$1"
+
+ hadoop_is_process_alive $pid
+}
+
+hadoop_process_kill() {
+ local pid="$1" # IN
+ local signal="$2" # IN
+ local second
+
+ kill -$signal $pid 2>/dev/null
+
+ # Wait a bit to see if the dirty job has really been done
+ for second in 0 1 2 3 4 5 6 7 8 9 10; do
+ if hadoop_is_process_alive "$pid"; then
+ # Success
+ return 0
+ fi
+
+ sleep 1
+ done
+
+ # Timeout
+ return 1
+}
+hadoop_stop_pidfile() {
+ local pidfile="$1" # IN
+ local pid
+
+ pid=`cat "$pidfile" 2>/dev/null`
+ if [ "$pid" = '' ]; then
+ # The file probably does not exist or is empty. Success
+ return 0
+ fi
+
+ set -- $pid
+ pid="$1"
+
+ # First try the easy way
+ if hadoop_process_kill "$pid" 15; then
+ return 0
+ fi
+
+ # Otherwise try the hard way
+ if hadoop_process_kill "$pid" 9; then
+ return 0
+ fi
+
+ return 1
+}
+
+
+start() {
+ # Pid files created in sqoop-specific directory under /var/run.
+ # The dir should be recreated first.
+ local piddir=`dirname "$PID_FILE"`
+ install -d -m 0755 -o sqoop -g sqoop "$piddir"
+ su -s /bin/sh sqoop -c \
+ "/usr/lib/sqoop/bin/start-metastore.sh -p $PID_FILE -l $LOGDIR"
+}
+stop() {
+ if hadoop_check_pidfile $PID_FILE ; then
+ su -s /bin/sh sqoop -c \
+ "/usr/lib/sqoop/bin/stop-metastore.sh -p $PID_FILE"
+ fi
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ force-stop)
+ echo -n "Forcefully stopping $DESC: "
+ hadoop_stop_pidfile $PID_FILE
+ if ! hadoop_check_pidfile $PID_FILE ; then
+ echo "$NAME."
+ else
+ echo "ERROR."
+ fi
+ rm $PID_FILE
+ ;;
+ force-reload)
+ # check whether $DAEMON is running. If so, restart
+ hadoop_check_pidfile $PID_FILE && $0 restart
+ ;;
+ restart)
+ echo -n "Restarting $DESC: "
+ stop
+ [ -n "$DODTIME" ] && sleep $DODTIME
+ $0 start
+ ;;
+
+
+
+ restart|reload)
+ echo -n "Restarting $DESC: "
+ stop
+ [ -n "$DODTIME" ] && sleep $DODTIME
+ $0 start
+ ;;
+ status)
+ echo -n "$NAME is "
+ if hadoop_check_pidfile $PID_FILE ; then
+ echo "running"
+ else
+ echo "not running."
+ exit 1
+ fi
+ ;;
+
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/bigtop-packages/src/deb/sqoop/sqoop-metastore.postinst b/bigtop-packages/src/deb/sqoop/sqoop-metastore.postinst
new file mode 100644
index 00000000..b8b6635c
--- /dev/null
+++ b/bigtop-packages/src/deb/sqoop/sqoop-metastore.postinst
@@ -0,0 +1,35 @@
+#!/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.
+
+# postinst script for sqoop
+
+set -e
+
+case "$1" in
+ configure)
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
diff --git a/bigtop-packages/src/deb/sqoop/sqoop-metastore.preinst b/bigtop-packages/src/deb/sqoop/sqoop-metastore.preinst
new file mode 100644
index 00000000..76cfb265
--- /dev/null
+++ b/bigtop-packages/src/deb/sqoop/sqoop-metastore.preinst
@@ -0,0 +1,63 @@
+#!/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.
+
+# preinst script for sqoop-metastore
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <new-preinst> `install'
+# * <new-preinst> `install' <old-version>
+# * <new-preinst> `upgrade' <old-version>
+# * <old-preinst> `abort-upgrade' <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ install|upgrade)
+ if ! getent passwd sqoop >/dev/null; then
+ # Adding system user: sqoop .
+ adduser \
+ --system \
+ --group \
+ --home /var/lib/sqoop \
+ --gecos "Sqoop User" \
+ --shell /bin/false \
+ sqoop >/dev/null
+ fi
+ install -d -m 0755 -o sqoop -g sqoop /var/lib/sqoop
+ install -d -m 0755 -o sqoop -g sqoop /var/log/sqoop
+ ;;
+
+ abort-upgrade)
+ ;;
+
+ *)
+ echo "preinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0