diff options
author | lioux <lioux@FreeBSD.org> | 2005-12-23 22:22:13 +0800 |
---|---|---|
committer | lioux <lioux@FreeBSD.org> | 2005-12-23 22:22:13 +0800 |
commit | 31a6aced3bdd4bf0c5c1328715898a3e11823db0 (patch) | |
tree | eeceb9b7fda0463f66e9ee3a82c05fbbd6a53f40 /math/libjbigi | |
parent | 5f8b75dbbcfc8908eb8b0f907de52ac50d927adc (diff) | |
download | freebsd-ports-gnome-31a6aced3bdd4bf0c5c1328715898a3e11823db0.tar.gz freebsd-ports-gnome-31a6aced3bdd4bf0c5c1328715898a3e11823db0.tar.zst freebsd-ports-gnome-31a6aced3bdd4bf0c5c1328715898a3e11823db0.zip |
New port libjbigi version 0.6.1.8: i2p JNI to GNU MP Bignum library
(libgmp)
Diffstat (limited to 'math/libjbigi')
-rw-r--r-- | math/libjbigi/Makefile | 76 | ||||
-rw-r--r-- | math/libjbigi/distinfo | 3 | ||||
-rw-r--r-- | math/libjbigi/files/patch-jbigi__build_jbigi.sh | 40 | ||||
-rw-r--r-- | math/libjbigi/files/patch-jcpuid__build.sh | 22 | ||||
-rw-r--r-- | math/libjbigi/pkg-descr | 9 |
5 files changed, 150 insertions, 0 deletions
diff --git a/math/libjbigi/Makefile b/math/libjbigi/Makefile new file mode 100644 index 000000000000..dbc789492963 --- /dev/null +++ b/math/libjbigi/Makefile @@ -0,0 +1,76 @@ +# New ports collection makefile for: i2p jbigi JNI +# Date created: Fri Dec 23 12:02:32 UTC 2005 +# Whom: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= libjbigi +PORTVERSION= 0.6.1.8 +CATEGORIES= math java +MASTER_SITES= http://dev.i2p.net/i2p/ +DISTNAME= i2p-${PORTVERSION} + +MAINTAINER= lioux@FreeBSD.org +COMMENT= i2p JNI to GNU MP Bignum library (libgmp) + +BUILD_DEPENDS= ${LOCALBASE}/lib/libgmp.a:${PORTSDIR}/math/libgmp4 + +USE_BZIP2= yes +USE_JAVA= yes +JAVA_BUILD= jdk +JAVA_VERSION= 1.4 +JAVA_OS= native + +WRKSRC= ${WRKDIR}/i2p_${PORTVERSION:S/./_/g}/core/c + +PLIST_FILES= %%JAVAJARDIR%%/jbigi.jar + +JBIGI_BUILD_ENV= \ + CC="${CC}" \ + CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS} -static" \ + JAVA_HOME="${JAVA_HOME}" \ + LOCALBASE="${LOCALBASE}" +JBIGI_LIBS= \ + libjbigi-freebsd-none.so + +do-install: + @${INSTALL_DATA} ${WRKSRC}/jbigi.jar \ + ${JAVAJARDIR} + +.include <bsd.port.pre.mk> + +.if ${ARCH} == "i386" || ${ARCH} == "amd64" +JBIGI_BUILD_JCPUID= yes +JBIGI_LIBS+= libjbigi-freebsd-x86.so +.endif + +do-build: +## build JNI +.ifdef(JBIGI_BUILD_JCPUID) +# jcpuid + cd ${BUILD_WRKSRC}/jcpuid && \ + ${ENV} ${JBIGI_BUILD_ENV} \ + ${SH} ./build.sh +.endif +# jbigi + cd ${BUILD_WRKSRC}/jbigi && \ + ${ENV} ${JBIGI_BUILD_ENV} \ + ${SH} ./build_jbigi.sh static +## prepare jar +.ifdef(JBIGI_BUILD_JCPUID) +# jcpuid + @${MKDIR} ${WRKSRC}/t/freenet/support/CPUInformation/ + @${CP} ${WRKSRC}/jcpuid/lib/freenet/support/CPUInformation/*jcpuid* \ + ${WRKSRC}/t/freenet/support/CPUInformation/ +.endif +# jbigi + @${MKDIR} ${WRKSRC}/t/net/i2p/util +.for lib in ${JBIGI_LIBS} + @${CP} ${WRKSRC}/jbigi/libjbigi.so \ + ${WRKSRC}/t/net/i2p/util/${lib} +.endfor + @cd ${WRKSRC}/t && ${JAR} cf ../jbigi.jar . + +.include <bsd.port.post.mk> diff --git a/math/libjbigi/distinfo b/math/libjbigi/distinfo new file mode 100644 index 000000000000..ed0d9c930feb --- /dev/null +++ b/math/libjbigi/distinfo @@ -0,0 +1,3 @@ +MD5 (i2p-0.6.1.8.tar.bz2) = 60c1a3c4065b55346819f25cd08a3f6b +SHA256 (i2p-0.6.1.8.tar.bz2) = f64662eeaa29ec703ced10048ef8cd6928423b3f6641f37fd751b9887f736523 +SIZE (i2p-0.6.1.8.tar.bz2) = 9328611 diff --git a/math/libjbigi/files/patch-jbigi__build_jbigi.sh b/math/libjbigi/files/patch-jbigi__build_jbigi.sh new file mode 100644 index 000000000000..46cddff05cd4 --- /dev/null +++ b/math/libjbigi/files/patch-jbigi__build_jbigi.sh @@ -0,0 +1,40 @@ +--- jbigi/build_jbigi.sh.orig Fri Jan 21 18:52:41 2005 ++++ jbigi/build_jbigi.sh Fri Dec 23 11:13:55 2005 +@@ -2,7 +2,6 @@ + # When executed in Mingw: Produces an jbigi.dll + # When executed in Linux: Produces an libjbigi.so + +-CC="gcc" + + case `uname -sr` in + MINGW*) +@@ -24,9 +23,9 @@ + LINKFLAGS="-dynamiclib -framework JavaVM" + LIBFILE="libjbigi.jnilib";; + *) +- COMPILEFLAGS="-fPIC -Wall" +- INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" +- LINKFLAGS="-shared -Wl,-soname,libjbigi.so" ++ COMPILEFLAGS="-fPIC -Wall ${CFLAGS}" ++ INCLUDES="-I. -I${LOCALBASE}/include -Ijbigi/include -I$JAVA_HOME/include -I$JAVA_HOME/include/freebsd" ++ LINKFLAGS="-shared -Wl,-soname,libjbigi.so ${LDFLAGS}" + LIBFILE="libjbigi.so";; + esac + +@@ -36,13 +35,13 @@ + then + echo "Building jbigi lib that is dynamically linked to GMP" + LIBPATH="-L.libs" +- INCLUDELIBS="-lgmp" ++ INCLUDELIBS="-L${LOCALBASE}/lib -lgmp" + else + echo "Building jbigi lib that is statically linked to GMP" +- STATICLIBS=".libs/libgmp.a" ++ STATICLIBS="${LOCALBASE}/lib/libgmp.a" + fi + + echo "Compiling C code..." + rm -f jbigi.o $LIBFILE +-$CC -c $COMPILEFLAGS $INCLUDES ../../jbigi/src/jbigi.c ++$CC -c $COMPILEFLAGS $INCLUDES jbigi/src/jbigi.c + $CC $LINKFLAGS $INCLUDES $INCLUDELIBS -o $LIBFILE jbigi.o $STATICLIBS diff --git a/math/libjbigi/files/patch-jcpuid__build.sh b/math/libjbigi/files/patch-jcpuid__build.sh new file mode 100644 index 000000000000..307b9b198920 --- /dev/null +++ b/math/libjbigi/files/patch-jcpuid__build.sh @@ -0,0 +1,22 @@ +--- jcpuid/build.sh.orig Fri Dec 23 09:42:02 2005 ++++ jcpuid/build.sh Fri Dec 23 09:43:45 2005 +@@ -20,7 +20,6 @@ + mkdir lib/freenet/support + mkdir lib/freenet/support/CPUInformation + +-CC="gcc" + + case `uname -sr` in + MINGW*) +@@ -30,9 +29,9 @@ + LINKFLAGS="-shared -static -static-libgcc -Wl,--kill-at" + LIBFILE="lib/freenet/support/CPUInformation/jcpuid-x86-windows.dll";; + FreeBSD*) +- COMPILEFLAGS="-Wall" ++ COMPILEFLAGS="-Wall ${CFLAGS}" + INCLUDES="-I. -Iinclude -I$JAVA_HOME/include/ -I$JAVA_HOME/include/freebsd/" +- LINKFLAGS="-shared -static -Wl,-soname,libjcpuid-x86-freebsd.so" ++ LINKFLAGS="-shared -Wl,-soname,libjcpuid-x86-freebsd.so ${LDFLAGS}" + LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-x86-freebsd.so";; + Linux*) + COMPILEFLAGS="-fPIC -Wall" diff --git a/math/libjbigi/pkg-descr b/math/libjbigi/pkg-descr new file mode 100644 index 000000000000..0b29a90540e9 --- /dev/null +++ b/math/libjbigi/pkg-descr @@ -0,0 +1,9 @@ +[ excerpt from developer's web site ] + +Using JNI (Java Native Interface), a bit of C code (thanks ugha!), +a little manual work and a piece of chewinggum: it is possible to +make the public key cryptography quite a bit faster. + +WWW: http://www.i2p.net/jbigi + +-- lioux@FreeBSD.org |