diff options
author | lioux <lioux@FreeBSD.org> | 2007-04-24 09:07:00 +0800 |
---|---|---|
committer | lioux <lioux@FreeBSD.org> | 2007-04-24 09:07:00 +0800 |
commit | 4ea826e2799f7814b64f5289e0509e4b9ab82759 (patch) | |
tree | 9bbaef447c857db43b95a764aaaa944dba4f1f29 | |
parent | 779cd333f0afe74f56d192a1ae1f735ae929d973 (diff) | |
download | freebsd-ports-gnome-4ea826e2799f7814b64f5289e0509e4b9ab82759.tar.gz freebsd-ports-gnome-4ea826e2799f7814b64f5289e0509e4b9ab82759.tar.zst freebsd-ports-gnome-4ea826e2799f7814b64f5289e0509e4b9ab82759.zip |
New port gfp version 0.7.2: Personal finances administration software
-rw-r--r-- | finance/Makefile | 1 | ||||
-rw-r--r-- | finance/gfp/Makefile | 68 | ||||
-rw-r--r-- | finance/gfp/distinfo | 3 | ||||
-rw-r--r-- | finance/gfp/files/Launcher.java | 311 | ||||
-rw-r--r-- | finance/gfp/files/wrapper.sh | 55 | ||||
-rw-r--r-- | finance/gfp/pkg-descr | 10 |
6 files changed, 448 insertions, 0 deletions
diff --git a/finance/Makefile b/finance/Makefile index 6b1da17a04ff..6abf31add3b5 100644 --- a/finance/Makefile +++ b/finance/Makefile @@ -7,6 +7,7 @@ SUBDIR += aqmoney SUBDIR += cbb SUBDIR += expense + SUBDIR += gfp SUBDIR += gnofin SUBDIR += gnucash SUBDIR += gnucash-docs diff --git a/finance/gfp/Makefile b/finance/gfp/Makefile new file mode 100644 index 000000000000..67c8f449547c --- /dev/null +++ b/finance/gfp/Makefile @@ -0,0 +1,68 @@ +# New ports collection makefile for: gfp +# Date created: Ter 6 Mar 2007 03:51:58 UTC +# Whom: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= gfp +PORTVERSION= 0.7.2 +CATEGORIES= finance java +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED} +MASTER_SITE_SUBDIR= gfd +DISTNAME= ${PORTNAME}_${PORTVERSION} + +MAINTAINER= lioux@FreeBSD.org +COMMENT= Personal finances administration software + +USE_ZIP= yes +USE_JAVA= yes +JAVA_VERSION= 1.4+ +JAVA_OS= native +WRKSRC= ${WRKDIR}/GFP + +JAVAVM= ${LOCALBASE}/bin/java +JAR_FILE= gfd.jar + +PLIST_FILES+= \ + bin/${PORTNAME} + +post-extract: +# backup launcher + @${CP} -f ${WRKSRC}/${JAR_FILE} ${WRKDIR} +# prepare custom made extraction + @${MKDIR} ${WRKDIR}/extract.jar + @cd ${WRKDIR}/extract.jar && ${JAR} xf ${WRKSRC}/${JAR_FILE} + @${CP} -f ${FILESDIR}/Launcher.java ${WRKDIR}/extract.jar + +post-patch: + @${SED} -e "s|%%JAR_DIR%%|${JAR_DIR}|; \ + s|%%DATADIR%%|${DATADIR}|; \ + s|%%JAR_FILE%%|${JAR_FILE}|; \ + s|%%JAVA_OS%%|${JAVA_OS}|; \ + s|%%JAVA_VERSION%%|${JAVA_VERSION}|; \ + s|%%JAVAVM%%|${JAVAVM}|; \ + s|%%LN%%|${LN}|; \ + s|%%MKDIR%%|${MKDIR}|; \ + s|%%RM%%|${RM}|" \ + ${FILESDIR}/wrapper.sh > ${WRKDIR}/wrapper.sh + +do-build: +# prepare custom made extraction jar + @${RM} -f ${WRKDIR}/extract.jar/Launcher.class + @cd ${WRKDIR}/extract.jar && ${JAVAC} Launcher.java && \ + ${JAR} -uf ${WRKSRC}/${JAR_FILE} Launcher.class && \ + cd ${WRKSRC} && ${JAVA} -jar ${WRKSRC}/${JAR_FILE} && \ + ${CP} -f ${WRKDIR}/${JAR_FILE} ${WRKSRC} + +do-install: + @${MKDIR} ${DATADIR} + @(cd ${WRKSRC}; ${FIND} * -type d -exec ${MKDIR} ${DATADIR}/{} \;) + @(cd ${WRKSRC}; ${FIND} * -type f -exec ${INSTALL_DATA} {} ${DATADIR}/{} \;) + @(cd ${WRKSRC}; ${FIND} -s * -not -type d) \ + | ${SED} -ne 's,^,${DATADIR:S,^${PREFIX}/,,}/,p' >> ${TMPPLIST} + @(cd ${WRKSRC}; ${FIND} -s -d * -type d) \ + | ${SED} -ne 's,^,@dirrm ${DATADIR:S,^${PREFIX}/,,}/,p' >> ${TMPPLIST} + @${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh ${PREFIX}/bin/${PORTNAME} + +.include <bsd.port.mk> diff --git a/finance/gfp/distinfo b/finance/gfp/distinfo new file mode 100644 index 000000000000..bea4ba0371b8 --- /dev/null +++ b/finance/gfp/distinfo @@ -0,0 +1,3 @@ +MD5 (gfp_0.7.2.zip) = 3a122d7eee0492f7db25a5acd60fdd2e +SHA256 (gfp_0.7.2.zip) = 1b570493ff87d4a792816c244370debbfe775c26471b2a49203fbfbb901398e4 +SIZE (gfp_0.7.2.zip) = 2335756 diff --git a/finance/gfp/files/Launcher.java b/finance/gfp/files/Launcher.java new file mode 100644 index 000000000000..6918cc56cb2a --- /dev/null +++ b/finance/gfp/files/Launcher.java @@ -0,0 +1,311 @@ +import SevenZip.LzmaAlone; +import com.sun.java.util.jar.pack.PackerImpl; +import com.sun.java.util.jar.pack.UnpackerImpl; +import java.io.*; +import java.lang.reflect.Method; +import java.util.Enumeration; +import java.util.Map; +import java.util.jar.JarInputStream; +import java.util.jar.JarOutputStream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +/* + * Created on 07/04/2003 + * + * Swing Components - visit http://sf.net/projects/gfd + * + * Copyright (C) 2004 Igor Regis da Silva Sim\xf5es + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +public final class Launcher +{ + + public Launcher(boolean flag, String s) + throws IOException + { + unpacker = new UnpackerImpl(); + packer = new PackerImpl(); + System.out.println((new StringBuilder()).append("pack= ").append(flag).append(" file= ").append(s).toString()); + BufferedReader bufferedreader = null; + try + { + bufferedreader = new BufferedReader(new FileReader(new File((new StringBuilder()).append(System.getProperty("user.dir")).append(File.separator).append("setup.dat").toString()))); + } + catch(FileNotFoundException filenotfoundexception) + { + if(s == null) + return; + } + if(flag) + { + if(s == null) + { + for(String s1 = ""; (s1 = bufferedreader.readLine()) != null;) + try + { + String as1[] = s1.split("@"); + compactarArquivo(as1[0], as1[1]); + } + catch(IOException ioexception1) + { + System.out.println("*************************************************"); + System.out.println((new StringBuilder()).append("Falha ao compactar: ").append(s1.substring(2)).toString()); + System.out.println(ioexception1.getMessage()); + System.out.println("*************************************************"); + } + + } else + { + s = s.replace('\\', File.separatorChar).replace('/', File.separatorChar); + System.out.println((new StringBuilder()).append("Vou compactar o arquivo: ").append(s).toString()); + try + { + String as[] = new String[2]; + if(s.indexOf(File.separator) != -1) + { + as[0] = s.substring(s.lastIndexOf(File.separator) - 1, s.length()); + as[1] = s.substring(0, s.lastIndexOf(File.separator) + 1); + } else + { + as[0] = s; + as[1] = ""; + } + if(!as[1].startsWith(File.separator)) + as[1] = (new StringBuilder()).append(File.separator).append(as[1]).toString(); + compactarArquivo(as[0], as[1]); + } + catch(IOException ioexception) + { + System.out.println("*************************************************"); + System.out.println((new StringBuilder()).append("Falha ao compactar: ").append(s).toString()); + System.out.println(ioexception.getMessage()); + System.out.println("*************************************************"); + } + } + } else + { + String s2 = ""; + do + { + String s3; + if((s3 = bufferedreader.readLine()) == null) + break; + try + { + String as2[] = s3.split("@"); + descompactarArquivo(as2[0], as2[1]); + if(as2[0].startsWith("z_")) + explodir(as2[0], as2[1]); + } + catch(IOException ioexception2) + { + System.out.println("*************************************************"); + System.out.println((new StringBuilder()).append("Fail on install file: ").append(s3.substring(2)).toString()); + System.out.println(ioexception2.getMessage()); + System.out.println("*************************************************"); + } + } while(true); + bufferedreader.close(); + (new File((new StringBuilder()).append(System.getProperty("user.dir")).append(File.separator).append("setup.dat").toString())).delete(); + } + if(bufferedreader != null) + bufferedreader.close(); + } + + private void descompactarArquivo(String s, String s1) + throws IOException + { + String s2 = (new StringBuilder()).append(System.getProperty("user.dir")).append(s1).toString(); + try + { + LzmaAlone.main(new String[] { + "d", (new StringBuilder()).append(s2).append(s).toString(), (new StringBuilder()).append(s2).append(s.substring(1)).toString() + }); + } + catch(Exception exception) + { + exception.printStackTrace(); + } + JarOutputStream jaroutputstream = new JarOutputStream(new FileOutputStream(new File((new StringBuilder()).append(s2).append(s.substring(2)).toString()))); + FileInputStream fileinputstream = new FileInputStream((new StringBuilder()).append(s2).append(s.substring(1)).toString()); + unpacker.unpack(fileinputstream, jaroutputstream); + jaroutputstream.flush(); + fileinputstream.close(); + jaroutputstream.close(); + for(File file = new File((new StringBuilder()).append(s2).append(s.substring(1)).toString()); !file.delete() && file.exists(); System.out.println((new StringBuilder()).append("Tentando deletar ").append(s2).append("_").append(s).toString())); + for(File file1 = new File((new StringBuilder()).append(s2).append(s).toString()); !file1.delete() && file1.exists(); System.out.println((new StringBuilder()).append("Tentando deletar ").append(s2).append(s).toString())); + } + + private void compactarArquivo(String s, String s1) + throws IOException + { + String s2 = s1; + if(!(new File(s2)).exists() || s2.equals(File.separator)) + s2 = (new StringBuilder()).append(System.getProperty("user.dir")).append(s1).toString(); + String s3 = s.substring(0, 1).toLowerCase(); + s = s.substring(2); + System.out.println((new StringBuilder()).append("Caminho completo ").append((new StringBuilder()).append(s2).append(s).toString().replace('\\', File.separatorChar).replace('/', File.separatorChar)).toString()); + java.util.SortedMap sortedmap = packer.properties(); + sortedmap.put("pack.deflate.hint", "false"); + sortedmap.put("pack.effort", "9"); + sortedmap.put("pack.keep.file.order", "false"); + sortedmap.put("pack.modification.time", "latest"); + sortedmap.put("pack.segment.limit", "1500000"); + sortedmap.put("pack.unknown.attribute", "strip"); + if(s.toLowerCase().indexOf("gf") != -1 || s.toLowerCase().indexOf("visa") != -1) + { + System.out.println("Pack COM debug info"); + sortedmap.put("pack.code.attribute.LineNumberTable", "pass"); + sortedmap.put("pack.code.attribute.LocalVariableTable", "pass"); + sortedmap.put("pack.class.attribute.SourceFile", "pass"); + } else + { + System.out.println("Pack SEM debug info"); + sortedmap.put("pack.code.attribute.LineNumberTable", "strip"); + sortedmap.put("pack.code.attribute.LocalVariableTable", "strip"); + sortedmap.put("pack.class.attribute.SourceFile", "strip"); + } + System.out.println((new StringBuilder()).append(s2).append(s).toString().replace('\\', File.separatorChar).replace('/', File.separatorChar)); + System.out.println((new StringBuilder()).append(s2).append("_").append(s).toString().replace('\\', File.separatorChar).replace('/', File.separatorChar)); + JarInputStream jarinputstream = new JarInputStream(new FileInputStream((new StringBuilder()).append(s2).append(s).toString().replace('\\', File.separatorChar).replace('/', File.separatorChar))); + FileOutputStream fileoutputstream = new FileOutputStream((new StringBuilder()).append(s2).append("_").append(s).toString().replace('\\', File.separatorChar).replace('/', File.separatorChar)); + packer.pack(jarinputstream, fileoutputstream); + jarinputstream.close(); + fileoutputstream.flush(); + fileoutputstream.close(); + try + { + LzmaAlone.main(new String[] { + "e", "-a9", (new StringBuilder()).append(s2).append("_").append(s).toString().replace('\\', File.separatorChar).replace('/', File.separatorChar), (new StringBuilder()).append(s2).append(s3.startsWith("z") ? "z_" : "__").append(s).toString().replace('\\', File.separatorChar).replace('/', File.separatorChar) + }); + } + catch(Exception exception) + { + exception.printStackTrace(); + System.exit(-1); + } + for(File file = new File((new StringBuilder()).append(s2).append("_").append(s).toString().replace("\\", File.separator).replace("/", File.separator)); !file.delete() && file.exists();) + { + System.out.println((new StringBuilder()).append("Tentando deletar ").append(file.getAbsolutePath()).toString()); + try + { + Thread.sleep(1000L); + } + catch(InterruptedException interruptedexception) + { + interruptedexception.printStackTrace(); + } + } + + for(File file1 = new File((new StringBuilder()).append(s2).append(s).toString().replace("\\", File.separator).replace("/", File.separator)); !file1.delete() && file1.exists();) + { + System.out.println((new StringBuilder()).append("Tentando deletar ").append(file1.getAbsolutePath()).toString()); + try + { + Thread.sleep(1000L); + } + catch(InterruptedException interruptedexception1) + { + interruptedexception1.printStackTrace(); + } + } + + } + + private void explodir(String s, String s1) + throws IOException + { + File file = new File((new StringBuilder()).append(System.getProperty("user.dir")).append(s1).append(s.substring(2)).toString()); + Object obj = null; + ZipFile zipfile = new ZipFile(file); + for(Enumeration enumeration = zipfile.entries(); enumeration.hasMoreElements();) + { + ZipEntry zipentry = (ZipEntry)enumeration.nextElement(); + if(zipentry.getSize() == 0L) + { + (new File((new StringBuilder()).append(System.getProperty("user.dir")).append(s1).append(File.separator).append(zipentry.getName().replace('/', '\\')).toString())).mkdirs(); + } else + { + DataInputStream datainputstream = new DataInputStream(zipfile.getInputStream(zipentry)); + byte abyte0[] = new byte[datainputstream.available()]; + datainputstream.readFully(abyte0); + datainputstream.close(); + File file1 = new File((new StringBuilder()).append(System.getProperty("user.dir")).append(s1).append(File.separator).append(zipentry.getName().replace('/', '\\')).toString()); + if(!file1.getParentFile().exists()) + file1.getParentFile().mkdirs(); + file1.createNewFile(); + FileOutputStream fileoutputstream = new FileOutputStream(file1); + fileoutputstream.write(abyte0); + fileoutputstream.flush(); + fileoutputstream.close(); + } + } + + zipfile.close(); + file.delete(); + } + + public static void main(String args[]) + { + File file = new File((new StringBuilder()).append(System.getProperty("user.dir")).append(File.separator).append("running.lck").toString()); + if(file.exists()) + return; + try + { + file.createNewFile(); + } + catch(IOException ioexception) + { + ioexception.printStackTrace(); + } + file.deleteOnExit(); + if(args == null || args.length == 0) + { + Launcher launcher = null; + try + { + launcher = new Launcher(false, null); + } + catch(IOException ioexception3) + { + ioexception3.printStackTrace(); + } + } else + if(!(new File(args[0])).exists() && !args[0].startsWith("__")) + try + { + new Launcher(true, null); + } + catch(IOException ioexception1) + { + ioexception1.printStackTrace(); + } + else + try + { + new Launcher(true, args[0]); + } + catch(IOException ioexception2) + { + ioexception2.printStackTrace(); + } + } + + private UnpackerImpl unpacker; + private PackerImpl packer; +} diff --git a/finance/gfp/files/wrapper.sh b/finance/gfp/files/wrapper.sh new file mode 100644 index 000000000000..b4f84d6de547 --- /dev/null +++ b/finance/gfp/files/wrapper.sh @@ -0,0 +1,55 @@ +#!/bin/sh + +export JAVA_OS +export JAVA_VERSION + +JAVA_OS="%%JAVA_OS%%" +JAVA_VERSION="%%JAVA_VERSION%%" + +APP_DIR=${HOME}/.gfp +DATA_DIR="%%DATADIR%%" +# +APP_FILES_LINK=" + db/ddl.sql + db/hsqldb.jar + gfd.jar + setup.dat + temp/license.txt +" +APP_DIR_LINK=" + ext + helpFiles + lookAndFeel + plugins + resources +" +APP_SUBDIR_MKDIR="db temp" +# +JAVA_CMD="%%JAVAVM%%" +LN_CMD="%%LN%%" +MKDIR_CMD="%%MKDIR%%" +RM_CMD="%%RM%%" +# +JAR_FILE="%%JAR_FILE%%" + +# create application home dir +${MKDIR_CMD} -p ${APP_DIR} + +# create subdirs +for dir in ${APP_SUBDIR_MKDIR} +do + ${MKDIR_CMD} -p ${APP_DIR}/${dir} +done + +# create links +for link in ${APP_FILES_LINK} +do + ${LN_CMD} -sf "${DATA_DIR}/${link}" "${APP_DIR}/${link}" +done +for link in ${APP_DIR_LINK} +do + ${RM_CMD} -f "${APP_DIR}/${link}" + ${LN_CMD} -sf "${DATA_DIR}/${link}" "${APP_DIR}/${link}" +done + +( cd ${APP_DIR} && exec ${JAVA_CMD} -jar ${JAR_FILE} ) diff --git a/finance/gfp/pkg-descr b/finance/gfp/pkg-descr new file mode 100644 index 000000000000..f745a8345163 --- /dev/null +++ b/finance/gfp/pkg-descr @@ -0,0 +1,10 @@ +[ excerpt from developer's web site ] + +GFP Personal Finance Manager is a software that aids on personal +finances administration offering a variety of reports, charts and +filtering data on screen making it possible to obtain important +information for your financial health. + +WWW: http://gfd.sourceforge.net/index.php + +-- lioux@FreeBSD.org |