Updated Branches: refs/heads/master 552f9afcd -> 525e44687
BIGTOP-12. Add HCatalog to Bigtop Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/525e4468 Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/525e4468 Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/525e4468 Branch: refs/heads/master Commit: 525e44687cbc2fa38a1b155ef4b8328d8ac526ba Parents: 6ef2d98 Author: Roman Shaposhnik <[email protected]> Authored: Mon Mar 18 11:01:33 2013 -0700 Committer: Roman Shaposhnik <[email protected]> Committed: Thu Mar 21 11:36:37 2013 -0700 ---------------------------------------------------------------------- .../src/common/hcatalog/do-component-build | 32 ++ .../src/common/hcatalog/hcatalog-server.default | 23 ++ .../src/common/hcatalog/hcatalog-server.svc | 24 ++ bigtop-packages/src/common/hcatalog/hcatalog.1 | 71 +++++ .../src/common/hcatalog/install_hcatalog.sh | 136 +++++++++ .../src/common/hcatalog/webhcat-server.default | 21 ++ .../src/common/hcatalog/webhcat-server.svc | 24 ++ bigtop-packages/src/deb/hcatalog/changelog | 1 + bigtop-packages/src/deb/hcatalog/compat | 1 + bigtop-packages/src/deb/hcatalog/control | 47 +++ bigtop-packages/src/deb/hcatalog/copyright | 16 + bigtop-packages/src/deb/hcatalog/hcatalog.dirs | 4 + bigtop-packages/src/deb/hcatalog/hcatalog.install | 13 + bigtop-packages/src/deb/hcatalog/hcatalog.postinst | 36 +++ bigtop-packages/src/deb/hcatalog/hcatalog.preinst | 50 +++ bigtop-packages/src/deb/hcatalog/hcatalog.prerm | 57 ++++ bigtop-packages/src/deb/hcatalog/rules | 53 ++++ bigtop-packages/src/deb/hcatalog/source/format | 1 + bigtop-packages/src/deb/hcatalog/webhcat.install | 5 + bigtop-packages/src/deb/hcatalog/webhcat.postinst | 34 +++ bigtop-packages/src/deb/hcatalog/webhcat.prerm | 57 ++++ .../src/rpm/hcatalog/SPECS/hcatalog.spec | 230 +++++++++++++++ bigtop.mk | 15 + 23 files changed, 951 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/common/hcatalog/do-component-build ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hcatalog/do-component-build b/bigtop-packages/src/common/hcatalog/do-component-build new file mode 100755 index 0000000..300516b --- /dev/null +++ b/bigtop-packages/src/common/hcatalog/do-component-build @@ -0,0 +1,32 @@ +#!/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. + +set -ex + +. `dirname ${0}`/bigtop.bom + +BUILD_OPTS="-Dforrest.home=${FORREST_HOME} \ + -Dreactor.repo=file://${HOME}/.m2/repository \ + -Dversion=${HCATALOG_VERSION} \ + -Dmvn.hadoop.profile=hadoop23 \ + -Dhadoop23.version=${HADOOP_VERSION} \ + -Dhbase.version=${HBASE_VERSION} \ + -Dhive.version=${HIVE_VERSION} \ + -Dpig.version=${PIG_VERSION} \ + -Dzookeeper.version=${ZOOKEEPER_VERSION}" + + +ant $BUILD_OPTS src-release package "$@" http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/common/hcatalog/hcatalog-server.default ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hcatalog/hcatalog-server.default b/bigtop-packages/src/common/hcatalog/hcatalog-server.default new file mode 100644 index 0000000..950cf22 --- /dev/null +++ b/bigtop-packages/src/common/hcatalog/hcatalog-server.default @@ -0,0 +1,23 @@ +# 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 METASTORE_PORT=9083 + +export HADOOP_PREFIX=/usr +export HCAT_LOG_DIR=/var/log/hcatalog +export HCAT_PID_DIR=/var/run/hcatalog +# FIXME: HCATALOG-636 (and also HIVE-2757) +export HADOOP_HOME=${HADOOP_HOME:-/usr/lib/hadoop} +export HIVE_HOME=/usr/lib/hive http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/common/hcatalog/hcatalog-server.svc ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hcatalog/hcatalog-server.svc b/bigtop-packages/src/common/hcatalog/hcatalog-server.svc new file mode 100644 index 0000000..04aaaf2 --- /dev/null +++ b/bigtop-packages/src/common/hcatalog/hcatalog-server.svc @@ -0,0 +1,24 @@ +# 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. +DAEMON="hcatalog-server" +DESC="HCatalog server" +EXEC_PATH="/usr/lib/hcatalog/sbin/hcat_server.sh" +SVC_USER="hcatalog" +DAEMON_FLAGS="" +CONF_DIR="/etc/hcatalog/conf" +# FIXME: HCATALOG-636 +PIDFILE="/var/run/hcatalog/hcat.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="hcatalog-server" http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/common/hcatalog/hcatalog.1 ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hcatalog/hcatalog.1 b/bigtop-packages/src/common/hcatalog/hcatalog.1 new file mode 100644 index 0000000..2a63cb7 --- /dev/null +++ b/bigtop-packages/src/common/hcatalog/hcatalog.1 @@ -0,0 +1,71 @@ +.\" 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. +.\" +.\" Process this file with +.\" groff -man -Tascii hcatalog.1 +.\" +.TH hcatalog 1 "October 2010-2013 " Linux "User Manuals" + +.SH NAME +Apache Hcatalog (incubating) \- Data warehouse infrastructure built atop Apache Hadoop. + +.SH SYNOPSIS + +.B hcat +[options] -e[xecute] "<query>" + +.B hcat +[options] [-f[ile]] file : DDL commands it needs to execute + +.SH DESCRIPTION +Apache HCatalog (incubating) is a table and storage management layer for Apache Hadoop +that enables users with different data processing tools â Apache Pig, +Apache MapReduce, and Apache Hive â to more easily read and write data +on the grid. Apache HCatalogâs table abstraction presents users with a +relational view of data in the Hadoop distributed file system (HDFS) +and ensures that users need not worry about where or in what format their +data is stored â RCFile format, text files, or sequence files. + +Apache HCatalog (incubating) supports reading and writing files in any format for which +a SerDe can be written. By default, HCatalog supports RCFile, CSV, +JSON, and sequence file formats. To use a custom format, you must +provide the InputFormat, OutputFormat, and SerDe. + +For more information about Apache Hcatalog (incubating), see http://incubator.apache.org/hcatalog/ + +.SH OPTIONS + +.IP "-g" +Usage is -g mygroup ...This indicates to Apache HCatalog (incubating) that table that needs +to be created must have group "mygroup" + +.IP "-p" +Usage is -p rwxr-xr-x ...This indicates to Apache HCatalog (incubating) that table that needs +to be created must have permissions "rwxr-xr-x" + +.IP "-D" +Usage is -Dkey=value ...The key value pair is passed to Apache HCatalog (incubating) as a +Java System Property. + +.IP "-e" +Usage is -e 'create table mytable(a int);'...This indicates to Apache HCatalog (incubating) +to treat the following string as a DDL command and execute it. + +.IP "-f" +Usage is -f myscript.hcatalog ...This indicates to Apache HCatalog that +myscript.hcatalog is a file which contains DDL commands it needs to execute. + +.SH COPYRIGHT +Copyright (C) 2010 The Apache Software Foundation. All rights reserved. http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/common/hcatalog/install_hcatalog.sh ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hcatalog/install_hcatalog.sh b/bigtop-packages/src/common/hcatalog/install_hcatalog.sh new file mode 100644 index 0000000..e90e092 --- /dev/null +++ b/bigtop-packages/src/common/hcatalog/install_hcatalog.sh @@ -0,0 +1,136 @@ +#!/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. +set -xe +usage() { + echo " +usage: $0 <options> + Required not-so-options: + --build-dir=DIR path to hcatalog/build/dist + --prefix=PREFIX path to install into + + Optional options: + --doc-dir=DIR path to install docs into [/usr/share/doc/hcatalog] + --lib-dir=DIR path to install hcatalog home [/usr/lib/hcatalog] + --installed-lib-dir=DIR path where lib-dir will end up on target system + --bin-dir=DIR path to install bins [/usr/bin] + --examples-dir=DIR path to install examples [doc-dir/examples] + ... [ see source for more similar options ] + " + exit 1 +} + +OPTS=$(getopt \ + -n $0 \ + -o '' \ + -l 'prefix:' \ + -l 'doc-dir:' \ + -l 'lib-dir:' \ + -l 'installed-lib-dir:' \ + -l 'bin-dir:' \ + -l 'examples-dir:' \ + -l 'build-dir:' -- "$@") + +if [ $? != 0 ] ; then + usage +fi + +eval set -- "$OPTS" +while true ; do + case "$1" in + --prefix) + PREFIX=$2 ; shift 2 + ;; + --build-dir) + BUILD_DIR=$2 ; shift 2 + ;; + --doc-dir) + DOC_DIR=$2 ; shift 2 + ;; + --lib-dir) + LIB_DIR=$2 ; shift 2 + ;; + --installed-lib-dir) + INSTALLED_LIB_DIR=$2 ; shift 2 + ;; + --bin-dir) + BIN_DIR=$2 ; shift 2 + ;; + --examples-dir) + EXAMPLES_DIR=$2 ; shift 2 + ;; + --) + shift ; break + ;; + *) + echo "Unknown option: $1" + usage + exit 1 + ;; + esac +done + +for var in PREFIX BUILD_DIR ; do + if [ -z "$(eval "echo \$$var")" ]; then + echo Missing param: $var + usage + fi +done + +MAN_DIR=/usr/share/man/man1 +DOC_DIR=${DOC_DIR:-/usr/share/hcatalog} +LIB_DIR=${LIB_DIR:-/usr/lib/hcatalog} +LIB_SHARE_DIR=${LIB_DIR}/share/hcatalog +INSTALLED_LIB_DIR=${INSTALLED_LIB_DIR:-/usr/lib/hcatalog} +BIN_DIR=${BIN_DIR:-/usr/bin} + + +# First we'll move everything into lib +install -d -m 0755 ${PREFIX}/${LIB_DIR} +(cd $BUILD_DIR && tar -cf - .) | (cd ${PREFIX}/$LIB_DIR && tar -xf -) +install -d -m 0755 ${PREFIX}/${BIN_DIR} + +# Take care of the configs +install -d -m 0755 ${PREFIX}/etc/default +for conf in `cd ${PREFIX}/${LIB_DIR}/etc ; ls -d *` ; do + install -d -m 0755 ${PREFIX}/etc/$conf + mv ${PREFIX}/${LIB_DIR}/etc/$conf ${PREFIX}/etc/$conf/conf.dist + ln -s /etc/$conf/conf ${PREFIX}/${LIB_DIR}/etc/$conf + touch ${PREFIX}/etc/default/$conf-server +done + +wrapper=${PREFIX}/$BIN_DIR/hcat +cat >>$wrapper <<EOF +#!/bin/sh +. /etc/default/hadoop + +# Autodetect JAVA_HOME if not defined +. /usr/lib/bigtop-utils/bigtop-detect-javahome + +export HCATALOG_HOME=$INSTALLED_LIB_DIR +exec $INSTALLED_LIB_DIR/bin/hcat "\$@" +EOF +chmod 755 $wrapper + +# Install the docs +install -d -m 0755 ${DOC_DIR} +mv ${PREFIX}/$LIB_DIR/share/doc/hcatalog/* ${DOC_DIR} +install -d -m 0755 ${PREFIX}/$MAN_DIR +gzip -c hcatalog.1 > ${PREFIX}/$MAN_DIR/hcatalog.1.gz + +# Provide the runtime dirs +install -d -m 0755 $PREFIX/var/run/hcatalog +install -d -m 0755 $PREFIX/var/log/hcatalog http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/common/hcatalog/webhcat-server.default ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hcatalog/webhcat-server.default b/bigtop-packages/src/common/hcatalog/webhcat-server.default new file mode 100644 index 0000000..d85d66a --- /dev/null +++ b/bigtop-packages/src/common/hcatalog/webhcat-server.default @@ -0,0 +1,21 @@ +# 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 HCAT_PREFIX=/usr +export HADOOP_PREFIX=/usr +export WEBHCAT_LOG_DIR=/var/log/hcatalog +export WEBHCAT_PID_DIR=/var/run/hcatalog +# FIXME: HCATALOG-636 +export HIVE_HOME=/usr/lib/hive http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/common/hcatalog/webhcat-server.svc ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hcatalog/webhcat-server.svc b/bigtop-packages/src/common/hcatalog/webhcat-server.svc new file mode 100644 index 0000000..6f275f7 --- /dev/null +++ b/bigtop-packages/src/common/hcatalog/webhcat-server.svc @@ -0,0 +1,24 @@ +# 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. +DAEMON="webhcat-server" +DESC="WEBHCat server" +EXEC_PATH="/usr/lib/hcatalog/sbin/webhcat_server.sh" +SVC_USER="hcatalog" +DAEMON_FLAGS="" +CONF_DIR="/etc/webhcat/conf" +# FIXME: HCATALOG-636 +PIDFILE="/var/run/hcatalog/webhcat.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="webhcat-server" http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/deb/hcatalog/changelog ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hcatalog/changelog b/bigtop-packages/src/deb/hcatalog/changelog new file mode 100644 index 0000000..547ed02 --- /dev/null +++ b/bigtop-packages/src/deb/hcatalog/changelog @@ -0,0 +1 @@ +--- This is auto-generated http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/deb/hcatalog/compat ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hcatalog/compat b/bigtop-packages/src/deb/hcatalog/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/bigtop-packages/src/deb/hcatalog/compat @@ -0,0 +1 @@ +7 http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/deb/hcatalog/control ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hcatalog/control b/bigtop-packages/src/deb/hcatalog/control new file mode 100644 index 0000000..7d114d8 --- /dev/null +++ b/bigtop-packages/src/deb/hcatalog/control @@ -0,0 +1,47 @@ +# 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: hcatalog +Section: misc +Priority: extra +Maintainer: Apache Bigtop <[email protected]> +Build-Depends: debhelper (>= 7.0.50~), ant, ant-optional +Standards-Version: 3.8.0 +Homepage: http://incubator.apache.org/hcatalog/ + +Package: hcatalog +Architecture: all +Depends: hadoop, hive, bigtop-utils +Description: Apache HCatalog (incubating) is a table and storage management service. + Apache HCatalog (incubating) is a table and storage management service for data created using Apache Hadoop. + +Package: hcatalog-server +Architecture: all +Depends: hcatalog (= ${source:Version}) +Description: Server for HCatalog. + Server for HCatalog. + +Package: webhcat +Architecture: all +Depends: hcatalog (= ${source:Version}) +Description: WEBHcat provides a REST-like web API for HCatalog and related Hadoop components. + WEBHcat provides a REST-like web API for HCatalog and related Hadoop components. + +Package: webhcat-server +Architecture: all +Depends: webhcat (= ${source:Version}) +Description: Server for WEBHcat. + Server for WEBHcat. + http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/deb/hcatalog/copyright ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hcatalog/copyright b/bigtop-packages/src/deb/hcatalog/copyright new file mode 100644 index 0000000..f8ff577 --- /dev/null +++ b/bigtop-packages/src/deb/hcatalog/copyright @@ -0,0 +1,16 @@ +Format: http://dep.debian.net/deps/dep5 +Source: http://incubator.apache.org/hcatalog +Upstream-Name: Apache Hcatalog (incubating) + +Files: * +Copyright: 2008-2011, The Apache Software Foundation +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". + http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/deb/hcatalog/hcatalog.dirs ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hcatalog/hcatalog.dirs b/bigtop-packages/src/deb/hcatalog/hcatalog.dirs new file mode 100644 index 0000000..50c37cb --- /dev/null +++ b/bigtop-packages/src/deb/hcatalog/hcatalog.dirs @@ -0,0 +1,4 @@ +/usr/lib/hcatalog +/usr/lib/hcatalog/bin +/usr/bin +/usr/share/doc/hcatalog http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/deb/hcatalog/hcatalog.install ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hcatalog/hcatalog.install b/bigtop-packages/src/deb/hcatalog/hcatalog.install new file mode 100644 index 0000000..3f9aa4b --- /dev/null +++ b/bigtop-packages/src/deb/hcatalog/hcatalog.install @@ -0,0 +1,13 @@ +/etc/hcatalog/conf.dist +/usr/lib/hcatalog/bin +/usr/lib/hcatalog/etc/hcatalog +/usr/lib/hcatalog/libexec +/usr/lib/hcatalog/share/hcatalog +/usr/lib/hcatalog/share/doc +/usr/lib/hcatalog/sbin/hcat_server.sh +/usr/lib/hcatalog/sbin/update-hcatalog-env.sh +/usr/bin/hcat +/usr/share/doc +/usr/share/man/man1 +/var/run/hcatalog +/var/log/hcatalog http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/deb/hcatalog/hcatalog.postinst ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hcatalog/hcatalog.postinst b/bigtop-packages/src/deb/hcatalog/hcatalog.postinst new file mode 100644 index 0000000..b7d80ff --- /dev/null +++ b/bigtop-packages/src/deb/hcatalog/hcatalog.postinst @@ -0,0 +1,36 @@ +#!/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. + +set -e + +case "$1" in + configure) + # Install config alternatives + update-alternatives --install /etc/hcatalog/conf hcatalog-conf /etc/hcatalog/conf.dist 30 + chown hcatalog:hcatalog /var/run/hcatalog || : + chown hcatalog:hcatalog /var/log/hcatalog || : + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/deb/hcatalog/hcatalog.preinst ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hcatalog/hcatalog.preinst b/bigtop-packages/src/deb/hcatalog/hcatalog.preinst new file mode 100644 index 0000000..acaca99 --- /dev/null +++ b/bigtop-packages/src/deb/hcatalog/hcatalog.preinst @@ -0,0 +1,50 @@ +#!/bin/sh +# 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 hcatalog +# +# 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 hcatalog >/dev/null; then + adduser \ + --system \ + --group \ + --home /usr/lib/hcatalog \ + --gecos "HCatalog User" \ + --shell /bin/false \ + hcatalog >/dev/null + fi + ;; + + 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 http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/deb/hcatalog/hcatalog.prerm ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hcatalog/hcatalog.prerm b/bigtop-packages/src/deb/hcatalog/hcatalog.prerm new file mode 100644 index 0000000..87a0129 --- /dev/null +++ b/bigtop-packages/src/deb/hcatalog/hcatalog.prerm @@ -0,0 +1,57 @@ +#!/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. + +# prerm script for hcatalog +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <prerm> `remove' +# * <old-prerm> `upgrade' <new-version> +# * <new-prerm> `failed-upgrade' <old-version> +# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> +# * <deconfigured's-prerm> `deconfigure' `in-favour' +# <package-being-installed> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + update-alternatives --remove hcatalog-conf /etc/hcatalog/conf.dist || : + ;; + + failed-upgrade) + ;; + + *) + echo "prerm 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 + + http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/deb/hcatalog/rules ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hcatalog/rules b/bigtop-packages/src/deb/hcatalog/rules new file mode 100644 index 0000000..d41e29f --- /dev/null +++ b/bigtop-packages/src/deb/hcatalog/rules @@ -0,0 +1,53 @@ +#!/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 + +hcatalog_pkg_name=hcatalog + +%: + dh $@ + +override_dh_auto_clean: + @echo FXIME: we need to fix ant clean in hcat itself + +override_dh_auto_build: + # we'll just use the build from the tarball. + env bash -x debian/do-component-build + +svcs=hcatalog-server webhcat-server + +$(svcs): debian/init.d.tmpl + bash $< debian/[email protected] deb debian/[email protected] + mkdir -p debian/tmp/etc/default 2>/dev/null || : + cp debian/[email protected] debian/tmp/etc/default/$@ + echo /etc/default/$@ >> debian/[email protected] + touch $@ + +override_dh_auto_install: $(svcs) + cp debian/hcatalog.1 . + sh -x debian/install_hcatalog.sh \ + --build-dir=build/hcatalog-$(strip ${HCATALOG_BASE_VERSION}) \ + --prefix=debian/tmp \ + --doc-dir=debian/tmp/usr/share/doc/${hcatalog_pkg_name} \ + --examples-dir=debian/tmp/usr/share/doc/${hcatalog_pkg_name}/examples http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/deb/hcatalog/source/format ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hcatalog/source/format b/bigtop-packages/src/deb/hcatalog/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/bigtop-packages/src/deb/hcatalog/source/format @@ -0,0 +1 @@ +3.0 (quilt) http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/deb/hcatalog/webhcat.install ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hcatalog/webhcat.install b/bigtop-packages/src/deb/hcatalog/webhcat.install new file mode 100644 index 0000000..bcacd00 --- /dev/null +++ b/bigtop-packages/src/deb/hcatalog/webhcat.install @@ -0,0 +1,5 @@ +/etc/webhcat/conf.dist +/usr/lib/hcatalog/etc/webhcat +/usr/lib/hcatalog/share/webhcat +/usr/lib/hcatalog/sbin/webhcat_config.sh +/usr/lib/hcatalog/sbin/webhcat_server.sh http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/deb/hcatalog/webhcat.postinst ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hcatalog/webhcat.postinst b/bigtop-packages/src/deb/hcatalog/webhcat.postinst new file mode 100644 index 0000000..0b2dbc3 --- /dev/null +++ b/bigtop-packages/src/deb/hcatalog/webhcat.postinst @@ -0,0 +1,34 @@ +#!/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. + +set -e + +case "$1" in + configure) + # Install config alternatives + update-alternatives --install /etc/webhcat/conf webhcat-conf /etc/webhcat/conf.dist 30 + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/deb/hcatalog/webhcat.prerm ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/deb/hcatalog/webhcat.prerm b/bigtop-packages/src/deb/hcatalog/webhcat.prerm new file mode 100644 index 0000000..b339855 --- /dev/null +++ b/bigtop-packages/src/deb/hcatalog/webhcat.prerm @@ -0,0 +1,57 @@ +#!/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. + +# prerm script for webhcat +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <prerm> `remove' +# * <old-prerm> `upgrade' <new-version> +# * <new-prerm> `failed-upgrade' <old-version> +# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> +# * <deconfigured's-prerm> `deconfigure' `in-favour' +# <package-being-installed> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + update-alternatives --remove webhcat-conf /etc/webhcat/conf.dist || : + ;; + + failed-upgrade) + ;; + + *) + echo "prerm 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 + + http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/rpm/hcatalog/RPMS/.gitignore ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/rpm/hcatalog/RPMS/.gitignore b/bigtop-packages/src/rpm/hcatalog/RPMS/.gitignore new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/rpm/hcatalog/SPECS/.gitignore ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/rpm/hcatalog/SPECS/.gitignore b/bigtop-packages/src/rpm/hcatalog/SPECS/.gitignore new file mode 100644 index 0000000..e69de29 http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop-packages/src/rpm/hcatalog/SPECS/hcatalog.spec ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/rpm/hcatalog/SPECS/hcatalog.spec b/bigtop-packages/src/rpm/hcatalog/SPECS/hcatalog.spec new file mode 100644 index 0000000..3fd9889 --- /dev/null +++ b/bigtop-packages/src/rpm/hcatalog/SPECS/hcatalog.spec @@ -0,0 +1,230 @@ +# 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. +%define conf_hcatalog %{_sysconfdir}/%{name}/conf +%define conf_webhcat %{_sysconfdir}/webhcat/conf +%define usr_lib_hcatalog /usr/lib/%{name} +%define bin_hcatalog /usr/bin +%define man_dir %{_mandir} +%define hcatalog_svcs hcatalog-server webhcat-server +# After we run "ant package" we'll find the distribution here +%define hcatalog_dist build/hcatalog-%{hcatalog_base_version} + +%if %{!?suse_version:1}0 + +%define doc_hcatalog %{_docdir}/%{name}-%{hcatalog_version} +%define initd_dir %{_sysconfdir}/rc.d/init.d +%define alternatives_cmd alternatives + +%else + +# Only tested on openSUSE 11.4. le'ts update it for previous release when confirmed +%if 0%{suse_version} > 1130 +%define suse_check \# Define an empty suse_check for compatibility with older sles +%endif + +%define doc_hcatalog %{_docdir}/%{name} +%define initd_dir %{_sysconfdir}/rc.d +%define alternatives_cmd update-alternatives + +%define __os_install_post \ + %{suse_check} ; \ + /usr/lib/rpm/brp-compress ; \ + %{nil} +%endif + + +Name: hcatalog +Version: %{hcatalog_version} +Release: %{hcatalog_release} +Summary: Apache Hcatalog (incubating) is a data warehouse infrastructure built on top of Hadoop +License: Apache License v2.0 +URL: http://incubator.apache.org/hcatalog +Group: Development/Libraries +Buildroot: %{_topdir}/INSTALL/%{name}-%{version} +BuildArch: noarch +Source0: %{name}-%{hcatalog_base_version}.tar.gz +Source1: do-component-build +Source2: install_hcatalog.sh +Source3: hcatalog.1 +Source4: hcatalog-server.svc +Source5: webhcat-server.svc +Source6: hcatalog-server.default +Source7: webhcat-server.default +Source8: init.d.tmpl +Requires: hadoop, hive, bigtop-utils + +%description +Apache HCatalog (incubating) is a table and storage management service for data created using Apache Hadoop. +This includes: + * Providing a shared schema and data type mechanism. + * Providing a table abstraction so that users need not be concerned with where or how their data is stored. + * Providing interoperability across data processing tools such as Pig, Map Reduce, Streaming, and Hive. + + +%package -n webhcat +Summary: WEBHcat provides a REST-like web API for HCatalog and related Hadoop components. +Group: Development/Libraries +Requires: hcatalog = %{version}-%{release} + +%description -n webhcat +WEBHcat provides a REST-like web API for HCatalog and related Hadoop components. + + +%package server +Summary: Server for HCatalog. +Group: System/Daemons +Requires: hcatalog = %{version}-%{release} + +%if %{?suse_version:1}0 +# Required for init scripts +Requires: insserv +%endif + +%if 0%{?mgaversion} +# Required for init scripts +Requires: initscripts +%endif + +# CentOS 5 does not have any dist macro +# So I will suppose anything that is not Mageia or a SUSE will be a RHEL/CentOS/Fedora +%if %{!?suse_version:1}0 && %{!?mgaversion:1}0 +# Required for init scripts +Requires: redhat-lsb +%endif + +%description server +Server for HCatalog. + +%package -n webhcat-server +Summary: Server for WEBHcat. +Group: System/Daemons +Requires: webhcat = %{version}-%{release} + +%if %{?suse_version:1}0 +# Required for init scripts +Requires: insserv +%endif + +%if 0%{?mgaversion} +# Required for init scripts +Requires: initscripts +%endif + +# CentOS 5 does not have any dist macro +# So I will suppose anything that is not Mageia or a SUSE will be a RHEL/CentOS/Fedora +%if %{!?suse_version:1}0 && %{!?mgaversion:1}0 +# Required for init scripts +Requires: redhat-lsb +%endif + +%description -n webhcat-server +Server for WEBHcat. + +%prep +%setup -n %{name}-src-%{hcatalog_base_version} + +%build +env bash %{SOURCE1} + +######################### +#### INSTALL SECTION #### +######################### +%install +%__rm -rf $RPM_BUILD_ROOT +cp $RPM_SOURCE_DIR/hcatalog.1 . +/bin/bash %{SOURCE2} \ + --prefix=$RPM_BUILD_ROOT \ + --build-dir=%{hcatalog_dist} \ + --doc-dir=$RPM_BUILD_ROOT/%{doc_hcatalog} + +# Install init script +for svc in %{hcatalog_svcs} ; do + bash $RPM_SOURCE_DIR/init.d.tmpl $RPM_SOURCE_DIR/$svc.svc rpm \ + $RPM_BUILD_ROOT/%{initd_dir}/$svc +done + +# Install defaults +%__install -d -m 0755 $RPM_BUILD_ROOT/etc/default/ +%__install -m 0644 %{SOURCE6} $RPM_BUILD_ROOT/etc/default/hcatalog-server +%__install -m 0644 %{SOURCE7} $RPM_BUILD_ROOT/etc/default/webhcat-server + +# Service file management RPMs +%define service_macro() \ +%files -n %1 \ +%defattr(-,root,root) \ +%{initd_dir}/%1 \ +%config(noreplace) /etc/default/%1 \ +%post -n %1 \ +chkconfig --add %1 \ +\ +%preun -n %1 \ +if [ $1 = 0 ]; then \ + service %1 stop > /dev/null 2>&1 \ + chkconfig --del %1 \ +fi \ +%postun -n %1 \ +if [ $1 -ge 1 ]; then \ + service %1 condrestart >/dev/null 2>&1 \ +fi + +%service_macro hcatalog-server +%service_macro webhcat-server + +%pre +getent group hcatalog >/dev/null || groupadd -r hcatalog || : +getent passwd hcatalog >/dev/null || useradd -c "HCatalog User" -s /sbin/nologin -g hcatalog -r -d %{usr_lib_hcatalog} hcatalog 2> /dev/null || : + +%post +%{alternatives_cmd} --install %{conf_hcatalog} hcatalog-conf %{conf_hcatalog}.dist 30 + +%preun +if [ "$1" = 0 ]; then + %{alternatives_cmd} --remove hcatalog-conf %{conf_hcatalog}.dist || : +fi + +%post -n webhcat +%{alternatives_cmd} --install %{conf_webhcat} webhcat-conf %{conf_webhcat}.dist 30 + +%preun -n webhcat +if [ "$1" = 0 ]; then + %{alternatives_cmd} --remove webhcat-conf %{conf_webhcat}.dist || : +fi + +####################### +#### FILES SECTION #### +####################### +%files +%defattr(-,root,root,755) +%config(noreplace) %attr(755,root,root) %{conf_hcatalog}.dist +%{usr_lib_hcatalog}/bin +%{usr_lib_hcatalog}/etc/hcatalog +%{usr_lib_hcatalog}/libexec +%{usr_lib_hcatalog}/share/hcatalog +%{usr_lib_hcatalog}/share/doc +%{usr_lib_hcatalog}/sbin/hcat_server.sh +%{usr_lib_hcatalog}/sbin/update-hcatalog-env.sh +%{bin_hcatalog}/hcat +%doc %{doc_hcatalog} +%{man_dir}/man1/hcatalog.1.* +%attr(755,hcatalog,hcatalog) /var/run/hcatalog +%attr(755,hcatalog,hcatalog) /var/log/hcatalog + +%files -n webhcat +%defattr(-,root,root,755) +%config(noreplace) %attr(755,root,root) %{conf_webhcat}.dist +%{usr_lib_hcatalog}/share/webhcat +%{usr_lib_hcatalog}/etc/webhcat +%{usr_lib_hcatalog}/sbin/webhcat_config.sh +%{usr_lib_hcatalog}/sbin/webhcat_server.sh http://git-wip-us.apache.org/repos/asf/bigtop/blob/525e4468/bigtop.mk ---------------------------------------------------------------------- diff --git a/bigtop.mk b/bigtop.mk index a1bea17..3abc9fa 100644 --- a/bigtop.mk +++ b/bigtop.mk @@ -84,6 +84,21 @@ HIVE_SITE=$(APACHE_MIRROR)$(HIVE_DOWNLOAD_PATH) HIVE_ARCHIVE=$(APACHE_ARCHIVE)$(HIVE_DOWNLOAD_PATH) $(eval $(call PACKAGE,hive,HIVE)) +# HCatalog +HCATALOG_NAME=hcatalog +HCATALOG_RELNOTES_NAME=Apache HCatalog (incubating) +HCATALOG_PKG_NAME=hcatalog +HCATALOG_BASE_VERSION=0.5.0-incubating +HCATALOG_PKG_VERSION=0.5.0 +HCATALOG_RELEASE_VERSION=1 +HCATALOG_TARBALL_DST=$(HCATALOG_NAME)-$(HCATALOG_BASE_VERSION).tar.gz +HCATALOG_TARBALL_SRC=$(HCATALOG_NAME)-src-$(HCATALOG_BASE_VERSION).tar.gz +HCATALOG_DOWNLOAD_PATH=/incubator/hcatalog/hcatalog-$(HCATALOG_BASE_VERSION)/ +HCATALOG_SITE=$(APACHE_MIRROR)$(HCATALOG_DOWNLOAD_PATH) +HCATALOG_ARCHIVE=$(APACHE_ARCHIVE)$(HCATALOG_DOWNLOAD_PATH) +HCATALOG_SITE=$(APACHE_ARCHIVE) +$(eval $(call PACKAGE,hcatalog,HCATALOG)) + # Sqoop SQOOP_NAME=sqoop SQOOP_RELNOTES_NAME=Sqoop
