You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by da...@apache.org on 2011/08/10 20:09:55 UTC

svn commit: r1156289 - in /pig/branches/branch-0.9/src/packages: ./ deb/ deb/pig.control/ rpm/ rpm/spec/ templates/ templates/conf/

Author: daijy
Date: Wed Aug 10 18:09:55 2011
New Revision: 1156289

URL: http://svn.apache.org/viewvc?rev=1156289&view=rev
Log:
PIG-1857: Create an package integration project

Added:
    pig/branches/branch-0.9/src/packages/
    pig/branches/branch-0.9/src/packages/deb/
    pig/branches/branch-0.9/src/packages/deb/pig.control/
    pig/branches/branch-0.9/src/packages/deb/pig.control/conffile
    pig/branches/branch-0.9/src/packages/deb/pig.control/control
    pig/branches/branch-0.9/src/packages/deb/pig.control/postinst
    pig/branches/branch-0.9/src/packages/deb/pig.control/postrm
    pig/branches/branch-0.9/src/packages/deb/pig.control/preinst
    pig/branches/branch-0.9/src/packages/deb/pig.control/prerm
    pig/branches/branch-0.9/src/packages/rpm/
    pig/branches/branch-0.9/src/packages/rpm/spec/
    pig/branches/branch-0.9/src/packages/rpm/spec/pig.spec
    pig/branches/branch-0.9/src/packages/templates/
    pig/branches/branch-0.9/src/packages/templates/conf/
    pig/branches/branch-0.9/src/packages/templates/conf/pig-env.sh
    pig/branches/branch-0.9/src/packages/update-pig-env.sh

Added: pig/branches/branch-0.9/src/packages/deb/pig.control/conffile
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/src/packages/deb/pig.control/conffile?rev=1156289&view=auto
==============================================================================
--- pig/branches/branch-0.9/src/packages/deb/pig.control/conffile (added)
+++ pig/branches/branch-0.9/src/packages/deb/pig.control/conffile Wed Aug 10 18:09:55 2011
@@ -0,0 +1,2 @@
+/etc/pig
+/etc/pig

Added: pig/branches/branch-0.9/src/packages/deb/pig.control/control
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/src/packages/deb/pig.control/control?rev=1156289&view=auto
==============================================================================
--- pig/branches/branch-0.9/src/packages/deb/pig.control/control (added)
+++ pig/branches/branch-0.9/src/packages/deb/pig.control/control Wed Aug 10 18:09:55 2011
@@ -0,0 +1,18 @@
+Package: pig
+Version: @version@
+Section: misc
+Priority: optional
+Architecture: all
+Depends: sun-java6-jre, hadoop
+Maintainer: Apache Software Foundation <us...@pig.apache.org>
+Description: Apache Pig is a platform for analyzing large data sets that consists of a high-level language for expressing data analysis programs, coupled with infrastructure for evaluating these programs. The salient property of Pig programs is that their structure is amenable to substantial parallelization, which in turns enables them to handle very large data sets.
+Distribution: development
+Package: pig
+Version: @version@
+Section: misc
+Priority: optional
+Architecture: all
+Depends: sun-java6-jre, hadoop
+Maintainer: Apache Software Foundation <us...@pig.apache.org>
+Description: Apache Pig is a platform for analyzing large data sets that consists of a high-level language for expressing data analysis programs, coupled with infrastructure for evaluating these programs. The salient property of Pig programs is that their structure is amenable to substantial parallelization, which in turns enables them to handle very large data sets.
+Distribution: development

Added: pig/branches/branch-0.9/src/packages/deb/pig.control/postinst
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/src/packages/deb/pig.control/postinst?rev=1156289&view=auto
==============================================================================
--- pig/branches/branch-0.9/src/packages/deb/pig.control/postinst (added)
+++ pig/branches/branch-0.9/src/packages/deb/pig.control/postinst Wed Aug 10 18:09:55 2011
@@ -0,0 +1,44 @@
+#!/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-pig-env.sh \
+  --prefix=/usr \
+  --bin-dir=/usr/bin \
+  --conf-dir=/etc/pig \
+  --log-dir=/var/log/pig
+#!/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-pig-env.sh \
+  --prefix=/usr \
+  --bin-dir=/usr/bin \
+  --conf-dir=/etc/pig \
+  --log-dir=/var/log/pig

Added: pig/branches/branch-0.9/src/packages/deb/pig.control/postrm
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/src/packages/deb/pig.control/postrm?rev=1156289&view=auto
==============================================================================
--- pig/branches/branch-0.9/src/packages/deb/pig.control/postrm (added)
+++ pig/branches/branch-0.9/src/packages/deb/pig.control/postrm Wed Aug 10 18:09:55 2011
@@ -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.
+
+exit 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.
+
+exit 0

Added: pig/branches/branch-0.9/src/packages/deb/pig.control/preinst
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/src/packages/deb/pig.control/preinst?rev=1156289&view=auto
==============================================================================
--- pig/branches/branch-0.9/src/packages/deb/pig.control/preinst (added)
+++ pig/branches/branch-0.9/src/packages/deb/pig.control/preinst Wed Aug 10 18:09:55 2011
@@ -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.
+
+getent group hadoop 2>/dev/null >/dev/null || /usr/sbin/groupadd -r hadoop
+#!/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

Added: pig/branches/branch-0.9/src/packages/deb/pig.control/prerm
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/src/packages/deb/pig.control/prerm?rev=1156289&view=auto
==============================================================================
--- pig/branches/branch-0.9/src/packages/deb/pig.control/prerm (added)
+++ pig/branches/branch-0.9/src/packages/deb/pig.control/prerm Wed Aug 10 18:09:55 2011
@@ -0,0 +1,44 @@
+#!/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-pig-env.sh \
+  --prefix=/usr \
+  --bin-dir=/usr/bin \
+  --conf-dir=/etc/pig \
+  --log-dir=/var/log/pig \
+  --uninstal
+#!/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-pig-env.sh \
+  --prefix=/usr \
+  --bin-dir=/usr/bin \
+  --conf-dir=/etc/pig \
+  --log-dir=/var/log/pig \
+  --uninstal

Added: pig/branches/branch-0.9/src/packages/rpm/spec/pig.spec
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/src/packages/rpm/spec/pig.spec?rev=1156289&view=auto
==============================================================================
--- pig/branches/branch-0.9/src/packages/rpm/spec/pig.spec (added)
+++ pig/branches/branch-0.9/src/packages/rpm/spec/pig.spec Wed Aug 10 18:09:55 2011
@@ -0,0 +1,276 @@
+#   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 Pig version @version@
+#
+
+%define name         pig
+%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/pig
+%define _src_dir     %{_prefix}/src
+%define _var_dir     %{_prefix}/var/lib
+
+# Build time settings
+%define _build_dir  @package.build.dir@
+%define _final_name @final.name@
+%define debug_package %{nil}
+
+# Disable brp-java-repack-jars
+%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}
+
+Summary: Apache Pig is a platform for analyzing large data sets that consists of a high-level language for expressing data analysis programs.
+License: Apache License, Version 2.0
+URL: http://pig.apache.org/
+Vendor: Apache Software Foundation
+Group: Development/Libraries
+Name: %{name}
+Version: %{version}
+Release: %{release} 
+Source0: %{_final_name}.tar.gz
+Source1: %{_final_name}-withouthadoop.jar
+Prefix: %{_prefix}
+Prefix: %{_conf_dir}
+Prefix: %{_log_dir}
+Buildroot: %{_build_dir}
+Requires: hadoop, sh-utils, textutils
+AutoReqProv: no
+Provides: pig
+
+%description
+Apache Pig is a platform for analyzing large data sets that consists of a high-level language for expressing data analysis programs, coupled with infrastructure for evaluating these programs. The salient property of Pig programs is that their structure is amenable to substantial parallelization, which in turns enables them to handle very large data sets.
+
+#%package conf-pseudo
+#Summary: Default Hadoop configuration templates
+#Group: System/Daemons
+#Requires: %{name} == %{version}
+#
+#%description conf-pseudo
+#Installation of this RPM will setup your machine to run in pseudo-distributed mode
+#where each Hadoop daemon runs in a separate Java process.
+
+%prep
+%setup -n %{_final_name}
+
+%build
+if [ -d ${RPM_BUILD_DIR}%{_prefix} ]; then
+  rm -rf ${RPM_BUILD_DIR}%{_prefix}
+fi
+
+if [ -d ${RPM_BUILD_DIR}%{_log_dir} ]; then
+  rm -rf ${RPM_BUILD_DIR}%{_log_dir}
+fi
+
+if [ -d ${RPM_BUILD_DIR}%{_conf_dir} ]; then
+  rm -rf ${RPM_BUILD_DIR}%{_conf_dir}
+fi
+
+if [ -d ${RPM_BUILD_DIR}%{_pid_dir} ]; then
+  rm -rf ${RPM_BUILD_DIR}%{_pid_dir}
+fi
+
+mkdir -p ${RPM_BUILD_DIR}%{_prefix}
+mkdir -p ${RPM_BUILD_DIR}%{_log_dir}
+mkdir -p ${RPM_BUILD_DIR}%{_conf_dir}
+
+#########################
+#### INSTALL SECTION ####
+#########################
+%install
+mv ${RPM_BUILD_DIR}/%{_final_name}/etc/pig/* ${RPM_BUILD_DIR}%{_conf_dir}
+rm -rf ${RPM_BUILD_DIR}/%{_final_name}/etc/pig
+mv ${RPM_BUILD_DIR}/%{_final_name}/* ${RPM_BUILD_DIR}%{_prefix}
+cp -f ${RPM_BUILD_DIR}/../SOURCES/%{_final_name}-withouthadoop.jar ${RPM_BUILD_DIR}%{_share_dir}/%{_final_name}-core.jar
+
+%pre
+
+%post
+bash ${RPM_INSTALL_PREFIX0}/sbin/update-pig-env.sh \
+       --prefix=${RPM_INSTALL_PREFIX0} \
+       --bin-dir=${RPM_INSTALL_PREFIX0}/bin \
+       --conf-dir=${RPM_INSTALL_PREFIX1} \
+       --log-dir=${RPM_INSTALL_PREFIX2}
+
+%preun
+bash ${RPM_INSTALL_PREFIX0}/sbin/update-pig-env.sh \
+       --prefix=${RPM_INSTALL_PREFIX0} \
+       --bin-dir=${RPM_INSTALL_PREFIX0}/bin \
+       --conf-dir=${RPM_INSTALL_PREFIX1} \
+       --log-dir=${RPM_INSTALL_PREFIX2} \
+       --uninstall
+
+%files 
+%defattr(-,root,root)
+%attr(0755,root,hadoop) %{_log_dir}
+%config %{_conf_dir}
+%{_prefix}
+
+#   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 Pig version @version@
+#
+
+%define name         pig
+%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/pig
+%define _src_dir     %{_prefix}/src
+%define _var_dir     %{_prefix}/var/lib
+
+# Build time settings
+%define _build_dir  @package.build.dir@
+%define _final_name @final.name@
+%define debug_package %{nil}
+
+# Disable brp-java-repack-jars
+%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}
+
+Summary: Apache Pig is a platform for analyzing large data sets that consists of a high-level language for expressing data analysis programs.
+License: Apache License, Version 2.0
+URL: http://pig.apache.org/
+Vendor: Apache Software Foundation
+Group: Development/Libraries
+Name: %{name}
+Version: %{version}
+Release: %{release} 
+Source0: %{_final_name}.tar.gz
+Source1: %{_final_name}-withouthadoop.jar
+Prefix: %{_prefix}
+Prefix: %{_conf_dir}
+Prefix: %{_log_dir}
+Buildroot: %{_build_dir}
+Requires: hadoop, sh-utils, textutils
+AutoReqProv: no
+Provides: pig
+
+%description
+Apache Pig is a platform for analyzing large data sets that consists of a high-level language for expressing data analysis programs, coupled with infrastructure for evaluating these programs. The salient property of Pig programs is that their structure is amenable to substantial parallelization, which in turns enables them to handle very large data sets.
+
+#%package conf-pseudo
+#Summary: Default Hadoop configuration templates
+#Group: System/Daemons
+#Requires: %{name} == %{version}
+#
+#%description conf-pseudo
+#Installation of this RPM will setup your machine to run in pseudo-distributed mode
+#where each Hadoop daemon runs in a separate Java process.
+
+%prep
+%setup -n %{_final_name}
+
+%build
+if [ -d ${RPM_BUILD_DIR}%{_prefix} ]; then
+  rm -rf ${RPM_BUILD_DIR}%{_prefix}
+fi
+
+if [ -d ${RPM_BUILD_DIR}%{_log_dir} ]; then
+  rm -rf ${RPM_BUILD_DIR}%{_log_dir}
+fi
+
+if [ -d ${RPM_BUILD_DIR}%{_conf_dir} ]; then
+  rm -rf ${RPM_BUILD_DIR}%{_conf_dir}
+fi
+
+if [ -d ${RPM_BUILD_DIR}%{_pid_dir} ]; then
+  rm -rf ${RPM_BUILD_DIR}%{_pid_dir}
+fi
+
+mkdir -p ${RPM_BUILD_DIR}%{_prefix}
+mkdir -p ${RPM_BUILD_DIR}%{_log_dir}
+mkdir -p ${RPM_BUILD_DIR}%{_conf_dir}
+
+#########################
+#### INSTALL SECTION ####
+#########################
+%install
+mv ${RPM_BUILD_DIR}/%{_final_name}/etc/pig/* ${RPM_BUILD_DIR}%{_conf_dir}
+rm -rf ${RPM_BUILD_DIR}/%{_final_name}/etc/pig
+mv ${RPM_BUILD_DIR}/%{_final_name}/* ${RPM_BUILD_DIR}%{_prefix}
+cp -f ${RPM_BUILD_DIR}/../SOURCES/%{_final_name}-withouthadoop.jar ${RPM_BUILD_DIR}%{_share_dir}/%{_final_name}-core.jar
+
+%pre
+
+%post
+bash ${RPM_INSTALL_PREFIX0}/sbin/update-pig-env.sh \
+       --prefix=${RPM_INSTALL_PREFIX0} \
+       --bin-dir=${RPM_INSTALL_PREFIX0}/bin \
+       --conf-dir=${RPM_INSTALL_PREFIX1} \
+       --log-dir=${RPM_INSTALL_PREFIX2}
+
+%preun
+bash ${RPM_INSTALL_PREFIX0}/sbin/update-pig-env.sh \
+       --prefix=${RPM_INSTALL_PREFIX0} \
+       --bin-dir=${RPM_INSTALL_PREFIX0}/bin \
+       --conf-dir=${RPM_INSTALL_PREFIX1} \
+       --log-dir=${RPM_INSTALL_PREFIX2} \
+       --uninstall
+
+%files 
+%defattr(-,root,root)
+%attr(0755,root,hadoop) %{_log_dir}
+%config %{_conf_dir}
+%{_prefix}
+

Added: pig/branches/branch-0.9/src/packages/templates/conf/pig-env.sh
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/src/packages/templates/conf/pig-env.sh?rev=1156289&view=auto
==============================================================================
--- pig/branches/branch-0.9/src/packages/templates/conf/pig-env.sh (added)
+++ pig/branches/branch-0.9/src/packages/templates/conf/pig-env.sh Wed Aug 10 18:09:55 2011
@@ -0,0 +1,32 @@
+# 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}
+# 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}

Added: pig/branches/branch-0.9/src/packages/update-pig-env.sh
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/src/packages/update-pig-env.sh?rev=1156289&view=auto
==============================================================================
--- pig/branches/branch-0.9/src/packages/update-pig-env.sh (added)
+++ pig/branches/branch-0.9/src/packages/update-pig-env.sh Wed Aug 10 18:09:55 2011
@@ -0,0 +1,306 @@
+#!/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 pig-env.sh and symlinkis directories for 
+# relocating package locations.
+
+usage() {
+  echo "
+usage: $0 <parameters>
+  Required parameters:
+     --prefix=PREFIX             path to install into
+
+  Optional parameters:
+     --arch=i386                 OS Architecture
+     --bin-dir=PREFIX/bin        Executable directory
+     --conf-dir=/etc/pig         Configuration directory
+     --log-dir=/var/log/pig      Log directory
+  "
+  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 'bin-dir:' \
+  -l 'conf-dir:' \
+  -l 'lib-dir:' \
+  -l 'log-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
+      ;;
+    --bin-dir)
+      BIN_DIR=$2 ; shift 2
+      ;;
+    --log-dir)
+      LOG_DIR=$2 ; shift 2
+      ;;
+    --lib-dir)
+      LIB_DIR=$2 ; shift 2
+      ;;
+    --conf-dir)
+      CONF_DIR=$2 ; shift 2
+      ;;
+    --uninstall)
+      UNINSTALL=1; shift
+      ;;
+    --)
+      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}
+BIN_DIR=${BIN_DIR:-$PREFIX/bin}
+CONF_DIR=${CONF_DIR:-$PREFIX/etc/pig}
+LIB_DIR=${LIB_DIR:-$PREFIX/share/pig}
+LOG_DIR=${LOG_DIR:-$PREFIX/var/log}
+UNINSTALL=${UNINSTALL:-0}
+PIG_HOME=${PREFIX}
+
+if [ "${ARCH}" != "i386" ]; then
+  LIB_DIR=${LIB_DIR}64
+fi
+
+. /etc/default/hadoop-env.sh
+
+if [ -e /etc/default/hbase-env.sh ]; then
+  . /etc/default/hbase-env.sh
+fi
+
+if [ "${UNINSTALL}" -eq "1" ]; then
+  # Remove symlinks
+  if [ "${CONF_DIR}" != "${PREFIX}/etc/pig" ]; then
+    rm -f ${PREFIX}/etc/pig
+  fi
+else
+  # Create symlinks
+  if [ "${CONF_DIR}" != "${PREFIX}/etc/pig" ]; then
+    if [ ! -e ${PREFIX}/etc/pig ]; then
+      ln -sf ${CONF_DIR} ${PREFIX}/etc/pig
+    fi
+  fi
+
+  mkdir -p ${LOG_DIR}
+  chown root:hadoop ${LOG_DIR}
+  chmod 777 ${LOG_DIR}
+
+  TFILE="/tmp/$(basename $0).$$.tmp"
+  if [ -z "${JAVA_HOME}" ]; then
+    if [ -e /etc/lsb-release ]; then
+      JAVA_HOME=`update-alternatives --config java | grep java | cut -f2 -d':' | cut -f2 -d' ' | sed -e 's/\/bin\/java//'`
+    else
+      JAVA_HOME=/usr/java/default
+    fi
+  fi
+  template_generator ${PREFIX}/share/pig/templates/conf/pig-env.sh $TFILE
+  cp ${TFILE} ${CONF_DIR}/pig-env.sh
+  rm -f ${TFILE}
+fi
+#!/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 pig-env.sh and symlinkis directories for 
+# relocating package locations.
+
+usage() {
+  echo "
+usage: $0 <parameters>
+  Required parameters:
+     --prefix=PREFIX             path to install into
+
+  Optional parameters:
+     --arch=i386                 OS Architecture
+     --bin-dir=PREFIX/bin        Executable directory
+     --conf-dir=/etc/pig         Configuration directory
+     --log-dir=/var/log/pig      Log directory
+  "
+  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 'bin-dir:' \
+  -l 'conf-dir:' \
+  -l 'lib-dir:' \
+  -l 'log-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
+      ;;
+    --bin-dir)
+      BIN_DIR=$2 ; shift 2
+      ;;
+    --log-dir)
+      LOG_DIR=$2 ; shift 2
+      ;;
+    --lib-dir)
+      LIB_DIR=$2 ; shift 2
+      ;;
+    --conf-dir)
+      CONF_DIR=$2 ; shift 2
+      ;;
+    --uninstall)
+      UNINSTALL=1; shift
+      ;;
+    --)
+      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}
+BIN_DIR=${BIN_DIR:-$PREFIX/bin}
+CONF_DIR=${CONF_DIR:-$PREFIX/etc/pig}
+LIB_DIR=${LIB_DIR:-$PREFIX/share/pig}
+LOG_DIR=${LOG_DIR:-$PREFIX/var/log}
+UNINSTALL=${UNINSTALL:-0}
+PIG_HOME=${PREFIX}
+
+if [ "${ARCH}" != "i386" ]; then
+  LIB_DIR=${LIB_DIR}64
+fi
+
+. /etc/default/hadoop-env.sh
+
+if [ -e /etc/default/hbase-env.sh ]; then
+  . /etc/default/hbase-env.sh
+fi
+
+if [ "${UNINSTALL}" -eq "1" ]; then
+  # Remove symlinks
+  if [ "${CONF_DIR}" != "${PREFIX}/etc/pig" ]; then
+    rm -f ${PREFIX}/etc/pig
+  fi
+else
+  # Create symlinks
+  if [ "${CONF_DIR}" != "${PREFIX}/etc/pig" ]; then
+    if [ ! -e ${PREFIX}/etc/pig ]; then
+      ln -sf ${CONF_DIR} ${PREFIX}/etc/pig
+    fi
+  fi
+
+  mkdir -p ${LOG_DIR}
+  chown root:hadoop ${LOG_DIR}
+  chmod 777 ${LOG_DIR}
+
+  TFILE="/tmp/$(basename $0).$$.tmp"
+  if [ -z "${JAVA_HOME}" ]; then
+    if [ -e /etc/lsb-release ]; then
+      JAVA_HOME=`update-alternatives --config java | grep java | cut -f2 -d':' | cut -f2 -d' ' | sed -e 's/\/bin\/java//'`
+    else
+      JAVA_HOME=/usr/java/default
+    fi
+  fi
+  template_generator ${PREFIX}/share/pig/templates/conf/pig-env.sh $TFILE
+  cp ${TFILE} ${CONF_DIR}/pig-env.sh
+  rm -f ${TFILE}
+fi