ports/91981: [Maintainer Update] german/tvbrowser: use new start script
Lars Engels
Lars.Engels at 0x20.net
Thu Jan 19 00:40:05 UTC 2006
>Number: 91981
>Category: ports
>Synopsis: [Maintainer Update] german/tvbrowser: use new start script
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Thu Jan 19 00:40:03 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Lars Engels
>Release: FreeBSD 6.0-STABLE i386
>Organization:
>Environment:
System: FreeBSD krusty.bsd-geek.de 6.0-STABLE FreeBSD 6.0-STABLE #0: Sat Dec 3 03:05:43 CET 2005 lars at krusty.bsd-geek.de:/usr/obj/usr/src/sys/KRUSTY i386
>Description:
- Make tvbrowser depend on shells/bash and use a slighty altered version of the distfile's original start script.
- Install the port in a nicer way
- Bump port revision.
- Rename ${WRKDIR}/tvbrowser to ${WRKDIR}/tvbrowser.in so the first one can be deleted from CVS
>How-To-Repeat:
>Fix:
--- tvbrowser-2.1_1.diff begins here ---
diff -Nur german/tvbrowser/Makefile german/tvbrowser-2.1_1/Makefile
--- german/tvbrowser/Makefile Sat Nov 26 13:21:46 2005
+++ german/tvbrowser-2.1_1/Makefile Thu Jan 19 01:27:13 2006
@@ -14,14 +14,19 @@
MAINTAINER= lars.engels at 0x20.net
COMMENT= A digital tv guide
-NO_BUILD= yes
-USE_JAVA= yes
-JAVA_VERSION= 1.4+
+RUN_DEPENDS= ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash
+
+NO_BUILD= yes
+USE_JAVA= yes
+JAVA_VERSION= 1.4+
+USE_REINPLACE= yes
+
+SUB_FILES= tvbrowser
do-install:
- @${MKDIR} ${PREFIX}/share/${PORTNAME}
- @${CP} -r ${WRKSRC}/* ${PREFIX}/share/${PORTNAME}
- @${CP} -r ${FILESDIR}/tvbrowser /${PREFIX}/bin/
- @${CHMOD} 755 /${PREFIX}/bin/tvbrowser
+ cd ${WRKSRC} && ${FIND} . -type d -exec ${MKDIR} ${DATADIR}/{} \;
+ cd ${WRKSRC} && ${FIND} . -type f -exec ${INSTALL_DATA} {} ${DATADIR}/{} \;
+ ${REINPLACE_CMD} 's|/usr/local/share/tvbrowser|${DATADIR}|' ${WRKDIR}/tvbrowser
+ ${INSTALL_SCRIPT} ${WRKDIR}/tvbrowser ${PREFIX}/bin/tvbrowser
.include <bsd.port.mk>
diff -Nur german/tvbrowser/files/tvbrowser german/tvbrowser-2.1_1/files/tvbrowser
--- german/tvbrowser/files/tvbrowser Thu Nov 24 08:38:50 2005
+++ german/tvbrowser-2.1_1/files/tvbrowser Thu Jan 1 01:00:00 1970
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-cd /usr/local/share/tvbrowser && java -jar tvbrowser.jar
diff -Nur german/tvbrowser/files/tvbrowser.in german/tvbrowser-2.1_1/files/tvbrowser.in
--- german/tvbrowser/files/tvbrowser.in Thu Jan 1 01:00:00 1970
+++ german/tvbrowser-2.1_1/files/tvbrowser.in Thu Jan 19 01:05:22 2006
@@ -0,0 +1,93 @@
+#!/usr/local/bin/bash
+
+# Based on Start-Script provided by Azureus
+
+######## CONFIGURE ########
+JAVA_PROGRAM_DIR="" # use full path to java bin dir, ex. "/usr/java/j2sdk1.4.2/bin/"
+#PROGRAM_DIR="/home/username/apps/tvbrowser" # use full path to TV-Browser bin dir
+##########i#################
+
+MSG0="Loading TV-Browser:"
+MSG1="Starting TV-Browser..."
+MSG2="Java exec found in "
+MSG3="OOPS, your java version is too old "
+MSG4="You need to upgrade to JRE 1.4.x or newer from http://java.sun.com"
+MSG5="Suitable java version found "
+MSG6="Configuring environment..."
+MSG7="OOPS, you don't seem to have a valid JRE "
+MSG8="OOPS, unable to locate java exec in "
+MSG9=" hierarchy"
+MSG10="Java exec not found in PATH, starting auto-search..."
+MSG11="Java exec found in PATH. Verifying..."
+
+look_for_java()
+{
+ JAVADIR=/usr/java
+ IFS=$'\n'
+ potential_java_dirs=(`ls -1 "$JAVADIR" | sort | tac`)
+ IFS=
+ for D in "${potential_java_dirs[@]}"; do
+ if [[ -d "$JAVADIR/$D" && -x "$JAVADIR/$D/bin/java" ]]; then
+ JAVA_PROGRAM_DIR="$JAVADIR/$D/bin/"
+ echo $MSG2 $JAVA_PROGRAM_DIR
+ if check_version ; then
+ return 0
+ else
+ return 1
+ fi
+ fi
+ done
+ echo $MSG8 "${JAVADIR}/" $MSG9 ; echo $MSG4
+ return 1
+}
+
+check_version()
+{
+ JAVA_HEADER=`${JAVA_PROGRAM_DIR}java -version 2>&1 | head -n 1`
+ JAVA_IMPL=`echo ${JAVA_HEADER} | cut -f1 -d' '`
+ if [ "$JAVA_IMPL" = "java" ] ; then
+ VERSION=`echo ${JAVA_HEADER} | sed "s/java version \"\(.*\)\"/\1/"`
+ if echo $VERSION | grep "^1.[0-3]" ; then
+ echo $MSG3 "[${JAVA_PROGRAM_DIR}java = ${VERSION}]" ; echo $MSG4
+ return 1
+ else
+ echo $MSG5 "[${JAVA_PROGRAM_DIR}java = ${VERSION}]" ; echo $MSG6
+ return 0
+ fi
+ else
+ echo $MSG7 "[${JAVA_PROGRAM_DIR}java = ${JAVA_IMPL}]" ; echo $MSG4
+ return 1
+ fi
+}
+
+echo $MSG1
+
+# locate and test the java executable
+if [ "$JAVA_PROGRAM_DIR" == "" ]; then
+ if ! command -v java &>/dev/null; then
+ echo $MSG10
+ if ! look_for_java ; then
+ exit 1
+ fi
+ else
+ echo $MSG11
+ if ! check_version ; then
+ if ! look_for_java ; then
+ exit 1
+ fi
+ fi
+ fi
+fi
+
+
+PROGRAM_DIR=/usr/local/share/tvbrowser
+
+echo $MSG0
+
+cd ${PROGRAM_DIR}
+
+echo "${JAVA_PROGRAM_DIR}java -Xms16m -Xmx128m -Djava.library.path=\"${PROGRAM_DIR}\" -Dpropertiesfile=linux.properties -jar tvbrowser.jar '$@'"
+${JAVA_PROGRAM_DIR}java -Xms16m -Xmx128m -Djava.library.path="${PROGRAM_DIR}" -Dpropertiesfile=linux.properties -jar tvbrowser.jar "$@"
+
+echo "TV-Browser TERMINATED."
+
--- tvbrowser-2.1_1.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list