aboutsummaryrefslogtreecommitdiff
path: root/devel/libdisorder
diff options
context:
space:
mode:
authorKevin Lo <kevlo@FreeBSD.org>2010-08-17 10:27:36 +0000
committerKevin Lo <kevlo@FreeBSD.org>2010-08-17 10:27:36 +0000
commitc3bd1fb405b54ea19db84c0919be81a53853afcc (patch)
tree6d8173adc0d2b08b9e0361ddce28feceebf8172b /devel/libdisorder
parent1571e01b023328c9cff0e8a8a9d5a9037627dc95 (diff)
downloadports-c3bd1fb405b54ea19db84c0919be81a53853afcc.tar.gz
ports-c3bd1fb405b54ea19db84c0919be81a53853afcc.zip
Initial import of libdisorder 0.0.2
Libdisorder is a simple C library for entropy measurement.
Notes
Notes: svn path=/head/; revision=259426
Diffstat (limited to 'devel/libdisorder')
-rw-r--r--devel/libdisorder/Makefile31
-rw-r--r--devel/libdisorder/distinfo3
-rw-r--r--devel/libdisorder/files/patch-Makefile43
-rw-r--r--devel/libdisorder/files/patch-disorder.c13
-rw-r--r--devel/libdisorder/pkg-descr7
-rw-r--r--devel/libdisorder/pkg-plist5
6 files changed, 102 insertions, 0 deletions
diff --git a/devel/libdisorder/Makefile b/devel/libdisorder/Makefile
new file mode 100644
index 000000000000..9ddf428129fa
--- /dev/null
+++ b/devel/libdisorder/Makefile
@@ -0,0 +1,31 @@
+# New ports collection makefile for: libdisorder
+# Date created: 17 August 2010
+# Whom: kevlo
+#
+# $FreeBSD$
+#
+
+PORTNAME= libdisorder
+PORTVERSION= 0.0.2
+CATEGORIES= devel
+MASTER_SITES= http://libdisorder.freshdefense.net/releases/
+
+MAINTAINER= kevlo@FreeBSD.org
+COMMENT= A simple C library for entropy measurement
+
+USE_LDCONFIG= yes
+
+do-build:
+ cd ${WRKSRC}/src && ${SETENV} ${MAKE_ENV} ${MAKE}
+
+do-install:
+ ${INSTALL_DATA} ${WRKSRC}/include/disorder.h ${PREFIX}/include
+ ${INSTALL_DATA} ${WRKSRC}/lib/libdisorder.a ${PREFIX}/lib
+ ${INSTALL_DATA} ${WRKSRC}/src/libdisorder.so \
+ ${PREFIX}/lib/libdisorder.so.1
+ ${INSTALL_PROGRAM} ${WRKSRC}/tool/ropy ${PREFIX}/bin
+
+post-install:
+ ${LN} -sf ${PREFIX}/lib/libdisorder.so.1 ${PREFIX}/lib/libdisorder.so
+
+.include <bsd.port.mk>
diff --git a/devel/libdisorder/distinfo b/devel/libdisorder/distinfo
new file mode 100644
index 000000000000..683b7aaaf516
--- /dev/null
+++ b/devel/libdisorder/distinfo
@@ -0,0 +1,3 @@
+MD5 (libdisorder-0.0.2.tar.gz) = ceec7341af6afb23019dc50842ea3344
+SHA256 (libdisorder-0.0.2.tar.gz) = 88c96263aacb1f3414d55f2d4b7ed3f1b3f637acb4a3caa3c9a3a26f3d3e7df8
+SIZE (libdisorder-0.0.2.tar.gz) = 22144
diff --git a/devel/libdisorder/files/patch-Makefile b/devel/libdisorder/files/patch-Makefile
new file mode 100644
index 000000000000..71cbb90353aa
--- /dev/null
+++ b/devel/libdisorder/files/patch-Makefile
@@ -0,0 +1,43 @@
+--- src/Makefile.orig 2010-03-09 08:00:16.000000000 +0800
++++ src/Makefile 2010-08-17 17:52:59.000000000 +0800
+@@ -1,4 +1,4 @@
+-LDFLAGS=-L../lib -L/usr/lib
++LDFLAGS=-L../lib -L/usr/lib -lm
+ INCLUDES=-I/usr/include -I../include
+ LIBS=-ldisorder
+ #OPTS=-Wall -g -pg
+@@ -12,14 +12,18 @@
+
+ library: libdisorder.a
+
+-libdisorder.a: disorder.o
++libdisorder.a: disorder.o disorder.So
+ ar rc $@ disorder.o
+ mkdir -p ../lib
+ mv libdisorder.a ../lib
++ ld -shared -o libdisorder.so disorder.So
+
+ disorder: disorder.c ../include/disorder.h
+ gcc $(OPTS) -c disorder.c
+
++disorder.So: disorder.c ../include/disorder.h
++ gcc $(OPTS) -c disorder.c -fPIC -o disorder.So
++
+ test: ../test/test.c
+ gcc $(OPTS) $(LDFLAGS) $(INCLUDES) -o $(TESTOUT) $(TESTSRC) $(LIBS)
+
+@@ -27,11 +31,11 @@
+ gcc $(OPTS) $(LDFLAGS) $(INCLUDES) -o $(TOOLOUT) $(TOOLSRC) $(LIBS)
+
+ clean:
+- @/bin/rm -f *~ *.o *.a $(TESTOUT) $(TOOLOUT)
++ @/bin/rm -f *~ *.o *.a *.So *.so $(TESTOUT) $(TOOLOUT)
+ @/bin/rm -f ../test/*~
+ @/bin/rm -f ../tool/*~
+ @/bin/rm -Rf ../test/testexec.dSYM/
+ @/bin/rm -Rf ../tool/ropy.dSYM/
+ @/bin/rm -f ../include/*~
+ @/bin/rm -f ../lib/*.a
+- @/bin/rm -f ../*~
+\ No newline at end of file
++ @/bin/rm -f ../*~
diff --git a/devel/libdisorder/files/patch-disorder.c b/devel/libdisorder/files/patch-disorder.c
new file mode 100644
index 000000000000..4688ab9b59c7
--- /dev/null
+++ b/devel/libdisorder/files/patch-disorder.c
@@ -0,0 +1,13 @@
+--- src/disorder.c.orig 2010-08-17 16:15:30.000000000 +0800
++++ src/disorder.c 2010-08-17 16:22:27.000000000 +0800
+@@ -25,6 +25,10 @@
+ #include <stdio.h> //for NULL
+ #include "../include/disorder.h"
+
++#if defined(__FreeBSD__)
++#define log2(x) (log((x)) * (1./M_LN2))
++#endif
++
+ /** Frequecies for each byte */
+ static int m_token_freqs[LIBDO_MAX_BYTES]; //frequency of each token in sample
+ static float m_token_probs[LIBDO_MAX_BYTES]; //P(each token appearing)
diff --git a/devel/libdisorder/pkg-descr b/devel/libdisorder/pkg-descr
new file mode 100644
index 000000000000..e0af2deda5da
--- /dev/null
+++ b/devel/libdisorder/pkg-descr
@@ -0,0 +1,7 @@
+Disorder and chaos are interesting phenomena. Calculating the amount
+of entropy, information, or disorder in an information stream or data
+collection has many interesting applications.
+libdisorder provides a simple C library for calculating classic Shannon
+entropy (more to come in future releases).
+
+WWW: http://libdisorder.freshdefense.net/
diff --git a/devel/libdisorder/pkg-plist b/devel/libdisorder/pkg-plist
new file mode 100644
index 000000000000..a00410171b87
--- /dev/null
+++ b/devel/libdisorder/pkg-plist
@@ -0,0 +1,5 @@
+bin/ropy
+include/disorder.h
+lib/libdisorder.a
+lib/libdisorder.so.1
+lib/libdisorder.so