1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-20 08:27:15 +00:00

. Update to 2.0.

. Modernise the port.

PR:		157634
Approved by:	Richard Stockley <rws@procopia.com> (MAINTAINER)
This commit is contained in:
Greg Lewis 2011-06-07 05:39:08 +00:00
parent 43d2dbccc4
commit bf72e81a1f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=275171
17 changed files with 2074 additions and 1660 deletions

View File

@ -6,53 +6,55 @@
#
PORTNAME= dbXML
PORTVERSION= 1.0b2
PORTREVISION= 4
PORTVERSION= 2.0
CATEGORIES= databases java
MASTER_SITES= SF/${PORTNAME:L}-core/OldFiles
DISTNAME= dbXML-Core-${PORTVERSION}
MASTER_SITES= SF/${PORTNAME:L}-core/${PORTNAME}/${PORTNAME}%20${PORTVERSION}/
DISTNAME= dbXML-${PORTVERSION}
MAINTAINER= rws@procopia.com
COMMENT= Java Native XML Database
RUN_DEPENDS= ${JAVA_HOME}/bin/java:${PORTSDIR}/java/jdk13
JAVA_HOME= ${LOCALBASE}/jdk1.3.1
WRKSRC= ${WRKDIR}/dbXML-Core-${PORTVERSION}
DBXML_HOME= ${PREFIX}/share/java/${PORTNAME}
USE_JAVA= 1.5+
DBXML_HOME= ${JAVASHAREDIR}/${PORTNAME}
PLIST_SUB+= T=${DBXML_HOME:S/^${PREFIX}\///}
NO_BUILD= yes
post-patch:
@${RM} ${WRKSRC}/config/system.xml.orig
SUB_FILES+= pkg-message \
dbxmlctl
SUB_LIST+= DBXML_HOME=${DBXML_HOME} \
USER=${USERS} \
PORTNAME=${PORTNAME:L}
USE_RC_SUBR= ${PORTNAME:L}
pre-install:
PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL
USERS= ${PORTNAME:L}
GROUPS= ${PORTNAME:L}
SHAREMODE= 0644
post-patch:
.for f in bin/dbxml bin/dbxml-gui install/create-db startup
@${REINPLACE_CMD} -e "s:%%DBXML_HOME%%:${DBXML_HOME}:" \
-e "s:%%LOCALBASE%%:${LOCALBASE}:" "${WRKSRC}/${f}"
.endfor
do-install:
@${MKDIR} ${DBXML_HOME}
@cd ${WRKSRC}; \
${CP} -R config docs idl java xml icons logs ${DBXML_HOME}; \
${CP} LICENSE ${DBXML_HOME}; \
${CP} README ${DBXML_HOME}
@${CAT} ${WRKSRC}/bin/dbxmladmin \
| ${SED} "s|%%PREFIX%%|${PREFIX}|g" > ${WRKDIR}/dbxmladmin
${INSTALL_SCRIPT} -m 755 ${WRKDIR}/dbxmladmin ${PREFIX}/bin
@${CAT} ${WRKSRC}/bin/dbxml \
| ${SED} "s|%%PREFIX%%|${PREFIX}|g" > ${WRKDIR}/dbxml
${INSTALL_SCRIPT} -m 755 ${WRKDIR}/dbxml ${PREFIX}/bin
@${CAT} ${FILESDIR}/00dbxml.sh \
| ${SED} "s|%%PREFIX%%|${PREFIX}|g" \
| ${SED} "s|%%JAVA_HOME%%|${JAVA_HOME}|g" > ${WRKDIR}/00dbxml.sh
${INSTALL_SCRIPT} ${WRKDIR}/00dbxml.sh ${PREFIX}/etc/rc.d
@${CAT} ${FILESDIR}/dbxmlctl \
| ${SED} "s|%%JAVA_HOME%%|${JAVA_HOME}|g" \
| ${SED} "s|%%DBXML_HOME%%|${DBXML_HOME}|g" > ${WRKDIR}/dbxmlctl
${INSTALL_SCRIPT} ${WRKDIR}/dbxmlctl ${PREFIX}/bin
.for d in cocoa config db docs install java jsp logs schemas stylesheets
@(cd ${WRKSRC} && ${COPYTREE_SHARE} ${d} ${DBXML_HOME})
.endfor
@${INSTALL_DATA} ${WRKSRC}/LICENSE ${DBXML_HOME}
@${INSTALL_DATA} ${WRKSRC}/README ${DBXML_HOME}
@${INSTALL_SCRIPT} ${WRKSRC}/startup ${DBXML_HOME}
@${CHOWN} -R ${USERS}:${GROUPS} ${DBXML_HOME}
.for f in dbxml dbxml-gui
@${INSTALL_SCRIPT} ${WRKSRC}/bin/${f} ${PREFIX}/bin/
.endfor
@${INSTALL_SCRIPT} ${WRKDIR}/dbxmlctl ${PREFIX}/bin/
.for f in install/create-db startup
@${CHMOD} 0755 ${DBXML_HOME}/${f}
.endfor
${CHOWN} -R dbxml:dbxml ${DBXML_HOME}
post-install:
@${ECHO} "etc/rc.d/00dbxml.sh" >> ${TMPPLIST}
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (dbXML-Core-1.0b2.tar.gz) = 01491c96e44e7414780e2fd9375e8e89483ddcc0b9390c8640bc3f6c8db996cc
SIZE (dbXML-Core-1.0b2.tar.gz) = 4914440
SHA256 (dbXML-2.0.tar.gz) = 0d8c59fb8beed49f41ebbd2dfc44e69aaac59230c0f5687fef66c789c31c4b0b
SIZE (dbXML-2.0.tar.gz) = 7718299

View File

@ -1,25 +0,0 @@
#!/bin/sh
JAVA_HOME=%%JAVA_HOME%%
export JAVA_HOME
DBXML_HOME=%%PREFIX%%/share/java/dbXML
export DBXML_HOME
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 1
fi
case "$1" in
start)
[ -x ${PREFIX}/bin/dbxmlctl ] && ${PREFIX}/bin/dbxmlctl start > /dev/null && echo -n ' dbXML'
;;
stop)
[ -r /var/run/dbXML.pid ] && ${PREFIX}/bin/dbxmlctl stop > /dev/null && echo -n ' dbXML'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac
exit 0

View File

@ -0,0 +1,30 @@
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: dbxml
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# dbxml_enable (bool): Set to NO by default.
# Set it to YES to enable dbxml.
#
. /etc/rc.subr
name="%%PORTNAME%%"
rcvar=${name}_enable
command=%%LOCALBASE%%/bin/dbxmlctl
pidfile=%%DBXML_HOME%%/config/${name}.pid
procname=java
load_rc_config ${name}
: ${dbxml_enable="NO"}
: ${dbxml_user="%%USER%%"}
run_rc_command "$1"

View File

@ -1,135 +0,0 @@
#!/bin/sh
# Set Variables
NAME=dbXML
DBXML_HOME=%%DBXML_HOME%%
LOG=${DBXML_HOME}/logs/${NAME}ctl.log
JAR_DIR=${DBXML_HOME}/java/lib
PID_FILE=/var/run/${NAME}.pid
MYSELF=`basename $0`
USER_NAME=dbxml
# Check if we're being run as a shell script or as an rc script
if [ ${MYSELF} = "00dbxml.sh" ]; then
AS_RC_SCRIPT=yes
else
AS_RC_SCRIPT=no
fi
# Check if the JAVA_HOME directory is defined, otherwise set it to the
# fallback default
if [ "${JAVA_HOME}a" = "a" ]; then
JAVA_HOME=%%JAVA_HOME%%
export JAVA_HOME
fi
JAVA_CMD=${JAVA_HOME}/bin/java
# Make sure the dbXML directory does exist
if [ ! -d ${DBXML_HOME} ]; then
if [ "${AS_RC_SCRIPT}" = "yes" ]; then
echo ""
fi
echo "${NAME}: ERROR: Unable to find dbXML home directory at ${DBXML_HOME}."
exit 1
fi
# Make sure the Java VM can be found
if [ ! -x ${JAVA_CMD} ]; then
if [ "${AS_RC_SCRIPT}" = "yes" ]; then
echo ""
fi
echo "${NAME}: ERROR: Unable to find Java VM at ${JAVA_HOME}."
exit 2
fi
# Make sure the JAR file Directory exists
if [ ! -d ${JAR_DIR} ]; then
if [ "${AS_RC_SCRIPT}" = "yes" ]; then
echo ""
fi
echo "${NAME}: ERROR: Unable to find JAR Directory at ${JAR_DIR}."
exit 3
fi
server_shutdown() {
# Read in instances and kill processes
INSTANCES="`cat ${DBXML_HOME}/config/instances.cfg`"
for instance in $INSTANCES
do
/usr/local/bin/dbxmladmin shutdown -c /$instance 1> /dev/null 2> /dev/null
done
# Remove stale pid file
rm ${PID_FILE}
}
server_start() {
# setup dbXML Classpath
CLASSPATH=${DBXML_HOME}/classgen:${DBXML_HOME}/config:$CLASSPATH
JARS=`ls -1 ${JAR_DIR}/*.jar`
for jar in $JARS
do
CLASSPATH=$jar:$CLASSPATH ;
done
# Read in the extra VM paramters for starting the program
VMPROPS=""
if [ -f ${DBXML_HOME}/config/vm.cfg ]; then
PROPS="`cat ${DBXML_HOME}/config/vm.cfg`"
for prop in $PROPS
do
VMPROPS="$VMPROPS $prop"
done
fi
# Setup pid file
touch ${PID_FILE}
chown ${USER_NAME} ${PID_FILE}
chmod 600 ${PID_FILE}
# Start dbXML
su -fm ${USER_NAME} -c "(cd ${DBXML_HOME} && ${JAVA_CMD} -Xms16m -Xmx168m -classpath "$CLASSPATH" -Ddbxml.home="${DBXML_HOME}" org.dbxml.core.server.dbXML & echo \$! > ${PID_FILE}) > ${LOG}"
}
case "$1" in
start)
# Make sure another instance of dbXML is not running
if [ -e ${PID_FILE} ]; then
if [ "${AS_RC_SCRIPT}" = "yes" ]; then
echo ""
fi
echo "A dbxml instance is already running with PID" `cat ${PID_FILE}`
exit 0
fi
echo "starting dbXML...."
server_start;
;;
stop)
# Make sure an instance of dbXML is running
if [ ! -e ${PID_FILE} ]; then
if [ "${AS_RC_SCRIPT}" = "yes" ]; then
echo ""
fi
echo "dbXML is not currently running"
exit 0
fi
echo "stopping dbXML...."
server_shutdown;
;;
restart)
# Make sure an instance of dbXML is running
if [ ! -e ${PID_FILE} ]; then
server_start;
else
echo "restarting dbXML...."
server_shutdown;
server_start;
fi
;;
*)
echo ""
echo "Usage: ${MYSELF} { start | restart | stop}"
echo ""
exit 64
;;
esac

View File

@ -0,0 +1,30 @@
#!/bin/sh
#
# $FreeBSD$
DBXML_HOME=%%DBXML_HOME%%
# Read in the list of dbXML Jars to include in the BOOTPATH
BOOTPATH=""
JARS=`ls -1 $DBXML_HOME/java/lib/*.jar`
for jar in $JARS
do
BOOTPATH=$jar:$BOOTPATH ;
done
# Read in the extra VM paramters for starting the program
VMPROPS=""
if test -f $DBXML_HOME/config/vm.cfg; then
PROPS="`cat $DBXML_HOME/config/vm.cfg`"
for prop in $PROPS
do
VMPROPS="$VMPROPS $prop"
done
fi
cd $DBXML_HOME
%%LOCALBASE%%/bin/java -Xbootclasspath/p:"$BOOTPATH" -classpath "$CLASSPATH" -Xms64m -Xmx384m -Ddbxml.home="$DBXML_HOME" $VMPROPS com.dbxml.db.server.Server $* &
JAVA_PID=$!
echo ${JAVA_PID} > $DBXML_HOME/config/dbxml.pid

View File

@ -1,11 +0,0 @@
--- config/system.xml.orig Mon Sep 24 21:50:25 2001
+++ config/system.xml Sun Oct 21 01:37:42 2001
@@ -51,7 +51,7 @@
<aliases>
<alias name="icons" path="./icons" />
<alias name="doc" path="./docs" />
- <alias name="javadoc" path="./java/docs/api" />
+ <alias name="javadoc" path="./docs/api" />
<alias name="scripts" path="./scripts" />
</aliases>
<methods>

View File

@ -1,17 +0,0 @@
--- bin/dbxmladmin.orig Mon Sep 24 21:50:39 2001
+++ bin/dbxmladmin Sun Oct 21 22:12:44 2001
@@ -1,8 +1,12 @@
#!/bin/sh
-if test -z $DBXML_HOME; then
- echo "\$DBXML_HOME Is Not Set"
+DBXML_HOME=%%PREFIX%%/share/java/dbXML
+
+if test -z $JAVA_HOME; then
+ echo "Warning: JAVA_HOME environment variable is not set."
exit
+else
+ PATH=$JAVA_HOME/bin:$PATH
fi
CMD_HOME=`dirname $0`

View File

@ -1,17 +0,0 @@
--- bin/dbxml.orig Mon Sep 24 21:50:14 2001
+++ bin/dbxml Mon Oct 22 02:08:32 2001
@@ -1,8 +1,12 @@
#!/bin/sh
-if test -z $DBXML_HOME; then
- echo "\$DBXML_HOME Is Not Set"
+DBXML_HOME=%%PREFIX%%/share/java/dbXML
+
+if test -z $JAVA_HOME; then
+ echo "Warning: JAVA_HOME environment variable is not set."
exit
+else
+ PATH=$JAVA_HOME/bin:$PATH
fi
CMD_HOME=`dirname $0`

View File

@ -0,0 +1,21 @@
$FreeBSD$
--- bin/dbxml.orig 2011-06-01 22:00:39.000000000 -0700
+++ bin/dbxml 2011-06-01 22:05:21.000000000 -0700
@@ -1,9 +1,6 @@
#!/bin/sh
-if test -z "$DBXML_HOME"; then
- echo "\$DBXML_HOME Is Not Set"
- exit
-fi
+DBXML_HOME=%%DBXML_HOME%%
CMD_NAME=`basename $0`
@@ -47,4 +44,4 @@
fi
fi
-java -classpath "$CLASSPATH" -Xms16m -Xmx128m -Ddbxml.home="$DBXML_HOME" $VMPROPS $CLASS_NAME $*
+%%LOCALBASE%%/bin/java -classpath "$CLASSPATH" -Xms16m -Xmx128m -Ddbxml.home="$DBXML_HOME" $VMPROPS $CLASS_NAME $*

View File

@ -0,0 +1,21 @@
$FreeBSD$
--- bin/dbxml-gui.orig 2011-06-01 22:00:39.000000000 -0700
+++ bin/dbxml-gui 2011-06-01 22:05:21.000000000 -0700
@@ -1,9 +1,6 @@
#!/bin/sh
-if test -z "$DBXML_HOME"; then
- echo "\$DBXML_HOME Is Not Set"
- exit
-fi
+DBXML_HOME=%%DBXML_HOME%%
CMD_NAME=`basename $0`
@@ -47,4 +44,4 @@
fi
fi
-java -classpath "$CLASSPATH" -Xms16m -Xmx128m -Ddbxml.home="$DBXML_HOME" $VMPROPS $CLASS_NAME $*
+%%LOCALBASE%%/bin/java -classpath "$CLASSPATH" -Xms16m -Xmx128m -Ddbxml.home="$DBXML_HOME" $VMPROPS $CLASS_NAME $*

View File

@ -0,0 +1,23 @@
$FreeBSD$
--- install/create-db.orig 2011-06-03 19:41:59.000000000 -0700
+++ install/create-db 2011-06-03 19:43:04.000000000 -0700
@@ -1,8 +1,6 @@
#!/bin/sh
-if test -z "$DBXML_HOME"; then
- DBXML_HOME=`dirname $0`
- export DBXML_HOME
-fi
+
+DBXML_HOME=%%DBXML_HOME%%
echo "dbXML Server Bootstrap"
echo "======================"
@@ -53,6 +51,6 @@
echo $$ > $DBXML_HOME/config/dbxml.pid
-java -Xbootclasspath/p:"$BOOTPATH" -classpath "$CLASSPATH" -Xms64m -Xmx384m -Ddbxml.home="$DBXML_HOME" $VMPROPS com.dbxml.db.server.ServerBootstrap $*
+%%LOCALBASE%%/bin/java -Xbootclasspath/p:"$BOOTPATH" -classpath "$CLASSPATH" -Xms64m -Xmx384m -Ddbxml.home="$DBXML_HOME" $VMPROPS com.dbxml.db.server.ServerBootstrap $*
rm $DBXML_HOME/config/dbxml.pid

View File

@ -0,0 +1,24 @@
$FreeBSD$
--- startup.orig 2011-06-03 21:32:56.000000000 -0700
+++ startup 2011-06-03 21:35:33.000000000 -0700
@@ -1,8 +1,6 @@
#!/bin/sh
-if test -z "$DBXML_HOME"; then
- DBXML_HOME=`dirname $0`
- export DBXML_HOME
-fi
+
+DBXML_HOME=%%DBXML_HOME%%
echo "dbXML Loader"
echo "============"
@@ -83,7 +81,7 @@
do
RESTART=
- java -Xbootclasspath/p:"$BOOTPATH" -classpath "$CLASSPATH" -Xms64m -Xmx384m -Ddbxml.home="$DBXML_HOME" $VMPROPS com.dbxml.db.server.Server $* &
+ %%LOCALBASE%%/bin/java -Xbootclasspath/p:"$BOOTPATH" -classpath "$CLASSPATH" -Xms64m -Xmx384m -Ddbxml.home="$DBXML_HOME" $VMPROPS com.dbxml.db.server.Server $* &
JAVA_PID=$!
wait $JAVA_PID
done

View File

@ -0,0 +1,4 @@
Before running dbxml for the first time you should run:
%%DBXML_HOME%%/install/create-db

View File

@ -5,4 +5,4 @@ the ability to query these collections using XPath. The server is
lightweight, modular and suitable for embedding in custom applications
or running as a standalone database.
WWW: http://www.dbxml.com/
WWW: http://dbxml-core.sourceforge.net/

View File

@ -1,34 +0,0 @@
#!/bin/sh
# $FreeBSD: /tmp/pcvs/ports/databases/dbXML/Attic/pkg-install,v 1.1 2002-03-05 00:43:18 znerd Exp $
#
if [ "$2" != "PRE-INSTALL" ]; then
exit 0
fi
USER=dbxml
GROUP=${USER}
UID=4080
GID=${UID}
if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
if pw groupadd ${GROUP} -g ${GID}; then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
fi
if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-s "/sbin/nologin" -d "/nonexistent" \
-c "dbXML Owner"; \
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
exit 0

File diff suppressed because it is too large Load Diff