diff options
author | miwi <miwi@FreeBSD.org> | 2008-07-20 01:12:46 +0800 |
---|---|---|
committer | miwi <miwi@FreeBSD.org> | 2008-07-20 01:12:46 +0800 |
commit | eaaf17374df6bb2260a640e6573a24b2f6f874cd (patch) | |
tree | edb08587e4bbb3fd3e400ea9748dda875e61ce28 /www | |
parent | 39ade7f9f8df18801a5a8756ddd3a28dbe4e78b3 (diff) | |
download | freebsd-ports-gnome-eaaf17374df6bb2260a640e6573a24b2f6f874cd.tar.gz freebsd-ports-gnome-eaaf17374df6bb2260a640e6573a24b2f6f874cd.tar.zst freebsd-ports-gnome-eaaf17374df6bb2260a640e6573a24b2f6f874cd.zip |
Commonist is a free Java program for easy uploads of large numbers of
images to Wikimedia Commons and other Mediawiki installations.
WWW: http://commons.wikimedia.org/wiki/Commons:Tools/Commonist
PR: ports/124771
Submitted by: Marcin Cieslak <saper at SYSTEM.PL>
Diffstat (limited to 'www')
-rw-r--r-- | www/Makefile | 1 | ||||
-rw-r--r-- | www/commonist/Makefile | 66 | ||||
-rw-r--r-- | www/commonist/distinfo | 3 | ||||
-rw-r--r-- | www/commonist/files/commonist.in | 1 | ||||
-rw-r--r-- | www/commonist/files/patch-Loader.java | 20 | ||||
-rw-r--r-- | www/commonist/files/patch-Main.java | 38 | ||||
-rw-r--r-- | www/commonist/files/patch-build.xml | 15 | ||||
-rw-r--r-- | www/commonist/pkg-descr | 4 | ||||
-rw-r--r-- | www/commonist/pkg-plist | 17 |
9 files changed, 165 insertions, 0 deletions
diff --git a/www/Makefile b/www/Makefile index b55cb076d5e2..de104c028432 100644 --- a/www/Makefile +++ b/www/Makefile @@ -96,6 +96,7 @@ SUBDIR += cocoon SUBDIR += codeigniter SUBDIR += comclear + SUBDIR += commonist SUBDIR += conkeror SUBDIR += coppermine SUBDIR += crawl diff --git a/www/commonist/Makefile b/www/commonist/Makefile new file mode 100644 index 000000000000..abe04b384aa9 --- /dev/null +++ b/www/commonist/Makefile @@ -0,0 +1,66 @@ +# New ports collection makefile for: commonist +# Date created: 2008-06-17 +# Whom: Marcin Cieslak <saper@SYSTEM.PL> +# +# $FreeBSD$ +# + +PORTNAME= commonist +PORTVERSION= 0.3.28 +CATEGORIES= www java +MASTER_SITES= http://djini.de/software/commonist/ + +MAINTAINER= saper@SYSTEM.PL +COMMENT= Easy upload of images to Wikimedia Commons and Mediawiki + +TARGET_JAR= ${JAVAJARDIR}/${PORTNAME}.jar +USE_ZIP= yes +USE_JAVA= 1.5+ +USE_ANT= yes +ALL_TARGET= jar +MAKE_ARGS+= -Djar.lib.dir=${WRKSRC}/build/jar -Dtarget.name=${WRKSRC}/build/jar/${PORTNAME}.jar + +SUB_FILES+= commonist +SUB_LIST+= TARGET_JAR=${TARGET_JAR} + +BUILD_DEPENDS+= ${JAVAJARDIR}/commons-httpclient.jar:${PORTSDIR}/java/jakarta-commons-httpclient \ + ${JAVAJARDIR}/bsh.jar:${PORTSDIR}/lang/bsh + +RUN_DEPENDS+= ${JAVAJARDIR}/commons-httpclient.jar:${PORTSDIR}/java/jakarta-commons-httpclient \ + ${JAVAJARDIR}/bsh.jar:${PORTSDIR}/lang/bsh + +.include <bsd.port.pre.mk> + +post-extract: + (cd ${WRKSRC} && ${JAR} xf lib/lib-util-src.jar src) + (cd ${WRKSRC} && ${JAR} xf lib/mwapi-src.jar src) + (cd ${WRKSRC} && ${JAR} xf lib/minibpp-src.jar source) + (cd ${WRKSRC}/source && ${FIND} * -print | ${CPIO} -pdmu ${WRKSRC}/src) + +post-patch: + ${REINPLACE_CMD} -e "s#%%ETCDIR%%#${ETCDIR}#" ${WRKSRC}/src/net/psammead/commonist/Main.java + +pre-build: + (cd ${WRKSRC} && ${ANT} clean) + ${MKDIR} ${WRKSRC}/build/classes + ${JAR} tf ${WRKSRC}/lib/mwapi.jar net/psammead/mwapi/config | ${EGREP} '(site|family|list)' > ${WRKSRC}/configfiles + (cd ${WRKSRC}/build/classes && ${JAR} xf ${WRKSRC}/lib/mwapi.jar `${CAT} ${WRKSRC}/configfiles`) + +do-install: + ${MKDIR} ${JAVAJARDIR} + ${INSTALL_SCRIPT} ${WRKDIR}/commonist ${PREFIX}/bin + ${INSTALL_DATA} ${WRKSRC}/build/jar/${PORTNAME}.jar ${TARGET_JAR} +.if !defined(NOPORTEXAMPLES) + ${MKDIR} ${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/etc/startup.bsh ${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/build/classes/net/psammead/mwapi/config/commons.family ${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/build/classes/net/psammead/mwapi/config/commons.site ${EXAMPLESDIR} +.endif + ${MKDIR} ${ETCDIR} +.for f in gallery_commons.bpp image_default.bpp messages_fr.properties \ + image_commons.bpp gallery_default.bpp licenses.txt messages_en.properties \ + messages_sk.properties messages_de.properties + ${INSTALL_DATA} ${WRKSRC}/etc/${f} ${ETCDIR} +.endfor + +.include <bsd.port.post.mk> diff --git a/www/commonist/distinfo b/www/commonist/distinfo new file mode 100644 index 000000000000..023b06cf7c2e --- /dev/null +++ b/www/commonist/distinfo @@ -0,0 +1,3 @@ +MD5 (commonist-0.3.28.zip) = a1a400b09825a16091457be880f8812a +SHA256 (commonist-0.3.28.zip) = a6352b3939ae2561bf89314a79732443f7421c6a6d34e994c0b406cdee2d30b6 +SIZE (commonist-0.3.28.zip) = 2265234 diff --git a/www/commonist/files/commonist.in b/www/commonist/files/commonist.in new file mode 100644 index 000000000000..08aba6286098 --- /dev/null +++ b/www/commonist/files/commonist.in @@ -0,0 +1 @@ +java -jar %%TARGET_JAR%% diff --git a/www/commonist/files/patch-Loader.java b/www/commonist/files/patch-Loader.java new file mode 100644 index 000000000000..7388a017d810 --- /dev/null +++ b/www/commonist/files/patch-Loader.java @@ -0,0 +1,20 @@ +--- src/net/psammead/commonist/util/Loader.java.orig 2008-06-19 23:45:43.667197457 +0200 ++++ src/net/psammead/commonist/util/Loader.java 2008-06-19 23:46:41.729154606 +0200 +@@ -32,7 +32,7 @@ + File settingsFile = new File(settingsDir, path); + if (settingsFile.exists()) { + log.debug("loading from settings: " + path); +- return settingsFile.toURL(); ++ return settingsFile.toURI().toURL(); + } + } + catch (MalformedURLException e) { +@@ -43,7 +43,7 @@ + File projectFile = new File(projectDir, path); + if (projectFile.exists()) { + log.debug("loading from project: " + path); +- return projectFile.toURL(); ++ return projectFile.toURI().toURL(); + } + } + catch (MalformedURLException e) { diff --git a/www/commonist/files/patch-Main.java b/www/commonist/files/patch-Main.java new file mode 100644 index 000000000000..eff175ca3f22 --- /dev/null +++ b/www/commonist/files/patch-Main.java @@ -0,0 +1,38 @@ +--- src/net/psammead/commonist/Main.java.orig 2007-11-28 16:35:58.000000000 +0100 ++++ src/net/psammead/commonist/Main.java 2008-06-20 00:35:52.532632590 +0200 +@@ -58,14 +58,14 @@ + private ChangeDirectoryTask changeDirectoryTask; + private UploadFilesTask uploadFilesTask; + +- public Main(Image programIcon, String programHeading) { ++ public Main(Image programIcon, String programHeading) throws ConfigException { + settingsDir = new File(new File(System.getProperty("user.home")), ".commonist"); + settingsDir.mkdirs(); + + // HACK: running from webstart or load from the Filesystem + // boolean fromWebStart = !(new File("etc/licenses.txt").exists()); + +- File projectDir = new File(new File(System.getProperty("user.dir")), "etc"); ++ File projectDir = new File("%%ETCDIR%%"); + + loader = new Loader(settingsDir, projectDir, "/etc/"); + +@@ -77,8 +77,7 @@ + try { licenses = initLicenses(); } + catch (IOException e) { throw new Error("cannot load licenses.txt"); } + +- try { mw = new MediaWiki(); } +- catch (ConfigException e) { throw new Error("cannot instantiate MediaWiki"); } ++ mw = new MediaWiki(); + mw.setLog(System.err); + mw.setupProxy(); + +@@ -226,7 +225,7 @@ + if (!file.getName().endsWith(".family")) continue; + log.info("loading family: " + file); + try { +- mw.loadFamily(file.toURL()); ++ mw.loadFamily(file.toURI().toURL()); + } + catch (ConfigException e) { + log.error("could not load family from: " + file, e); diff --git a/www/commonist/files/patch-build.xml b/www/commonist/files/patch-build.xml new file mode 100644 index 000000000000..daa2ea89ed4f --- /dev/null +++ b/www/commonist/files/patch-build.xml @@ -0,0 +1,15 @@ +--- build.xml.orig 2008-01-17 21:47:36.000000000 +0100 ++++ build.xml 2008-06-20 01:11:45.983423901 +0200 +@@ -52,10 +52,9 @@ + <attribute name="Creator" value="${author}"/> + <attribute name="License" value="${license}"/> + +- <!-- +- TODO: use a property, add binary.jars to classpath (manifestclasspath from ant 1.7.0) + <attribute name="Main-Class" value="net.psammead.commonist.Main"/> +- --> ++ <attribute name="Class-Path" value="commons-httpclient.jar commons-codec.jar commons-logging.jar bsh.jar"/> ++ + </manifest> + </jar> + </target> diff --git a/www/commonist/pkg-descr b/www/commonist/pkg-descr new file mode 100644 index 000000000000..236daa79dd66 --- /dev/null +++ b/www/commonist/pkg-descr @@ -0,0 +1,4 @@ +Commonist is a free Java program for easy uploads of large numbers of +images to Wikimedia Commons and other Mediawiki installations. + +WWW: http://commons.wikimedia.org/wiki/Commons:Tools/Commonist diff --git a/www/commonist/pkg-plist b/www/commonist/pkg-plist new file mode 100644 index 000000000000..7b0f262e4ce1 --- /dev/null +++ b/www/commonist/pkg-plist @@ -0,0 +1,17 @@ +@comment $FreeBSD$ +bin/commonist +%%JAVAJARDIR%%/commonist.jar +%%ETCDIR%%/gallery_commons.bpp +%%ETCDIR%%/gallery_default.bpp +%%ETCDIR%%/image_commons.bpp +%%ETCDIR%%/image_default.bpp +%%ETCDIR%%/licenses.txt +%%ETCDIR%%/messages_de.properties +%%ETCDIR%%/messages_en.properties +%%ETCDIR%%/messages_fr.properties +%%ETCDIR%%/messages_sk.properties +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/commons.family +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/commons.site +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/startup.bsh +@dirrm %%ETCDIR%% +%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%% |