You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by radarwave <gi...@git.apache.org> on 2017/03/27 10:50:41 UTC
[GitHub] incubator-hawq pull request #1195: HAWQ-326. Support RPM package for Apache ...
GitHub user radarwave opened a pull request:
https://github.com/apache/incubator-hawq/pull/1195
HAWQ-326. Support RPM package for Apache HAWQ.
1. Add a RPM spec file to support building HAWQ rpm package from source code tarball.
2. Add 'make rpm' command to build HAWQ/PXF/Ranger-plugin rpm packages and make into a binary tarball from source code tarball.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/radarwave/incubator-hawq rpm-tarball
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-hawq/pull/1195.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1195
----
commit 7826a5ff525cb0cf2cfcd201c608d9d215734a37
Author: rlei <rl...@pivotal.io>
Date: 2017-03-17T02:36:01Z
HAWQ-326. Support RPM package for Apache HAWQ.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hawq pull request #1195: HAWQ-326. Support RPM package for Apache ...
Posted by paul-guo- <gi...@git.apache.org>.
Github user paul-guo- commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1195#discussion_r108334298
--- Diff: contrib/hawq-package/build_hawq_rpm.sh ---
@@ -0,0 +1,77 @@
+#!/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.
+
+CUR_DIR=$(pwd)
+
+if [ -f /etc/redhat-release ] ; then
+ DISTRO_VERSION=$(cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//)
+ DISTRO_MAJOR_VERSION=$(echo ${DISTRO_VERSION} | awk -F '.' '{print $1}')
+ OS_TYPE="el${DISTRO_MAJOR_VERSION}"
+elif [ -f /etc/SuSE-release ] ; then
+ DISTRO_VERSION=$(cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //)
+ DISTRO_MAJOR_VERSION=$(echo ${DISTRO_VERSION} |awk -F '.' '{print $1}')
+ OS_TYPE="suse${DISTRO_MAJOR_VERSION}"
+fi
+
+HAWQ_RELEASE_VERSION=$(cat ../../getversion| grep ^GP_VERSION | cut -d '=' -f2 | sed 's|"||g' | cut -d '-' -f1)
--- End diff --
I think we should allow HAWQ_RELEASE_VERSION (and document it) to be predefined (if not predefined then fallback to call getversion) so that users do not need to build a rpm whose version is different than the codebase.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hawq issue #1195: HAWQ-326. Support RPM package for Apache HAWQ.
Posted by huor <gi...@git.apache.org>.
Github user huor commented on the issue:
https://github.com/apache/incubator-hawq/pull/1195
+1 for making the rpm build available for hawq!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hawq pull request #1195: HAWQ-326. Support RPM package for Apache ...
Posted by paul-guo- <gi...@git.apache.org>.
Github user paul-guo- commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1195#discussion_r108334385
--- Diff: contrib/hawq-package/build_hawq_rpm.sh ---
@@ -0,0 +1,77 @@
+#!/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.
+
+CUR_DIR=$(pwd)
+
+if [ -f /etc/redhat-release ] ; then
+ DISTRO_VERSION=$(cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//)
+ DISTRO_MAJOR_VERSION=$(echo ${DISTRO_VERSION} | awk -F '.' '{print $1}')
+ OS_TYPE="el${DISTRO_MAJOR_VERSION}"
+elif [ -f /etc/SuSE-release ] ; then
+ DISTRO_VERSION=$(cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //)
+ DISTRO_MAJOR_VERSION=$(echo ${DISTRO_VERSION} |awk -F '.' '{print $1}')
+ OS_TYPE="suse${DISTRO_MAJOR_VERSION}"
+fi
+
+HAWQ_RELEASE_VERSION=$(cat ../../getversion| grep ^GP_VERSION | cut -d '=' -f2 | sed 's|"||g' | cut -d '-' -f1)
--- End diff --
i.e. I expect the rpm build scripts and spec could be quite independent.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hawq issue #1195: HAWQ-326. Support RPM package for Apache HAWQ.
Posted by radarwave <gi...@git.apache.org>.
Github user radarwave commented on the issue:
https://github.com/apache/incubator-hawq/pull/1195
@shivzone @denalex @huor @paul-guo- @edespino
Please help to review, including PXF/Ranger-plugin changes.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hawq issue #1195: HAWQ-326. Support RPM package for Apache HAWQ.
Posted by paul-guo- <gi...@git.apache.org>.
Github user paul-guo- commented on the issue:
https://github.com/apache/incubator-hawq/pull/1195
+1
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hawq pull request #1195: HAWQ-326. Support RPM package for Apache ...
Posted by paul-guo- <gi...@git.apache.org>.
Github user paul-guo- commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1195#discussion_r108334685
--- Diff: contrib/hawq-package/build_hawq_rpm.sh ---
@@ -0,0 +1,77 @@
+#!/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.
+
+CUR_DIR=$(pwd)
+
+if [ -f /etc/redhat-release ] ; then
+ DISTRO_VERSION=$(cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//)
+ DISTRO_MAJOR_VERSION=$(echo ${DISTRO_VERSION} | awk -F '.' '{print $1}')
+ OS_TYPE="el${DISTRO_MAJOR_VERSION}"
+elif [ -f /etc/SuSE-release ] ; then
+ DISTRO_VERSION=$(cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //)
+ DISTRO_MAJOR_VERSION=$(echo ${DISTRO_VERSION} |awk -F '.' '{print $1}')
+ OS_TYPE="suse${DISTRO_MAJOR_VERSION}"
+fi
+
+HAWQ_RELEASE_VERSION=$(cat ../../getversion| grep ^GP_VERSION | cut -d '=' -f2 | sed 's|"||g' | cut -d '-' -f1)
+
+echo "HAWQ_RELEASE_VERSION is $HAWQ_RELEASE_VERSION"
+
+if [ -d rpmbuild ]; then
+ echo "Clean rpmbuild directory."
+ rm -rf rpmbuild
+fi
+
+echo "Make directories: rpmbuild/BUILD rpmbuild/RPMS rpmbuild/SOURCES rpmbuild/SPECS rpmbuild/SRPMS"
+mkdir -p rpmbuild/BUILD rpmbuild/RPMS rpmbuild/SOURCES rpmbuild/SPECS rpmbuild/SRPMS
+
+# Copy HAWQ RPM configuration file for the build
+cp hawq.spec rpmbuild/SPECS/
+
+HAWQ_SOURCE_TARBALL_FILE=apache-hawq-src-${HAWQ_RELEASE_VERSION}-incubating.tar.gz
+
+# Get PATH where to find HAWQ source code tarball
+if [ -z ${HAWQ_SOURCE_TARBALL_PATH} ]; then
+ HAWQ_SOURCE_TARBALL_PATH=${CUR_DIR}
+fi
+
+# Copy HAWQ source code tarball for rpm build
+if [ -f "${HAWQ_SOURCE_TARBALL_PATH}/${HAWQ_SOURCE_TARBALL_FILE}" ]; then
+ cp ${HAWQ_SOURCE_TARBALL_PATH}/${HAWQ_SOURCE_TARBALL_FILE} rpmbuild/SOURCES/
+else
+ echo "Can not find ${HAWQ_SOURCE_TARBALL_PATH}/${HAWQ_SOURCE_TARBALL_FILE} "
+ exit 1
+fi
+
+pushd rpmbuild > /dev/null
+RPM_TOP_DIR=$(pwd)
+
+echo 'rpmbuild --define "_topdir ${RPM_TOP_DIR}" \
+ --define "_hawq_version ${HAWQ_RELEASE_VERSION}" \
+ --define "_rpm_os_version ${OS_TYPE}" \
+ -bb SPECS/hawq.spec'
--- End diff --
You do not need to do like this. You could use the switch: "set -x" and "set +x"
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hawq pull request #1195: HAWQ-326. Support RPM package for Apache ...
Posted by radarwave <gi...@git.apache.org>.
Github user radarwave closed the pull request at:
https://github.com/apache/incubator-hawq/pull/1195
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-hawq issue #1195: HAWQ-326. Support RPM package for Apache HAWQ.
Posted by radarwave <gi...@git.apache.org>.
Github user radarwave commented on the issue:
https://github.com/apache/incubator-hawq/pull/1195
Made some changes base on @paul-guo- 's comments.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---