Reimport java-tanukiwrapper-3.5.43

Required for net/i2p

ok rsadowski@
Port sent by Dimitri Karamazov who takes maintainership
This commit is contained in:
solene 2020-11-04 20:45:00 +00:00
parent 1c57351dc5
commit be8eabd1ec
12 changed files with 335 additions and 0 deletions

View File

@ -0,0 +1,56 @@
# $OpenBSD: Makefile,v 1.16 2020/11/04 20:45:00 solene Exp $
COMMENT= Tanuki Java Service Wrapper
DISTNAME= wrapper_3.5.43_src
PKGNAME= java-tanukiwrapper-3.5.43
CATEGORIES= java
HOMEPAGE= https://wrapper.tanukisoftware.com/
MAINTAINER= Dimitri Karamazov <deserter666@danwin1210.me>
MASTER_SITES= https://download.tanukisoftware.com/wrapper/3.5.43/
# GPLv2
PERMIT_PACKAGE= Yes
MODULES= java
MODJAVA_VER= 1.8
MODJAVA_BUILD= ant
.include <bsd.port.arch.mk>
.if ${PROPERTIES:Mlp64}
BITS=64
.else
BITS=32
.endif
MODJAVA_BUILD_ARGS= -Dbits=${BITS}
WANTLIB= c iconv m pthread
LIB_DEPENDS= converters/libiconv
USE_GMAKE= Yes
SUBST_VARS+= CC CFLAGS
post-extract:
cp ${FILESDIR}/Makefile-openbsd-x86-${BITS}.gmake ${WRKSRC}/src/c/
pre-configure:
${SUBST_CMD} ${WRKSRC}/src/c/Makefile-openbsd-x86-${BITS}.gmake
do-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/java/classes/ \
${PREFIX}/lib/tanukuwrapper/
${INSTALL_DATA} ${WRKSRC}/lib/wrapper.jar \
${PREFIX}/share/java/classes/tanukiwrapper.jar
${INSTALL_PROGRAM} ${WRKSRC}/lib/libwrapper.so ${PREFIX}/lib/tanukuwrapper/
${INSTALL_PROGRAM} ${WRKSRC}/bin/wrapper ${PREFIX}/sbin/tanukiwrapper
do-test:
cd ${WRKSRC} && ant -Dbits=${BITS} -f build-tests.xml
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (wrapper_3.5.43_src.tar.gz) = S4Au4DZUHu2X8Pqzo2V5ukZNnO37om8KEOvMTAoanaU=
SIZE (wrapper_3.5.43_src.tar.gz) = 736950

View File

@ -0,0 +1,42 @@
# Copyright (c) 1999, 2013 Tanuki Software, Ltd.
# http://www.tanukisoftware.com
# All rights reserved.
#
# This software is the proprietary information of Tanuki Software.
# You shall use it only in accordance with the terms of the
# license agreement you entered into with Tanuki Software.
# http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
CC = ${CC} -Wall -pedantic -DOPENBSD -I${LOCALBASE}/include -L${LOCALBASE}/lib -liconv -DUNICODE -D_UNICODE
INCLUDE=$(JAVA_HOME)/include
CFLAGS = ${CFLAGS} -I$(INCLUDE) -I$(INCLUDE)/openbsd
wrapper_SOURCE = wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c logger_file.c wrapper_file.c wrapper_i18n.c wrapper_hashmap.c wrapper_ulimit.c wrapper_encoding.c wrapper_jvminfo.c
libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o loggerjni.o
BIN = ../../bin
LIB = ../../lib
all: init wrapper libwrapper.so
clean:
rm -f *.o
cleanall: clean
rm -rf *~ .deps
rm -f $(BIN)/wrapper $(LIB)/libwrapper.so
init:
if test ! -d .deps; then mkdir .deps; fi
wrapper: $(wrapper_SOURCE)
$(CC) $(wrapper_SOURCE) -lm -rdynamic -lc -pthread -o $(BIN)/wrapper
libwrapper.so: $(libwrapper_so_OBJECTS)
$(CC) -shared -rdynamic -lc -pthread $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
#%.o: %.c
# $(COMPILE) -c $(DEFS) $<

View File

@ -0,0 +1,42 @@
# Copyright (c) 1999, 2013 Tanuki Software, Ltd.
# http://www.tanukisoftware.com
# All rights reserved.
#
# This software is the proprietary information of Tanuki Software.
# You shall use it only in accordance with the terms of the
# license agreement you entered into with Tanuki Software.
# http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
CC = ${CC} -Wall -fPIC -pedantic -DOPENBSD -DJSW64 -I${LOCALBASE}/include -L${LOCALBASE}/lib -liconv -DUNICODE -D_UNICODE
INCLUDE=$(JAVA_HOME)/include
CFLAGS = ${CFLAGS} -I$(INCLUDE) -I$(INCLUDE)/openbsd
wrapper_SOURCE = wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c logger_file.c wrapper_file.c wrapper_i18n.c wrapper_hashmap.c wrapper_ulimit.c wrapper_encoding.c wrapper_jvminfo.c
libwrapper_so_OBJECTS = wrapper_i18n.o wrapperjni_unix.o wrapperinfo.o wrapperjni.o loggerjni.o
BIN = ../../bin
LIB = ../../lib
all: init wrapper libwrapper.so
clean:
rm -f *.o
cleanall: clean
rm -rf *~ .deps
rm -f $(BIN)/wrapper $(LIB)/libwrapper.so
init:
if test ! -d .deps; then mkdir .deps; fi
wrapper: $(wrapper_SOURCE)
$(CC) $(wrapper_SOURCE) -lm -rdynamic -lc -pthread -o $(BIN)/wrapper
libwrapper.so: $(libwrapper_so_OBJECTS)
$(CC) -shared -rdynamic -lc -pthread $(libwrapper_so_OBJECTS) -o $(LIB)/libwrapper.so
#%.o: %.c
# $(COMPILE) -c $(DEFS) $<

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-build-tests_xml,v 1.3 2020/11/04 20:45:00 solene Exp $
add OpenBSD target
--- build-tests.xml.orig Fri Jul 31 18:04:03 2020
+++ build-tests.xml Fri Jul 31 18:04:58 2020
@@ -114,11 +114,15 @@
<property name="is.Unix" value="true"/>
<property name="is.shell.sh" value="true"/>
</target>
+ <target name="init-openbsd" if="is.OpenBSD">
+ <property name="is.Unix" value="true"/>
+ <property name="is.shell.sh" value="true"/>
+ </target>
<!-- =================================================================== -->
<!-- Initialize build. -->
<!-- =================================================================== -->
- <target name="init" depends="init-windows, init-linux, init-solaris, init-aix, init-hpux, init-macosx, init-freebsd">
+ <target name="init" depends="init-windows, init-linux, init-solaris, init-aix, init-hpux, init-macosx, init-freebsd, init-openbsd">
</target>
<!-- =================================================================== -->

View File

@ -0,0 +1,41 @@
$OpenBSD: patch-build_xml,v 1.3 2020/11/04 20:45:00 solene Exp $
define OpenBSD property
--- build.xml.orig Fri Jul 31 18:06:35 2020
+++ build.xml Fri Jul 31 18:10:16 2020
@@ -83,6 +83,9 @@
<condition property="dist.os" value="os400">
<equals arg1="${os.name}" arg2="OS/400"/>
</condition>
+ <condition property="dist.os" value="openbsd">
+ <equals arg1="${os.name}" arg2="OpenBSD"/>
+ </condition>
<property name="dist.os" value="${os.name}"/>
<!-- Resolve an architecture to use in release names. -->
@@ -386,6 +389,7 @@
<condition property="make.name" value="gmake">
<or>
<isset property="is.freebsd"/>
+ <isset property="is.openbsd"/>
<isset property="is.solaris"/>
</or>
</condition>
@@ -403,6 +407,7 @@
<or>
<isset property="is.linux"/>
<isset property="is.freebsd"/>
+ <isset property="is.openbsd"/>
<isset property="is.solaris"/>
</or>
</condition>
@@ -1823,6 +1828,8 @@ wrapper.filter.action.999=NONE]]></replacevalue>
<release-delta-extract-platform osname="linux" osarch="armel" bits="32" wrapperbinhead="wrapper" wrapperbintail="" wrapperlibhead="libwrapper" wrapperlibtail=".so" archivetype="tar.gz"/>
<release-delta-extract-platform osname="linux" osarch="armhf" bits="32" wrapperbinhead="wrapper" wrapperbintail="" wrapperlibhead="libwrapper" wrapperlibtail=".so" archivetype="tar.gz"/>
<release-delta-extract-platform osname="linux" osarch="armhf" bits="64" wrapperbinhead="wrapper" wrapperbintail="" wrapperlibhead="libwrapper" wrapperlibtail=".so" archivetype="tar.gz"/>
+ <release-delta-extract-platform osname="openbsd" osarch="x86" bits="32" wrapperbinhead="wrapper" wrapperbintail="" wrapperlibhead="libwrapper" wrapperlibtail=".so" archivetype="tar.gz"/>
+ <release-delta-extract-platform osname="openbsd" osarch="x86" bits="64" wrapperbinhead="wrapper" wrapperbintail="" wrapperlibhead="libwrapper" wrapperlibtail=".so" archivetype="tar.gz"/>
</target>
<target name="release-delta" depends="pre-release:check, release-delta:init, release-delta:extract-platforms">
<property name="deltareleasefile" value="wrapper-delta-pack-${version}"/>

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_c_logger_c,v 1.3 2020/11/04 20:45:00 solene Exp $
add OpenBSD logging support
--- src/c/logger.c.orig Fri Jul 31 18:11:51 2020
+++ src/c/logger.c Fri Jul 31 18:12:14 2020
@@ -73,7 +73,7 @@ typedef long intptr_t;
#include <sys/errno.h>
#include <sys/fcntl.h>
#elif defined(AIX) || defined(HPUX) || defined(MACOSX)
- #elif defined(FREEBSD)
+ #elif defined(FREEBSD) || defined(OPENBSD)
#include <sys/param.h>
#include <errno.h>
#else /* LINUX */

View File

@ -0,0 +1,51 @@
$OpenBSD: patch-src_c_wrapper_c,v 1.3 2020/11/04 20:45:00 solene Exp $
add OpenBSD support
--- src/c/wrapper.c.orig Thu Mar 5 09:25:57 2020
+++ src/c/wrapper.c Fri Jul 31 18:32:51 2020
@@ -104,7 +104,7 @@
#include <sys/errno.h>
#include <sys/fcntl.h>
#elif defined(AIX) || defined(HPUX) || defined(MACOSX)
- #elif defined(FREEBSD)
+ #elif defined(FREEBSD) || defined(OPENBSD)
#include <sys/param.h>
#include <errno.h>
#else /* LINUX */
@@ -5784,7 +5784,7 @@ int wrapperRunCommonInner() {
tz1 = tzname[0];
tz2 = tzname[1];
#endif
-#ifndef FREEBSD
+#if !defined(FREEBSD) && !defined(OPENBSD)
log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("Timezone: %s (%s) Offset: %ld, hasDaylight: %d"),
tz1, tz2, timezone, daylight);
#else
@@ -6454,7 +6454,7 @@ int checkIfBinary(const TCHAR *filename) {
log_printf(WRAPPER_SOURCE_WRAPPER, LEVEL_DEBUG, TEXT("Magic number for file %s: 0x%02x%02x%02x%02x"), filename, head[0], head[1], head[2], head[3]);
}
-#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS)
+#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS) || defined(OPENBSD)
if (head[1] == 'E' && head[2] == 'L' && head[3] == 'F') {
return 1; /*ELF */
#elif defined(AIX)
@@ -7882,7 +7882,7 @@ int wrapperBuildJavaCommandArrayInner(TCHAR **strings,
/* See if the auto bits parameter is set. Ignored by all but the following platforms. */
-#if /*defined(WIN32) || defined(LINUX) ||*/ defined(HPUX) || defined(MACOSX) || defined(SOLARIS) || defined(FREEBSD)
+#if /*defined(WIN32) || defined(LINUX) ||*/ defined(HPUX) || defined(MACOSX) || defined(SOLARIS) || defined(FREEBSD) || defined(OPENBSD)
if (wrapperData->javaVersion->major < 9) {
if (getBooleanProperty(properties,
@@ -7897,6 +7897,8 @@ int wrapperBuildJavaCommandArrayInner(TCHAR **strings,
TEXT("wrapper.java.additional.auto_bits.solaris"),
#elif defined(FREEBSD)
TEXT("wrapper.java.additional.auto_bits.freebsd"),
+#elif defined(OPENBSD)
+ TEXT("wrapper.java.additional.auto_bits.openbsd"),
#elif defined(MACOSX)
TEXT("wrapper.java.additional.auto_bits.macosx"),
#endif

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-src_c_wrapper_h,v 1.3 2020/11/04 20:45:00 solene Exp $
OpenBSD doesn't support timeb api
--- src/c/wrapper.h.orig Fri Jul 31 18:19:37 2020
+++ src/c/wrapper.h Fri Jul 31 18:21:15 2020
@@ -51,7 +51,12 @@
#define DWORD unsigned long
#endif
-#include <sys/timeb.h>
+struct timeb {
+ time_t time; /* seconds since the Epoch */
+ unsigned short millitm; /* + milliseconds since the Epoch */
+ short timezone; /* minutes west of UTC */
+ short dstflag; /* DST == non-zero */
+};
#include "property.h"
#include "wrapper_jvminfo.h"

View File

@ -0,0 +1,26 @@
$OpenBSD: patch-src_c_wrapper_unix_c,v 1.4 2020/11/04 20:45:00 solene Exp $
OpenBSD doesn't support timeb api
add SI_ASYNCIO define
--- src/c/wrapper_unix.c.orig Fri Jul 31 18:22:16 2020
+++ src/c/wrapper_unix.c Fri Jul 31 18:23:10 2020
@@ -51,7 +51,6 @@
#include <pthread.h>
#include <pwd.h>
#include <sys/resource.h>
-#include <sys/timeb.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
@@ -466,8 +465,10 @@ const TCHAR* getSignalCodeDesc(int code) {
return TEXT("mesq state changed");
#endif
+#ifdef SI_ASYNCIO
case SI_ASYNCIO:
return TEXT("AIO completed");
+#endif
#ifdef SI_SIGIO
case SI_SIGIO:

View File

@ -0,0 +1,10 @@
The Java Service Wrapper is an application which has evolved out of a
desire to solve a number of problems common to many Java applications:
- Run as a Windows Service or Unix Daemon
- Application Reliability
- Standard, Out of the Box Scripting
- On Demand Restarts
- Flexible Configuration
- Ease Application Installations
- Logging

View File

@ -0,0 +1,7 @@
@comment $OpenBSD: PLIST,v 1.3 2020/11/04 20:45:00 solene Exp $
lib/tanukuwrapper/
@so lib/tanukuwrapper/libwrapper.so
@bin sbin/tanukiwrapper
share/java/
share/java/classes/
share/java/classes/tanukiwrapper.jar