mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
Initial import of libdisorder 0.0.2
Libdisorder is a simple C library for entropy measurement.
This commit is contained in:
parent
1571e01b02
commit
c3bd1fb405
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=259426
7 changed files with 103 additions and 0 deletions
|
@ -750,6 +750,7 @@
|
||||||
SUBDIR += libdfui
|
SUBDIR += libdfui
|
||||||
SUBDIR += libdict
|
SUBDIR += libdict
|
||||||
SUBDIR += libdisasm
|
SUBDIR += libdisasm
|
||||||
|
SUBDIR += libdisorder
|
||||||
SUBDIR += libdispatch
|
SUBDIR += libdispatch
|
||||||
SUBDIR += libdlmalloc
|
SUBDIR += libdlmalloc
|
||||||
SUBDIR += libdlna
|
SUBDIR += libdlna
|
||||||
|
|
31
devel/libdisorder/Makefile
Normal file
31
devel/libdisorder/Makefile
Normal file
|
@ -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>
|
3
devel/libdisorder/distinfo
Normal file
3
devel/libdisorder/distinfo
Normal file
|
@ -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
|
43
devel/libdisorder/files/patch-Makefile
Normal file
43
devel/libdisorder/files/patch-Makefile
Normal file
|
@ -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 ../*~
|
13
devel/libdisorder/files/patch-disorder.c
Normal file
13
devel/libdisorder/files/patch-disorder.c
Normal file
|
@ -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)
|
7
devel/libdisorder/pkg-descr
Normal file
7
devel/libdisorder/pkg-descr
Normal file
|
@ -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/
|
5
devel/libdisorder/pkg-plist
Normal file
5
devel/libdisorder/pkg-plist
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
bin/ropy
|
||||||
|
include/disorder.h
|
||||||
|
lib/libdisorder.a
|
||||||
|
lib/libdisorder.so.1
|
||||||
|
lib/libdisorder.so
|
Loading…
Add table
Reference in a new issue