#369 Package Zeppelin to DEB
- Changed two shell script for recognizing symbolic link
- Used maven assembly plugin for structuring Zeppelin dependencies
- Added init.d script
- Added Debian prerm script


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

Branch: refs/heads/master
Commit: cb75dbb7db2c910ee803a787310910088494d289
Parents: 3a50ee0
Author: Jongyoul Lee <[email protected]>
Authored: Wed Mar 11 15:40:01 2015 +0900
Committer: Jongyoul Lee <[email protected]>
Committed: Wed Mar 11 15:40:01 2015 +0900

----------------------------------------------------------------------
 bin/common.sh                                  |   6 +-
 bin/zeppelin-daemon.sh                         |   6 +-
 zeppelin-distribution/pom.xml                  | 309 ++++++++++++--------
 zeppelin-distribution/src/deb/control/prerm    |   9 +
 zeppelin-distribution/src/deb/init.d/zeppelind |  18 ++
 5 files changed, 227 insertions(+), 121 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/cb75dbb7/bin/common.sh
----------------------------------------------------------------------
diff --git a/bin/common.sh b/bin/common.sh
index 24b1f2e..7dcc63a 100644
--- a/bin/common.sh
+++ b/bin/common.sh
@@ -19,7 +19,11 @@
 # limitations under the License.
 #
 
-FWDIR="$(cd $(dirname "$0"); pwd)"
+if [ -L ${BASH_SOURCE-$0} ]; then
+FWDIR=$(dirname $(readlink "${BASH_SOURCE-$0}"))
+else
+FWDIR=$(dirname "${BASH_SOURCE-$0}")
+fi
 
 if [[ -z "${ZEPPELIN_HOME}" ]]; then
   # Make ZEPPELIN_HOME look cleaner in logs by getting rid of the

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/cb75dbb7/bin/zeppelin-daemon.sh
----------------------------------------------------------------------
diff --git a/bin/zeppelin-daemon.sh b/bin/zeppelin-daemon.sh
index 9106786..97fc07a 100755
--- a/bin/zeppelin-daemon.sh
+++ b/bin/zeppelin-daemon.sh
@@ -21,7 +21,11 @@
 # description: Start and stop daemon script for.
 #
 
-BIN=$(dirname "${BASH_SOURCE-$0}")
+if [ -L ${BASH_SOURCE-$0} ]; then
+  BIN=$(dirname $(readlink "${BASH_SOURCE-$0}"))
+else
+  BIN=$(dirname ${BASH_SOURCE-$0})
+fi
 BIN=$(cd "${BIN}">/dev/null; pwd)
 
 . "${BIN}/common.sh"

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/cb75dbb7/zeppelin-distribution/pom.xml
----------------------------------------------------------------------
diff --git a/zeppelin-distribution/pom.xml b/zeppelin-distribution/pom.xml
index 1b476ce..a6ee285 100644
--- a/zeppelin-distribution/pom.xml
+++ b/zeppelin-distribution/pom.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
@@ -11,16 +12,16 @@
   <artifactId>zeppelin-distribution</artifactId>
   <packaging>pom</packaging>
   <name>Zeppelin: Packaging distribution</name>
-    
+
   <properties>
-      <deb.pkg.name>zeppelin</deb.pkg.name>
-      <deb.install.path>/usr/share/${deb.pkg.name}</deb.install.path>
-      <deb.conf.path>/etc/${deb.pkg.name}</deb.conf.path>
-      <deb.log.path>/var/log/${deb.pkg.name}</deb.log.path>
-      <deb.pid.path>/var/run/${deb.pkg.name}</deb.pid.path>
-      <deb.notebook.path>/var/lib/${deb.pkg.name}</deb.notebook.path>
-      <!-- NOTE: We can modify this setting with assembly settings -->
-      
<deb.assembly.base.dir>target/zeppelin-${project.version}/zeppelin-${project.version}</deb.assembly.base.dir>
+    <deb.pkg.name>zeppelin</deb.pkg.name>
+    <deb.install.path>/usr/share/${deb.pkg.name}</deb.install.path>
+    <deb.conf.path>/etc/${deb.pkg.name}</deb.conf.path>
+    <deb.log.path>/var/log/${deb.pkg.name}</deb.log.path>
+    <deb.pid.path>/var/run/${deb.pkg.name}</deb.pid.path>
+    <deb.notebook.path>/var/lib/${deb.pkg.name}</deb.notebook.path>
+    <!-- NOTE: We can modify this setting with assembly settings -->
+    
<deb.assembly.base.dir>target/zeppelin-${project.version}/zeppelin-${project.version}</deb.assembly.base.dir>
   </properties>
 
   <!-- NOTE: These dependency declarations are only required to sort this 
project to the
@@ -63,7 +64,7 @@
       </plugin>
 
       <plugin>
-      <!--assembly does all the job here-->
+        <!--assembly does all the job here-->
         <artifactId>maven-dependency-plugin</artifactId>
         <configuration>
           <skip>true</skip>
@@ -90,22 +91,22 @@
         <activeByDefault>false</activeByDefault>
       </activation>
       <build>
-      <!-- skip tests in surefire plugin -->
-      <!-- assembly:single -->
-      <!-- publish distribution to S3
+        <!-- skip tests in surefire plugin -->
+        <!-- assembly:single -->
+        <!-- publish distribution to S3
 
-      to settings.xml add:
-      <profiles><profile>
-         <id>inject-s3-credentials</id>
-         <properties>
-          <s3-upload.accessKey>your-key</s3-upload.accessKey>
-          <s3-upload.secretKey>your-secret-key</s3-upload.secretKey>
-         </properties>
-       </profile></profiles>
-      <activeProfiles>
-        <activeProfile>inject-s3-credentials</activeProfile>
-      </activeProfiles>
-      -->
+        to settings.xml add:
+        <profiles><profile>
+           <id>inject-s3-credentials</id>
+           <properties>
+            <s3-upload.accessKey>your-key</s3-upload.accessKey>
+            <s3-upload.secretKey>your-secret-key</s3-upload.secretKey>
+           </properties>
+         </profile></profiles>
+        <activeProfiles>
+          <activeProfile>inject-s3-credentials</activeProfile>
+        </activeProfiles>
+        -->
 
         <plugins>
           <plugin>
@@ -154,111 +155,181 @@
       <id>deb</id>
       <build>
         <plugins>
+          <!--<plugin>
+          <artifactId>maven-dependency-plugin</artifactId>
+          <version>2.8</version>
+          <executions>
+            <execution>
+              <id>copy-dependencies</id>
+              <phase>package</phase>
+              <goals>
+                <goal>copy-dependencies</goal>
+              </goals>
+              <configuration>
+                
<outputDirectory>${project.build.directory}/../../interpreter/spark</outputDirectory>
+                <overWriteReleases>false</overWriteReleases>
+                <overWriteSnapshots>false</overWriteSnapshots>
+                <overWriteIfNewer>true</overWriteIfNewer>
+                <includeScope>runtime</includeScope>
+              </configuration>
+            </execution>
+          </executions>
+          </plugin>-->
           <plugin>
             <artifactId>maven-assembly-plugin</artifactId>
             <executions>
               <execution>
                 <id>make-assembly</id>
                 <phase>package</phase>
-                  <goals>
-                    <goal>single</goal>
-                  </goals>
+                <goals>
+                  <goal>single</goal>
+                </goals>
               </execution>
             </executions>
           </plugin>
           <plugin>
-              <groupId>org.codehaus.mojo</groupId>
-              <artifactId>buildnumber-maven-plugin</artifactId>
-              <version>1.2</version>
-              <executions>
-                  <execution>
-                      <phase>validate</phase>
-                      <goals>
-                          <goal>create</goal>
-                      </goals>
-                      <configuration>
-                          <shortRevisionLength>8</shortRevisionLength>
-                      </configuration>
-                  </execution>
-              </executions>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>buildnumber-maven-plugin</artifactId>
+            <version>1.2</version>
+            <executions>
+              <execution>
+                <phase>validate</phase>
+                <goals>
+                  <goal>create</goal>
+                </goals>
+                <configuration>
+                  <shortRevisionLength>8</shortRevisionLength>
+                </configuration>
+              </execution>
+            </executions>
           </plugin>
           <plugin>
-              <groupId>org.vafer</groupId>
-              <artifactId>jdeb</artifactId>
-              <version>1.4</version>
-              <executions>
-                  <execution>
-                      <phase>package</phase>
-                      <goals>
-                          <goal>jdeb</goal>
-                      </goals>
-                      <configuration>
-                          
<deb>${project.build.directory}/zeppelin-${project.version}-${buildNumber}_all.deb</deb>
-                          <attach>false</attach>
-                          <skipPOMs>false</skipPOMs>
-                          <dataSet>
-                              <data>
-                                  <type>files</type>
-                                  <paths>
-                                      
<path>${project.parent.basedir}/LICENSE</path>
-                                      
<path>${project.parent.basedir}/README.md</path>
-                                  </paths>
-                                  <dst>${deb.install.path}</dst>
-                              </data>
-                              <data>
-                                  <type>directory</type>
-                                  <src>${deb.assembly.base.dir}/bin</src>
-                                  <mapper>
-                                      <type>perm</type>
-                                      <prefix>${deb.install.path}/bin</prefix>
-                                  </mapper>
-                              </data>
-                              <data>
-                                  <type>directory</type>
-                                  <src>${deb.assembly.base.dir}/conf</src>
-                                  <mapper>
-                                      <type>perm</type>
-                                      <prefix>${deb.conf.path}</prefix>
-                                  </mapper>
-                              </data>
-                              <data>
-                                  <type>directory</type>
-                                  <src>${deb.assembly.base.dir}/lib</src>
-                                  <mapper>
-                                      <type>perm</type>
-                                      <prefix>${deb.install.path}/lib</prefix>
-                                  </mapper>
-                              </data>
-                              <data>
-                                  <type>directory</type>
-                                  
<src>${deb.assembly.base.dir}/interpreter</src>
-                                  <mapper>
-                                      <type>perm</type>
-                                      
<prefix>${deb.install.path}/interpreter</prefix>
-                                  </mapper>
-                              </data>
-                              <data>
-                                  <type>directory</type>
-                                  <src>${deb.assembly.base.dir}/notebook</src>
-                                  <includes>2A94M5J1Z/note.json</includes>
-                                  <mapper>
-                                      <type>perm</type>
-                                      <prefix>${deb.notebook.path}</prefix>
-                                  </mapper>
-                              </data>
-                              <data>
-                                  <type>template</type>
-                                  <paths>
-                                      <path>${deb.conf.path}</path>
-                                      <path>${deb.log.path}</path>
-                                      <path>${deb.pid.path}</path>
-                                      <paht>${deb.notebook.path}</paht>
-                                  </paths>
-                              </data>
-                          </dataSet>
-                      </configuration>
-                  </execution>
-              </executions>
+            <groupId>org.vafer</groupId>
+            <artifactId>jdeb</artifactId>
+            <version>1.4</version>
+            <executions>
+              <execution>
+                <phase>package</phase>
+                <goals>
+                  <goal>jdeb</goal>
+                </goals>
+                <configuration>
+                  
<deb>${project.build.directory}/zeppelin-${project.version}-${buildNumber}_all.deb</deb>
+                  <attach>false</attach>
+                  <skipPOMs>false</skipPOMs>
+                  <dataSet>
+                    <data>
+                      <type>files</type>
+                      <paths>
+                        <path>${project.parent.basedir}/LICENSE</path>
+                        <path>${project.parent.basedir}/README.md</path>
+                      </paths>
+                      <dst>${deb.install.path}</dst>
+                    </data>
+                    <data>
+                      <type>directory</type>
+                      <src>${project.basedir}/src/deb/init.d</src>
+                      <mapper>
+                        <type>perm</type>
+                        <prefix>/etc/init.d</prefix>
+                        <filemode>755</filemode>
+                      </mapper>
+                    </data>
+                    <data>
+                      <type>link</type>
+                      <linkName>/usr/bin/zeppelin-daemon.sh</linkName>
+                      
<linkTarget>${deb.install.path}/bin/zeppelin-daemon.sh</linkTarget>
+                      <symlink>true</symlink>
+                    </data>
+                    <data>
+                      <type>link</type>
+                      <linkName>${deb.install.path}/conf</linkName>
+                      <linkTarget>${deb.conf.path}</linkTarget>
+                      <symlink>true</symlink>
+                    </data>
+                    <data>
+                      <type>link</type>
+                      <linkName>${deb.install.path}/logs</linkName>
+                      <linkTarget>${deb.log.path}</linkTarget>
+                      <symlink>true</symlink>
+                    </data>
+                    <data>
+                      <type>link</type>
+                      <linkName>${deb.install.path}/notebook</linkName>
+                      <linkTarget>${deb.notebook.path}</linkTarget>
+                      <symlink>true</symlink>
+                    </data>
+                    <data>
+                      <type>link</type>
+                      <linkName>${deb.install.path}/run</linkName>
+                      <linkTarget>${deb.pid.path}</linkTarget>
+                      <symlink>true</symlink>
+                    </data>
+                    <data>
+                      <type>directory</type>
+                      <src>${deb.assembly.base.dir}/bin</src>
+                      <mapper>
+                        <type>perm</type>
+                        <prefix>${deb.install.path}/bin</prefix>
+                        <filemode>755</filemode>
+                      </mapper>
+                    </data>
+                    <data>
+                      <type>directory</type>
+                      <src>${deb.assembly.base.dir}/conf</src>
+                      <conffile>true</conffile>
+                      <mapper>
+                        <type>perm</type>
+                        <prefix>${deb.conf.path}</prefix>
+                      </mapper>
+                    </data>
+                    <data>
+                      <type>directory</type>
+                      <src>${deb.assembly.base.dir}/lib</src>
+                      <mapper>
+                        <type>perm</type>
+                        <prefix>${deb.install.path}/lib</prefix>
+                      </mapper>
+                    </data>
+                    <data>
+                      <type>directory</type>
+                      <src>${deb.assembly.base.dir}</src>
+                      <includes>*.jar,*.war</includes>
+                      <mapper>
+                        <type>perm</type>
+                        <prefix>${deb.install.path}</prefix>
+                      </mapper>
+                    </data>
+                    <data>
+                      <type>directory</type>
+                      <src>${deb.assembly.base.dir}/interpreter</src>
+                      <mapper>
+                        <type>perm</type>
+                        <prefix>${deb.install.path}/interpreter</prefix>
+                      </mapper>
+                    </data>
+                    <data>
+                      <type>directory</type>
+                      <src>${deb.assembly.base.dir}/notebook</src>
+                      <includes>2A94M5J1Z/note.json</includes>
+                      <mapper>
+                        <type>perm</type>
+                        <prefix>${deb.notebook.path}</prefix>
+                      </mapper>
+                    </data>
+                    <data>
+                      <type>template</type>
+                      <paths>
+                        <path>${deb.conf.path}</path>
+                        <path>${deb.log.path}</path>
+                        <path>${deb.pid.path}</path>
+                        <paht>${deb.notebook.path}</paht>
+                      </paths>
+                    </data>
+                  </dataSet>
+                </configuration>
+              </execution>
+            </executions>
           </plugin>
         </plugins>
       </build>

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/cb75dbb7/zeppelin-distribution/src/deb/control/prerm
----------------------------------------------------------------------
diff --git a/zeppelin-distribution/src/deb/control/prerm 
b/zeppelin-distribution/src/deb/control/prerm
new file mode 100644
index 0000000..ba5b706
--- /dev/null
+++ b/zeppelin-distribution/src/deb/control/prerm
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+SERVICE=$(which service 2> /dev/null)
+RM=$(which rm 2> /dev/null)
+
+exec $SERVICE zeppelind stop
+exec $RM -rf [[deb.pid.dir]] [[deb.log.dir]]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/cb75dbb7/zeppelin-distribution/src/deb/init.d/zeppelind
----------------------------------------------------------------------
diff --git a/zeppelin-distribution/src/deb/init.d/zeppelind 
b/zeppelin-distribution/src/deb/init.d/zeppelind
new file mode 100755
index 0000000..dbb22c4
--- /dev/null
+++ b/zeppelin-distribution/src/deb/init.d/zeppelind
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides:          zeppelind
+# Required-Start:    $remote_fs
+# Required-Stop:     $remote_fs
+# Should-Start:      $network $time
+# Should-Stop:       $network $time
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start and stop the zeppelin daemon
+# Description:       Controls the zeppelin daemon
+### END INIT INFO
+#
+
+test -e /usr/bin/zeppelin-daemon.sh || exit 1
+
+exec /usr/bin/zeppelin-daemon.sh $@

Reply via email to