hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [2/3] incubator-hawq git commit: HAWQ-1420. Enable build of Ranger plugin open source RPM
Date Sat, 01 Apr 2017 04:03:09 GMT
HAWQ-1420. Enable build of Ranger plugin open source RPM


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/4e6624a4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/4e6624a4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/4e6624a4

Branch: refs/heads/2.2.0.0-incubating
Commit: 4e6624a49a43af5cffd65be944c06cc6f966ba22
Parents: 2045627
Author: ljainpivotalio <ljain@pivotal.io>
Authored: Tue Mar 28 17:31:02 2017 -0700
Committer: rlei <rlei@pivotal.io>
Committed: Sat Apr 1 12:02:48 2017 +0800

----------------------------------------------------------------------
 contrib/hawq-package/make_rpm_tarball.sh  |  2 +-
 ranger-plugin/pom.xml                     | 34 ++++++++++++++------------
 ranger-plugin/scripts/build_ranger_rpm.sh |  7 ++++--
 3 files changed, 25 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/4e6624a4/contrib/hawq-package/make_rpm_tarball.sh
----------------------------------------------------------------------
diff --git a/contrib/hawq-package/make_rpm_tarball.sh b/contrib/hawq-package/make_rpm_tarball.sh
index ba0c4f7..8501534 100755
--- a/contrib/hawq-package/make_rpm_tarball.sh
+++ b/contrib/hawq-package/make_rpm_tarball.sh
@@ -58,7 +58,7 @@ if [ $? != 0 ]; then
 fi
 
 # Copy HAWQ Ranger rpm package
-cp ${SRC_TOP_DIR}/ranger-plugin/target/rpm/hawq-ranger-plugin_*/RPMS/noarch/hawq-ranger-plugin*.rpm
${RPM_PKG_DIR}/
+cp ${SRC_TOP_DIR}/ranger-plugin/target/rpm/hawq-ranger-plugin*/RPMS/noarch/hawq-ranger-plugin*.rpm
${RPM_PKG_DIR}/
 if [ $? != 0 ]; then
     echo "Copy HAWQ Ranger plugin rpm package failed."
     exit $?

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/4e6624a4/ranger-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/ranger-plugin/pom.xml b/ranger-plugin/pom.xml
index 4b55443..ab3a475 100644
--- a/ranger-plugin/pom.xml
+++ b/ranger-plugin/pom.xml
@@ -38,6 +38,9 @@
         <release.version>1</release.version>
         <postgresql.version>9.1-901-1.jdbc4</postgresql.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <build.suffix>_${hawq.name.version}</build.suffix>
+        <hawq.dep.name>hawq_${hawq.name.version}</hawq.dep.name>
+        <destination.dir>/usr/local/hawq${build.suffix}/ranger</destination.dir>
     </properties>
 
     <build>
@@ -69,23 +72,24 @@
                 <configuration>
                     <copyright>ASL 2.0</copyright>
                     <group>org.apache.hawq.ranger</group>
-                    <name>hawq-ranger-plugin_${hawq.name.version}</name>
+                    <name>hawq-ranger-plugin${build.suffix}</name>
                     <defaultUsername>gpadmin</defaultUsername>
                     <defaultGroupname>gpadmin</defaultGroupname>
+                    <needarch>noarch</needarch>
                     <description>
                         HAWQ Ranger plugin.
                     </description>
                     <release>${release.version}%{?dist}</release>
                     <requires>
                         <require>bigtop-tomcat</require>
-                        <require>hawq_${hawq.name.version} &gt;= ${project.version}</require>
+                        <require>${hawq.dep.name} &gt;= ${project.version}</require>
                     </requires>
                     <mappings>
                         <mapping>
-                            <directory>/usr/local/hawq_${hawq.name.version}/ranger</directory>
+                            <directory>${destination.dir}</directory>
                         </mapping>
                         <mapping>
-                            <directory>/usr/local/hawq_${hawq.name.version}/ranger/bin</directory>
+                            <directory>${destination.dir}/bin</directory>
                             <filemode>750</filemode>
                             <sources>
                                 <source>
@@ -100,7 +104,7 @@
                             </sources>
                         </mapping>
                         <mapping>
-                            <directory>/usr/local/hawq_${hawq.name.version}/ranger/etc</directory>
+                            <directory>${destination.dir}/etc</directory>
                             <sources>
                                 <source>
                                     <location>conf/ranger-servicedef-hawq.json</location>
@@ -121,7 +125,7 @@
                             </sources>
                         </mapping>
                         <mapping>
-                            <directory>/usr/local/hawq_${hawq.name.version}/ranger/lib</directory>
+                            <directory>${destination.dir}/lib</directory>
                             <sources>
                                 <source>
                                     <location>admin-plugin/target/ranger-plugin-admin-${project.version}.jar</location>
@@ -132,10 +136,10 @@
                             </sources>
                         </mapping>
                         <mapping>
-                            <directory>/usr/local/hawq_${hawq.name.version}/ranger/plugin-service</directory>
+                            <directory>${destination.dir}/plugin-service</directory>
                         </mapping>
                         <mapping>
-                            <directory>/usr/local/hawq_${hawq.name.version}/ranger/plugin-service/bin</directory>
+                            <directory>${destination.dir}/plugin-service/bin</directory>
                             <sources>
                                 <source>
                                     <location>scripts/setenv.sh</location>
@@ -143,7 +147,7 @@
                             </sources>
                         </mapping>
                         <mapping>
-                            <directory>/usr/local/hawq_${hawq.name.version}/ranger/plugin-service/conf</directory>
+                            <directory>${destination.dir}/plugin-service/conf</directory>
                             <sources>
                                 <source>
                                     <location>conf/server.xml</location>
@@ -154,7 +158,7 @@
                             </sources>
                         </mapping>
                         <mapping>
-                            <directory>/usr/local/hawq_${hawq.name.version}/ranger/plugin-service/lib</directory>
+                            <directory>${destination.dir}/plugin-service/lib</directory>
                             <sources>
                                 <source>
                                     <location>service/target/ranger-plugin-service-${project.version}/WEB-INF/lib</location>
@@ -162,19 +166,19 @@
                             </sources>
                         </mapping>
                         <mapping>
-                            <directory>/usr/local/hawq_${hawq.name.version}/ranger/plugin-service/logs</directory>
+                            <directory>${destination.dir}/plugin-service/logs</directory>
                         </mapping>
                         <mapping>
-                            <directory>/usr/local/hawq_${hawq.name.version}/ranger/plugin-service/temp</directory>
+                            <directory>${destination.dir}/plugin-service/temp</directory>
                         </mapping>
                         <mapping>
-                            <directory>/usr/local/hawq_${hawq.name.version}/ranger/plugin-service/work</directory>
+                            <directory>${destination.dir}/plugin-service/work</directory>
                         </mapping>
                         <mapping>
-                            <directory>/usr/local/hawq_${hawq.name.version}/ranger/plugin-service/work/policycache</directory>
+                            <directory>${destination.dir}/plugin-service/work/policycache</directory>
                         </mapping>
                         <mapping>
-                            <directory>/usr/local/hawq_${hawq.name.version}/ranger/plugin-service/webapps</directory>
+                            <directory>${destination.dir}/plugin-service/webapps</directory>
                             <sources>
                                 <source>
                                     <location>service/target/ranger-plugin-service-${project.version}.war</location>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/4e6624a4/ranger-plugin/scripts/build_ranger_rpm.sh
----------------------------------------------------------------------
diff --git a/ranger-plugin/scripts/build_ranger_rpm.sh b/ranger-plugin/scripts/build_ranger_rpm.sh
index 2bdcea8..32f6fa1 100755
--- a/ranger-plugin/scripts/build_ranger_rpm.sh
+++ b/ranger-plugin/scripts/build_ranger_rpm.sh
@@ -20,9 +20,12 @@ MVN_OPTS="-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenT
 
 # Set HAWQ ranger-plugin rpm build number to 1 as default
 BUILD_NUMBER=1
+BUILD_OPTS="-Drelease.version=${BUILD_NUMBER}"
+BUILD_OPTS="${BUILD_OPTS} -Dbuild.suffix= -Dhawq.dep.name=apache-hawq"
+BUILD_OPTS="${BUILD_OPTS} -Ddestination.dir=/usr/local/apache-hawq/ranger"
 
 # Get current HAWQ releave version number.
-if [  -z "${HAWQ_RELEASE_VERSION}" ]; then
+if [ -z "${HAWQ_RELEASE_VERSION}" ]; then
     HAWQ_RELEASE_VERSION=$(cat ../getversion| grep ^GP_VERSION | cut -d '=' -f2 | sed 's|"||g'
| cut -d '-' -f1)
 fi
 
@@ -41,7 +44,7 @@ if [ $? != 0 ]; then
 fi
 
 # build rpm
-mvn ${MVN_OPTS} -N -Drelease.version=${BUILD_NUMBER} install
+mvn ${MVN_OPTS} -N ${BUILD_OPTS} install
 if [ $? != 0 ]; then
     echo "Build HAWQ ranger-plugin rpm package failed."
     exit $?


Mime
View raw message