diff options
author | hq <hq@FreeBSD.org> | 2005-09-20 22:52:31 +0800 |
---|---|---|
committer | hq <hq@FreeBSD.org> | 2005-09-20 22:52:31 +0800 |
commit | 22619e3c8af63c748d51979d095d6bac71aa5d21 (patch) | |
tree | 62b5ba466c9be2e51efa4f13f1986dabfd513c8a /games | |
parent | b58689169a056b86777420acbab758e692f6c2a3 (diff) | |
download | freebsd-ports-gnome-22619e3c8af63c748d51979d095d6bac71aa5d21.tar.gz freebsd-ports-gnome-22619e3c8af63c748d51979d095d6bac71aa5d21.tar.zst freebsd-ports-gnome-22619e3c8af63c748d51979d095d6bac71aa5d21.zip |
- Update to 1.34 [1]
- Improve launcher shell script (use javavmwrapper)
- Use ${INSTALL_DATA} to install data files
- Use ${INSTALL_SCRIPT} to install launcher script
- Use ${DATADIR}
PR: 86110 [1]
Submitted by: maintainer [1]
Approved by: maintainer
Diffstat (limited to 'games')
-rw-r--r-- | games/hattrickorganizer/Makefile | 16 | ||||
-rw-r--r-- | games/hattrickorganizer/distinfo | 4 | ||||
-rw-r--r-- | games/hattrickorganizer/files/hattrickorganizer | 193 | ||||
-rw-r--r-- | games/hattrickorganizer/files/hattrickorganizer.sh.in | 339 | ||||
-rw-r--r-- | games/hattrickorganizer/files/pkg-message.in | 29 | ||||
-rw-r--r-- | games/hattrickorganizer/pkg-plist | 20 |
6 files changed, 365 insertions, 236 deletions
diff --git a/games/hattrickorganizer/Makefile b/games/hattrickorganizer/Makefile index a5d58ad2edb1..30281b8d3946 100644 --- a/games/hattrickorganizer/Makefile +++ b/games/hattrickorganizer/Makefile @@ -6,7 +6,7 @@ # PORTNAME= hattrickorganizer -PORTVERSION= 1.32 +PORTVERSION= 1.34 CATEGORIES= games java MASTER_SITES= http://www.wow-auctions.net/ho/download/ DISTNAME= ho_${PORTVERSION:S/.//g} @@ -16,20 +16,16 @@ COMMENT= A management tool for Hattrick.org written in Java EXTRACT_AFTER_ARGS= -d ${WRKSRC} -PKGMESSAGE= ${WRKDIR}/pkg-message -SUB_FILES= pkg-message USE_ZIP= yes NO_BUILD= yes USE_JAVA= yes JAVA_VERSION= 1.4+ -do-install: - @${MKDIR} ${PREFIX}/share/${PORTNAME} - @${CP} -r ${WRKSRC}/* ${PREFIX}/share/${PORTNAME} - @${CP} -r ${FILESDIR}/hattrickorganizer /${PREFIX}/bin/ - @${CHMOD} 755 /${PREFIX}/bin/hattrickorganizer +SUB_FILES= hattrickorganizer.sh -post-install: - @${CAT} ${PKGMESSAGE} +do-install: + cd ${WRKSRC} && ${FIND} . -type d -exec ${MKDIR} ${DATADIR}/{} \; + cd ${WRKSRC} && ${FIND} . -type f -exec ${INSTALL_DATA} {} ${DATADIR}/{} \; + ${INSTALL_SCRIPT} ${WRKDIR}/hattrickorganizer.sh ${PREFIX}/bin/hattrickorganizer .include <bsd.port.mk> diff --git a/games/hattrickorganizer/distinfo b/games/hattrickorganizer/distinfo index ed0b9bfabf10..28a16434dd63 100644 --- a/games/hattrickorganizer/distinfo +++ b/games/hattrickorganizer/distinfo @@ -1,2 +1,2 @@ -MD5 (ho_132.zip) = c7c76e0d418582200b5b0c0ba01a9d4a -SIZE (ho_132.zip) = 3913654 +MD5 (ho_134.zip) = 0cf2b50162907cf9bb38ff547a6eba55 +SIZE (ho_134.zip) = 3862309 diff --git a/games/hattrickorganizer/files/hattrickorganizer b/games/hattrickorganizer/files/hattrickorganizer deleted file mode 100644 index bf2b931b81be..000000000000 --- a/games/hattrickorganizer/files/hattrickorganizer +++ /dev/null @@ -1,193 +0,0 @@ -#!/bin/tcsh - - -### If you like to, you can try to fix the backup/restore -### commands and submit a pr :) - - -# Enter the maximum amount of backups you do want to store. -# Default is 5 -# -#MAX_BACKUPS=5 - -set MAX_BACKUPS=5 - - -########################################################## -# DO NOT EDIT ANY MORE UNTIL YOU KNOW WHAT YOU'RE DOING! # -########################################################## - - -# Enter HO!'s directory. Default is the current directory -# -#HODIR=. - -set HODIR=/usr/local/share/hattrickorganizer - -set HOME=~/.hattrickorganizer - -# Enter the default backup-directory. It will be created -# in $HODIR/$DB/ if it doesn't exist. Default is `backup' -# -#BACKUPDIR=backup - -set BACKUPDIR=~/.hattrickorganizer/backup - -set JAVA=`which java` - -set PLUGINSDIR=~/.hattrickorganizer/hoplugins - -# database-directory: - -set DATABASEDIR=~/.hattrickorganizer/db - -# Store the name of this script. - -set HONAME=$0 - -# Which database to backup? - -set SCRIPT=database.script - -# We need a date for the backup-file - -set DATE=`date "+%Y-%m-%d"` - -# Perform backup by default? - -set BACKUP=true - -# Restore by default? -# IMPORTANT! This is just for initialisation! -# If you set this to true strange things will occure! - -set RESTORE=false - -# Which version of HO! is this? - -set HOVERSION=`cat $HODIR/version.txt` - -# MAIN - -# Run throuh the params - -if ($#argv != 0) then - switch ($argv[1]) - case {-v,--version}: - echo "This is HO\! version $HOVERSION" - exit (0) - #case {-nb,--nobackup}: - # set BACKUP=false - # breaksw - case {-h,--help}: - echo "Usage: $HONAME [option]" - echo "Options:" - echo " -h --help This help text." - echo " -v --version Show HO\! version." - # echo " -nb --nobackup Start without backup" - # echo " -r --restore Restore the last backup-/le." - # echo " -rd --restoredate <date>" - # echo " Restore the backup-/le from <date>" - # echo " -bd --backupdir Use this as the backup directory." - exit (0) - #case {-bd,--backupdir}: - # set BACKUPDIR=$2 - # shift - # breaksw - #case {-r,--restore}: - # set RESTORE=true - # set BACKUP=false - # breaksw - #case {rd,--restoredir}: - # set RESTORE=true - # set RESTOREDATE=$2 - # if (-z $RESTOREDATE) then - # echo "Option rd or restoredate needs a parameter\!" - # exit 1 - # endif - # set BACKUP=false; - # shift - # breaksw - default: - echo "Unknown parameter $1" - echo "Try $HONAME --help to get help." - exit (1) - endsw - shift -endif - -if (! -d $HOME) then - echo "creating ~/.hattrickorganizer" - mkdir ~/.hattrickorganizer -endif - -if (! -d $DATABASEDIR) then - echo "creating $DATABASEDIR" - mkdir -p $DATABASEDIR -endif - -if (! -d $PLUGINSDIR) then - echo "creating $PLUGINSDIR" - mkdir -p $PLUGINSDIR -endif - -#if (! -e $HOME/sprache) then -# ln -s $HODIR/sprache $HOME/sprache -#endif - -#if (! -e $HOME/hoplugins) then -# ln -s $HODIR/hoplugins $HOME/hoplugins -#endif - -# Perform backups or restore only if $DATABASEDIR exists - -#if (-d $DATABASEDIR) then -# `$BACKUP` -# cd $DATABASEDIR -# if (! -d $BACKUPDIR) then -# echo "creating $DATABASEDIR$BACKUPDIR" -# mkdir -p $BACKUPDIR -# endif -# cd $BACKUPDIR -# #while (`ls -r | wc -l` -gt $MAX_BACKUPS) -# # rm -f `ls -r | tail -1` -# #end -# cd .. -# if (-r $SCRIPT) then -# gzip -c $SCRIPT > $BACKUPDIR/$SCRIPT-$DATE.gz -# else -# echo "No database found, so there is nothing to backup." -# endif -# cd .. -# -# `$RESTORE` -# cd $DATABASEDIR -# if (-z $RESTOREDATE) then -# if (`ls $BACKUPDIR/$SCRIPT*.gz | wc -l` -lt 1) then -# echo "No backup-/le found." -# exit 1 -# endif -# gunzip -c `ls $BACKUPDIR/$SCRIPT*.gz | tail -1` > $SCRIPT -# else -# if (-r $BACKUPDIR/$SCRIPT-$RESTOREDATE.gz) then -# gunzip -c "$BACKUPDIR/$SCRIPT-$RESTOREDATE.gz" > $SCRIPT -# echo "restored database from $BACKUPDIR/$SCRIPT-$RESTOREDATE.gz" -# else -# echo "Error reading backup-/le $BACKUPDIR/$SCRIPT-$RESTOREDATE.gz." -# cd .. -# exit 1 -# endif -# endif -# cd .. -# -#else -# echo "No directory $DATABASEDIR found. This is your /rst HO\!-Session, isn't it? Have fun\!" -#endif - -# Start HO! - cd $HOME - $JAVA -jar $HODIR/hocoded.jar - -# Exit this script - -exit 0 diff --git a/games/hattrickorganizer/files/hattrickorganizer.sh.in b/games/hattrickorganizer/files/hattrickorganizer.sh.in new file mode 100644 index 000000000000..9f5ba1a5ac3a --- /dev/null +++ b/games/hattrickorganizer/files/hattrickorganizer.sh.in @@ -0,0 +1,339 @@ +#!/bin/sh +# +# Start script for Hattrick Organizer v0.3 +# Originally created by patta, RAGtime and others +# Last Change (2005-08-07) by Lars Engels (lars@bsd-geek.de) +# +# List of changes: +# +# 0.3 - Introduce the bourne shell as standard shell +# - Make HO! multi-user capable +# - Several layout changes to the script +# - check database before doing backup +# - quit if java version is not returned (NO Sun java?) +# + +######################################################################## +# # +# User editable settings # +# # +# To use HO! with multiple users on one system: # +# - create a new directory, e.g. /usr/local/share/hattrickorganizer # +# or /opt/ho and unpack the HO archive there! # +# # +# - copy HO.sh to a directory in users $PATH, e.g. # +# cp HO.sh /usr/local/bin/ho # +# # +# - edit the HODIR variable to this new directory (without the ``) # +# and HOHOME to any user writable directory! # +# # +# - start HO! out of a terminal via e.g. 'ho' # +# # +# - manage your team :) # +# # +# # +# Alternatively, as single user just start HO! from the HO directory # +# via ./HO.sh without editing something! # +# # +######################################################################## + +# Enter HO!'s directory. Default is the current directory. +# In multi user mode this can be any directory (full path!). +# +#HODIR=`pwd` + +HODIR="%%DATADIR%%" + +# Next comes HO!'s directory to store its user data. +# This directory must be writable by the user, +# default is install directory (single user mode). +# +# SINGLE USER: +# +#HOHOME=$HODIR +# +# MULTI USER: +# +#HOHOME=~/.hattrickorganizer + +HOHOME=~/.hattrickorganizer + +# Where can I find java? +# Default is just looking at $PATH +# (remember option -j) +#JAVA=`which java` + +JAVA="%%LOCALBASE%%/bin/java" + +# Enter the maximum amount of backups you do want to store. +# Default is 5 +# +#MAX_BACKUPS=5 + +MAX_BACKUPS=5 + +######################################################################## +# DO NOT EDIT ANY MORE UNTIL YOU KNOW WHAT YOU'RE DOING! # +######################################################################## + +# How do you call me? +# + +HONAME=$0 + +# Enter the directory where the database is stored +# +#DATABASEDIR=$HOHOME/db + +DATABASEDIR=$HOHOME/db + +# Enter the default backup-directory. It will be created +# in $HOHOME/db if it doesn't exist. Default is 'backup'. +# +#BACKUPDIR=$HOHOME/db/backup + +BACKUPDIR=$HOHOME/db/backup + +# Enter the directory where the HO! plugins reside +# +#PLUGINSDIR=$HOHOME/hoplugins + +PLUGINSDIR=$HOHOME/hoplugins + +# Enter the directory where the language files are +# +#SPRACHDIR=$HOHOME/sprache + +SPRACHDIR=$HOHOME/sprache + + +# Which database files and name of backup file? + +BACKUPLIST="database.data database.script database.backup database.properties" +PREFIX=database + +# We need a date for the backup-file + +DATE=`date "+%Y-%m-%d"` + +# Check for javaversion by default? + +CHECK=true + +# Perform backup by default? + +BACKUP=true + +# Restore by default? +# IMPORTANT! This is just for initialisation! +# If you set this to 'true' strange things will occure! + +RESTORE=false + +# check at least top install directory + +if [ ! -d $HODIR ] +then + echo "INSTALL DIRECTORY NOT FOUND: $HODIR" >&2 + exit 4 +fi + +# Which version of HO! is this? + +HOVERSION=`cat $HODIR/version.txt` + +# Output the help + +help(){ + cat <<-EOF >&2 + Usage: $HONAME [option] + + Options: + -h --help This help text + -v --version Show HO! version + -nb --nobackup Start without backup + -r --restore Restore the last backup-file + -rd --restoredate <date> + Restore the backup-file from <date> + -bd --backupdir Use this as the backup directory + EOF + exit 1 +} + +# Start HO! + +start(){ + echo "Starting HO from $HOHOME..." + cd $HOHOME + JAVA_VERSION="%%JAVA_VERSION%%" "${JAVA}" -jar $HODIR/hocoded.jar + + # check database and print warning + if [ `grep modified $DATABASEDIR/database.properties | \ + cut -d= -f2` = "no" ] + then + echo "Database OK!" + else + cat <<-EOF >&2 + Database was not relased correctly! + Probably next time you will have problems starting HO... + ... but you can restore a backup with switches -r or -rd. :-) + EOF + fi +} + +# Backup + +backup(){ + # Create the backupdir if there's none + if [ ! -d $BACKUPDIR ] + then + echo "Creating $BACKUPDIR" + mkdir -p $BACKUPDIR + fi + cd $BACKUPDIR + # Delete too old backup files + while [ "`ls -r | wc -l`" -gt $MAX_BACKUPS ] + do + rm -f `ls -r | tail -n 1` + done + cd $DATABASEDIR + # THE BIG TRICK: ls gives false (status>0) if one of the files is missing!!! ;-) + if ls $BACKUPLIST &> /dev/null + then + # is database OK? + if [ `grep modified database.properties | cut -d= -f2` = "no" ] + then + # f - is needed in case someone has set his $TAPE variable... + tar -cf - $BACKUPLIST | gzip > $BACKUPDIR/$PREFIX-$DATE.tgz + # ...and this is shorter, but won't work if there's no GNU tar! :-( + # tar -czf $BACKUPDIR/$PREFIX-$DATE.tgz $BACKUPLIST + else + cat <<-EOF >&2 + OLD database was not relased correctly! I will do no backup + BTW,... if you have problems starting HO, try switches -r or -rd + EOF + fi + else + echo "Database files not found, so there is nothing to backup." + fi +} + +# Restore + +restore(){ + cd $DATABASEDIR + if [ -z $RESTOREDATE ] + then + if ls $BACKUPDIR/$PREFIX*.tgz &> /dev/null + then + gunzip -c `ls $BACKUPDIR/$PREFIX*.tgz | tail -n 1` | tar -xf - + else + echo "No backup file(s) found!" >&2 + exit 2 + fi + else + if [ -r "$BACKUPDIR/$PREFIX-$RESTOREDATE.tgz" ] + then + gunzip -c "$BACKUPDIR/$PREFIX-$RESTOREDATE.tgz" | tar -xf - + echo "Restored database from $BACKUPDIR/ \ + $PREFIX-$RESTOREDATE.tgz" + else + echo "Error reading backup file $BACKUPDIR/$PREFIX-$RESTOREDATE.tgz!" >&2 + exit 2 + fi + fi +} + +### MAIN + +# Run throuh the params + +until [ -z "$1" ] +do + case "$1" in + -v|--version) + echo "This is HO! version $HOVERSION"; + exit 0 + ;; + -nb|--nobackup) + BACKUP=false + ;; + -f|--force) + CHECK=false + ;; + -h|--help) + help + ;; + -bd|--backupdir) + BACKUPDIR=$2 + shift + ;; + -r|--restore) + RESTORE=true; + BACKUP=false + ;; + -rd|--restoredate) + RESTORE=true + RESTOREDATE=$2 + if [ -z $RESTOREDATE ] + then + echo "Option rd or restoredate needs a date as parameter!" >&2 + if ls $BACKUPDIR/$PREFIX-*.tgz &> /dev/null + then + echo -e "Available backups: \n`ls -1 $BACKUPDIR/$PREFIX-*.tgz`" >&2 + else + echo "Sorry, there's no Backup available!!!" >&2 + fi + exit 1 + fi + BACKUP=false; + shift + ;; + *) + echo -e "Unknown parameter $1\n + Try $HONAME --help to get help." >&2 + exit 1 + ;; + esac + shift +done + + +# Check if all needed directories exist + +if [ ! -d $HOHOME ] +then + echo "creating $HOHOME" + mkdir $HOHOME +fi + +if [ ! -d $PLUGINSDIR ] +then + echo "creating $PLUGINSDIR" + cp -r $HODIR/hoplugins $HOHOME +fi + +if [ ! -d $SPRACHDIR ] +then + echo "creating $SPRACHDIR" + cp -r $HODIR/sprache $HOHOME +fi + +# Perform backups or restore only if $DATABASEDIR exists + +if [ -d $DATABASEDIR ] +then + `$BACKUP` && backup + `$RESTORE` && restore +else + echo -e "No directory $DATABASEDIR found. \n + This is your first HO!-Session, isn't it? Have fun!" +fi + +# Start HO! + +start + +# Exit this script + +exit 0 diff --git a/games/hattrickorganizer/files/pkg-message.in b/games/hattrickorganizer/files/pkg-message.in deleted file mode 100644 index 4e5db6aa5542..000000000000 --- a/games/hattrickorganizer/files/pkg-message.in +++ /dev/null @@ -1,29 +0,0 @@ -************************************************************ - -Check if %%PREFIX%%/bin/java exists. If not, create a link: - - ln -s %%PREFIX%%/bin/javavm %%PREFIX%%/bin/java - -or change the start script %%PREFIX%%/bin/hattrickorganizer - - - - !!! BEWARE OF THE SECURITY RISKS BEFORE DOING THIS !!! - -In order to change the language of Hattrick Organizer - -uncomment the following in %%PREFIX%%/bin/hattrickorganizer: - -#if (! -e $HOME/sprache) then -# ln -s $HODIR/sprache $HOME/sprache -#endif - -If you want to use plugins and the plugin update tool - -uncomment: - -#if (! -e $HOME/hoplugins) then -# ln -s $HODIR/hoplugins $HOME/hoplugins -#endif - -************************************************************ diff --git a/games/hattrickorganizer/pkg-plist b/games/hattrickorganizer/pkg-plist index d648d3965237..499da7642754 100644 --- a/games/hattrickorganizer/pkg-plist +++ b/games/hattrickorganizer/pkg-plist @@ -7,8 +7,17 @@ bin/hattrickorganizer %%DATADIR%%/flags/101flag.png %%DATADIR%%/flags/102flag.png %%DATADIR%%/flags/103flag.png +%%DATADIR%%/flags/104flag.png +%%DATADIR%%/flags/105flag.png %%DATADIR%%/flags/10flag.png %%DATADIR%%/flags/11flag.png +%%DATADIR%%/flags/121flag.png +%%DATADIR%%/flags/122flag.png +%%DATADIR%%/flags/123flag.png +%%DATADIR%%/flags/125flag.png +%%DATADIR%%/flags/126flag.png +%%DATADIR%%/flags/127flag.png +%%DATADIR%%/flags/128flag.png %%DATADIR%%/flags/12flag.png %%DATADIR%%/flags/13flag.png %%DATADIR%%/flags/14flag.png @@ -85,6 +94,7 @@ bin/hattrickorganizer %%DATADIR%%/flags/80flag.png %%DATADIR%%/flags/82flag.png %%DATADIR%%/flags/83flag.png +%%DATADIR%%/flags/86flag.png %%DATADIR%%/flags/87flag.png %%DATADIR%%/flags/88flag.png %%DATADIR%%/flags/89flag.png @@ -204,10 +214,12 @@ bin/hattrickorganizer %%DATADIR%%/hoplugins/pluginUpdater/rsc/languages.xml %%DATADIR%%/hoplugins/pluginUpdater/rsc/newsletter.xml %%DATADIR%%/hoplugins/pluginUpdater/rsc/tmp.xml +%%DATADIR%%/hoplugins/pluginUpdater/sprache/Czech.properties %%DATADIR%%/hoplugins/pluginUpdater/sprache/Deutsch.properties %%DATADIR%%/hoplugins/pluginUpdater/sprache/English.properties %%DATADIR%%/hoplugins/pluginUpdater/sprache/Nederlands.properties %%DATADIR%%/hoplugins/pluginUpdater/sprache/Polish.properties +%%DATADIR%%/hoplugins/pluginUpdater/sprache/Portugues.properties %%DATADIR%%/hoplugins/pluginUpdater/sprache/Spanish.properties %%DATADIR%%/hoplugins/pluginUpdater/sprache/svenska.properties %%DATADIR%%/hoplugins/teamAnalyzer/SystemManager.class @@ -318,15 +330,14 @@ bin/hattrickorganizer %%DATADIR%%/hoplugins/teamAnalyzer/vo/TeamLineup.class %%DATADIR%%/hoplugins/teamAnalyzer/vo/UserTeamSpotLineup.class %%DATADIR%%/hoplugins/trainingExperience/FutureTrainingManager.class -%%DATADIR%%/hoplugins/trainingExperience/OldTrainingManager$1.class %%DATADIR%%/hoplugins/trainingExperience/OldTrainingManager$SkillupComperator.class %%DATADIR%%/hoplugins/trainingExperience/OldTrainingManager.class %%DATADIR%%/hoplugins/trainingExperience/constants/Skills.class %%DATADIR%%/hoplugins/trainingExperience/constants/Trainings.class %%DATADIR%%/hoplugins/trainingExperience/dao/DividerDAO.class +%%DATADIR%%/hoplugins/trainingExperience/dao/EffectDAO$1.class %%DATADIR%%/hoplugins/trainingExperience/dao/EffectDAO.class %%DATADIR%%/hoplugins/trainingExperience/dao/TrainingDAO.class -%%DATADIR%%/hoplugins/trainingExperience/plugin.xml %%DATADIR%%/hoplugins/trainingExperience/ui/AnalyzerPanel$1.class %%DATADIR%%/hoplugins/trainingExperience/ui/AnalyzerPanel.class %%DATADIR%%/hoplugins/trainingExperience/ui/ChangeTableRenderer.class @@ -444,12 +455,17 @@ bin/hattrickorganizer %%DATADIR%%/sprache/Portugues.properties %%DATADIR%%/sprache/PortuguesBrasil.properties %%DATADIR%%/sprache/Romanian.properties +%%DATADIR%%/sprache/Russian.properties +%%DATADIR%%/sprache/Slovak.properties %%DATADIR%%/sprache/Spanish.properties +%%DATADIR%%/sprache/Ukranian.properties %%DATADIR%%/sprache/french.properties %%DATADIR%%/sprache/languages.properties %%DATADIR%%/sprache/norsk.properties %%DATADIR%%/sprache/svenska.properties %%DATADIR%%/version.txt +@dirrm share/nls/en_US.US-ASCII +@dirrm share/nls/POSIX @dirrm %%DATADIR%%/sprache @dirrm %%DATADIR%%/hoplugins/transfers/vo @dirrm %%DATADIR%%/hoplugins/transfers/utils |