From ba74d34264efa3ee817615bcfa6bb16fc6de5ae7 Mon Sep 17 00:00:00 2001
From: Ubbo Veentjer <veentjer@sub.uni-goettingen.de>
Date: Wed, 4 Nov 2015 16:49:23 +0100
Subject: [PATCH] deb build

---
 pom.xml                  | 33 +++++++++++++++++++++++++++++++++
 src/deb/control/control  |  7 +++++++
 src/deb/control/postinst |  5 +++++
 src/deb/control/preinst  |  5 +++++
 4 files changed, 50 insertions(+)
 create mode 100644 src/deb/control/control
 create mode 100644 src/deb/control/postinst
 create mode 100644 src/deb/control/preinst

diff --git a/pom.xml b/pom.xml
index 54e2284..f472489 100644
--- a/pom.xml
+++ b/pom.xml
@@ -571,6 +571,39 @@
                 		</plugins>
                 	</build>
                 </profile>
+                <profile>
+                <id>textgrid.deb</id>
+                    <build>
+                      <plugins>
+                        <plugin>
+                          <artifactId>jdeb</artifactId>
+                          <groupId>org.vafer</groupId>
+                          <version>1.4</version>
+                          <executions>
+                            <execution>
+                              <phase>package</phase>
+                              <goals>
+                                <goal>jdeb</goal>
+                              </goals>
+                              <configuration>
+                                <snapshotExpand>true</snapshotExpand>
+                                <dataSet>
+                                  <data>
+                                    <type>file</type>
+                                    <src>${project.build.directory}/${project.build.finalName}.war</src>
+                                    <mapper>
+                                      <type>perm</type>
+                                      <prefix>/var/textgrid/webapps</prefix>
+                                    </mapper>
+                                  </data>
+                                </dataSet>
+                              </configuration>
+                            </execution>
+                          </executions>
+                        </plugin>
+                      </plugins>
+                  </build>
+                </profile>
         </profiles>
         <organization>
 		    <name>TextGrid</name>
diff --git a/src/deb/control/control b/src/deb/control/control
new file mode 100644
index 0000000..0ba9893
--- /dev/null
+++ b/src/deb/control/control
@@ -0,0 +1,7 @@
+Package: [[artifactId]]
+Version: [[version]]
+Section: misc
+Priority: low
+Architecture: all
+Description: [[description]]
+Maintainer: info@textgrid.de
diff --git a/src/deb/control/postinst b/src/deb/control/postinst
new file mode 100644
index 0000000..94b3799
--- /dev/null
+++ b/src/deb/control/postinst
@@ -0,0 +1,5 @@
+#!/bin/bash
+invoke-rc.d tomcat-aggregator start
+# return success, even if service not installed
+exit 0
+
diff --git a/src/deb/control/preinst b/src/deb/control/preinst
new file mode 100644
index 0000000..73003da
--- /dev/null
+++ b/src/deb/control/preinst
@@ -0,0 +1,5 @@
+#!/bin/bash
+invoke-rc.d tomcat-aggregator stop
+# return success, even if service not installed
+exit 0
+
-- 
GitLab