Repository: ambari
Updated Branches:
  refs/heads/trunk 9d806633e -> 391a53b40


AMBARI-8648. Fix hadoop-sink rpm build to create symlink in postinstall 
scriptlet. (mpapirkovskyy)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/391a53b4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/391a53b4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/391a53b4

Branch: refs/heads/trunk
Commit: 391a53b40abf59ec8117b9e5434606fe52c73dfc
Parents: 86b0ce4
Author: Myroslav Papirkovskyy <mpapyrkovs...@hortonworks.com>
Authored: Wed Dec 10 23:41:48 2014 +0200
Committer: Myroslav Papirkovskyy <mpapyrkovs...@hortonworks.com>
Committed: Wed Dec 10 23:48:44 2014 +0200

----------------------------------------------------------------------
 .../ambari-metrics-hadoop-sink/pom.xml          | 24 ++++++++++++++++----
 .../src/main/package/rpm/postinstall.sh         | 24 ++++++++++++++++++++
 2 files changed, 44 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/391a53b4/ambari-metrics/ambari-metrics-hadoop-sink/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-sink/pom.xml 
b/ambari-metrics/ambari-metrics-hadoop-sink/pom.xml
index 76f9fce..3ab9079 100644
--- a/ambari-metrics/ambari-metrics-hadoop-sink/pom.xml
+++ b/ambari-metrics/ambari-metrics-hadoop-sink/pom.xml
@@ -28,6 +28,12 @@ limitations under the License.
   <artifactId>ambari-metrics-hadoop-sink</artifactId>
   <version>0.1.0-SNAPSHOT</version>
   <packaging>jar</packaging>
+  <properties>
+    
<sinkJarName>${project.artifactId}-with-common-${project.version}.jar</sinkJarName>
+  </properties>
+
+
+
   <build>
     <plugins>
       <plugin>
@@ -123,6 +129,12 @@ limitations under the License.
           <copyright>2012, Apache Software Foundation</copyright>
           <group>Development</group>
           <description>Maven Recipe: RPM Package.</description>
+
+          <postinstallScriptlet>
+            
<scriptFile>${project.build.outputDirectory}/rpm/postinstall.sh</scriptFile>
+            <fileEncoding>utf-8</fileEncoding>
+          </postinstallScriptlet>
+
           <mappings>
             <mapping>
               <directory>/usr/lib/ambari-metrics-hadoop-sink</directory>
@@ -133,10 +145,6 @@ limitations under the License.
                 <source>
                   
<location>target/${project.artifactId}-with-common-${project.version}.jar</location>
                 </source>
-                <softlinkSource>
-                  <destination>ambari-metrics-hadoop-sink.jar</destination>
-                  
<location>/usr/lib/ambari-metrics-hadoop-sink/${project.artifactId}-with-common-${project.version}.jar</location>
-                </softlinkSource>
               </sources>
 
             </mapping>
@@ -145,6 +153,14 @@ limitations under the License.
         </configuration>
       </plugin>
     </plugins>
+
+    <resources>
+      <resource>
+        <directory>src/main/package</directory>
+        <filtering>true</filtering>
+      </resource>
+    </resources>
+
   </build>
 
   <dependencies>

http://git-wip-us.apache.org/repos/asf/ambari/blob/391a53b4/ambari-metrics/ambari-metrics-hadoop-sink/src/main/package/rpm/postinstall.sh
----------------------------------------------------------------------
diff --git 
a/ambari-metrics/ambari-metrics-hadoop-sink/src/main/package/rpm/postinstall.sh 
b/ambari-metrics/ambari-metrics-hadoop-sink/src/main/package/rpm/postinstall.sh
new file mode 100644
index 0000000..9849899
--- /dev/null
+++ 
b/ambari-metrics/ambari-metrics-hadoop-sink/src/main/package/rpm/postinstall.sh
@@ -0,0 +1,24 @@
+#!/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
+
+LINK_NAME="/usr/lib/ambari-metrics-hadoop-sink/ambari-metrics-hadoop-sink.jar"
+JAR_NAME="/usr/lib/ambari-metrics-hadoop-sink/${sinkJarName}"
+
+if [ -e "$LINK_NAME" ]; then
+  rm -f $LINK_NAME
+fi
+
+ln -s $JAR_NAME $LINK_NAME
\ No newline at end of file

Reply via email to