Subject: [alpine-aports] [PATCH] testing/tomcat-native: new aport

From: Sean Summers <[email-masked]>
Date: Wed, 31 Dec 2014 07:08:59 +0000

http://tomcat.apache.org/native-doc/
native resources optional component for Apache Tomcat
---
 testing/tomcat-native/APKBUILD                    | 43 +++++++++++++++++++++++
 testing/tomcat-native/tomcat-native.post-install  |  2 ++
 testing/tomcat-native/tomcat-native.pre-deinstall |  2 ++
 3 files changed, 47 insertions(+)
 create mode 100644 testing/tomcat-native/APKBUILD
 create mode 100644 testing/tomcat-native/tomcat-native.post-install
 create mode 100644 testing/tomcat-native/tomcat-native.pre-deinstall

diff --git a/testing/tomcat-native/APKBUILD b/testing/tomcat-native/APKBUILD
new file mode 100644
index 0000000..6f121b7
--- /dev/null
+++ b/testing/tomcat-native/APKBUILD
@@ -0,0 +1,43 @@
+# Contributor: Sean Summers <[email-masked]>
+# Maintainer:
+pkgname=tomcat-native
+pkgver=1.1.32
+pkgrel=0
+pkgdesc="native resources optional component for Apache Tomcat"
+url="http://tomcat.apache.org/native-doc/"
+arch="all"
+license="ASL 2.0"
+depends="apr openssl openjdk7-jre-base"
+depends_dev="apr-dev openssl-dev openjdk7"
+makedepends="${depends_dev}"
+install="${pkgname}.post-install ${pkgname}.pre-deinstall"
+subpackages="${pkgname}-dev"
+source="http://mirrors.gigenet.com/apache/tomcat/tomcat-connectors/native/${pkgver}/source/${pkgname}-${pkgver}-src.tar.gz
+${install}
+"
+
+_builddir=${pkgname}-${pkgver}-src/jni/native
+build() {
+        cd "$_builddir"
+        ./configure --with-apr=/usr/bin/apr-1-config \
+                --with-java-home=/usr/lib/jvm/default-jvm \
+                --prefix="/usr" || return 1
+        make || return 1
+}
+
+package() {
+        cd "src/${_builddir}"
+        make DESTDIR="${pkgdir}" install || return 1
+	rm -f ${pkgdir}/usr/lib/*.la || true
+	rmdir ${pkgdir}/usr/* 2>/dev/null || true
+}
+
+md5sums="90b4f55d9e3f3614c7b780500268570b  tomcat-native-1.1.32-src.tar.gz
+da9daeac90300e192a592c0d96ae769c  tomcat-native.post-install
+4493951173ec5d3ac0b99a9d406163ef  tomcat-native.pre-deinstall"
+sha256sums="26936848f727e162f513bd2b5f7b2300d7d716a5e92e5f4ebcd0e1eff8e09584  tomcat-native-1.1.32-src.tar.gz
+68455f73bbe7777fea1c2267313f96209fadd1436c6f7a8090bccbcf8bcc3b10  tomcat-native.post-install
+71a0f80a9b947600cb9fd3fcdb1f1a58dd127fdb5355ac0a53a738b717d42fec  tomcat-native.pre-deinstall"
+sha512sums="695f710f91cf720b3115f9933f5dab56e7465ee0fcf6508b53d1de172ba59165b08f27b3cdfef741b60dbf0b3da97ae3ea87c5a0ef9f1d879a9820259197dcba  tomcat-native-1.1.32-src.tar.gz
+b92eb1da2c104f7314c446783c04ca3a0efc5d6126b7f2cc9bab5f9d987bee7057c57aa6ce8620dd411bbda556d9301b40bed0e0df4e64c981a458ba26457f2c  tomcat-native.post-install
+4a6474bc8ad16f3c5a0239daf8ffa671c341d9fad3f9fafd253398003e3da2fb9d63f3dcf4fc5565ad4e4868ed75698e6ae8b6699baa43aef55ec48b2bfc7292  tomcat-native.pre-deinstall"
diff --git a/testing/tomcat-native/tomcat-native.post-install b/testing/tomcat-native/tomcat-native.post-install
new file mode 100644
index 0000000..1774a04
--- /dev/null
+++ b/testing/tomcat-native/tomcat-native.post-install
@@ -0,0 +1,2 @@
+#!/bin/sh
+ln -s libtcnative-1.so.0 /usr/lib/libtcnative-1.so
diff --git a/testing/tomcat-native/tomcat-native.pre-deinstall b/testing/tomcat-native/tomcat-native.pre-deinstall
new file mode 100644
index 0000000..8541f8b
--- /dev/null
+++ b/testing/tomcat-native/tomcat-native.pre-deinstall
@@ -0,0 +1,2 @@
+#!/bin/sh
+rm /usr/lib/libtcnative-1.so
-- 
2.2.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Thu, 1 Jan 2015 16:57:10 +0100

On Wed, 31 Dec 2014 07:08:59 +0000

>  create mode 100644 testing/tomcat-native/tomcat-native.pre-deinstall

Hi, thanks. Applied, but i have a few questions below.

> +depends="apr openssl openjdk7-jre-base"

is the apr and openssl dependency due to a library or due to the need
for some executable?

Library dependencies are normally autodetected.

> +++ b/testing/tomcat-native/tomcat-native.post-install

why is the symlink created on install and removed on deinstall instead
of shipped as a part of the package?

why not something like:

diff --git a/testing/tomcat-native/APKBUILD b/testing/tomcat-native/APKBUILD
index 6f121b7..1e0da15 100644
--- a/testing/tomcat-native/APKBUILD
+++ b/testing/tomcat-native/APKBUILD
@@ -7,10 +7,10 @@ pkgdesc="native resources optional component for Apache Tomcat"
 url="http://tomcat.apache.org/native-doc/"
 arch="all"
 license="ASL 2.0"
-depends="apr openssl openjdk7-jre-base"
+depends="openjdk7-jre-base"
 depends_dev="apr-dev openssl-dev openjdk7"
 makedepends="${depends_dev}"
-install="${pkgname}.post-install ${pkgname}.pre-deinstall"
+install=""
 subpackages="${pkgname}-dev"
 source="http://mirrors.gigenet.com/apache/tomcat/tomcat-connectors/native/${pkgver}/source/${pkgname}-${pkgver}-src.tar.gz
 ${install}
@@ -29,7 +29,7 @@ package() {
         cd "src/${_builddir}"
         make DESTDIR="${pkgdir}" install || return 1
        rm -f ${pkgdir}/usr/lib/*.la || true
-       rmdir ${pkgdir}/usr/* 2>/dev/null || true
+       ln -s libtcnative-1.so.0 "$pkgdir"/usr/lib/libtcnative-1.so
 }
 
 md5sums="90b4f55d9e3f3614c7b780500268570b
 tomcat-native-1.1.32-src.tar.gz

-nc

---