[oe-commits] Roman I Khimov : pf_ring: add recipes for PF_RING kernel module and userspace library

git version control git at git.openembedded.org
Thu Aug 5 06:44:52 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 5e02e8de46439e09aa527813f335b785cd389ecf
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=5e02e8de46439e09aa527813f335b785cd389ecf

Author: Roman I Khimov <khimov at altell.ru>
Date:   Mon Aug  2 18:14:39 2010 +0400

pf_ring: add recipes for PF_RING kernel module and userspace library

PF_RING is a new type of network socket that dramatically improves
the packet capture speed.

Signed-off-by: Roman I Khimov <khimov at altell.ru>

---

 .../libpfring/libpfring-makefile-fixes.patch       |   59 ++++++++++++++++++++
 recipes/pf_ring/libpfring_svn.bb                   |   23 ++++++++
 recipes/pf_ring/pf-ring_svn.bb                     |   20 +++++++
 3 files changed, 102 insertions(+), 0 deletions(-)

diff --git a/recipes/pf_ring/libpfring/libpfring-makefile-fixes.patch b/recipes/pf_ring/libpfring/libpfring-makefile-fixes.patch
new file mode 100644
index 0000000..721f904
--- /dev/null
+++ b/recipes/pf_ring/libpfring/libpfring-makefile-fixes.patch
@@ -0,0 +1,59 @@
+Index: Makefile
+===================================================================
+--- Makefile.orig	2010-08-02 17:31:55.000000000 +0400
++++ Makefile	2010-08-03 12:56:31.000000000 +0400
+@@ -8,7 +8,7 @@
+ #
+ # Installation directory
+ #
+-INSTDIR   = ${DESTDIR}/usr/local
++INSTDIR   = ${DESTDIR}/usr
+ 
+ #
+ # Search directories
+@@ -29,6 +29,8 @@
+ #
+ # C compiler and flags
+ #
++AR        = ar
++RANLIB    = ranlib
+ CC        = gcc
+ CFLAGS    = -g -O2 -Wall -fPIC ${INCLUDE} ${DNA_DEFINE}
+ LDFLAGS   = -shared
+@@ -44,26 +46,29 @@
+ # Main targets
+ #
+ STATICLIB  = libpfring.a
+-DYNAMICLIB = libpfring.so
++DYNAMICLIB = libpfring.so.0.0.1
+ TARGETS    = ${STATICLIB} ${DYNAMICLIB}
+ RING_H     = ../../kernel/linux/pf_ring.h
+ 
+ all: ${TARGETS}
+ 
+-${STATICLIB}: Makefile ${OBJS} pfring.h ${RING_H}
++${STATICLIB}: Makefile ${OBJS} pfring.h
+ 	@echo "=*= making library $@ =*="
+-	ar rs $@ ${OBJS}
+-	ranlib $@
++	${AR} rs $@ ${OBJS}
++	${RANLIB} $@
+ 
+-${DYNAMICLIB}: ${OBJS} pfring.h ${RING_H} Makefile
++${DYNAMICLIB}: ${OBJS} pfring.h Makefile
+ 	@echo "=*= making library $@ =*="
+-	${CC} ${LDFLAGS} ${OBJS} ${SYSLIBS} -o $@
++	${CC} ${LDFLAGS} ${OBJS} ${SYSLIBS} -Wl,-soname,libpfring.so.0 -o $@
+ 
+ install: ${STATICLIB} ${DYNAMICLIB}
++	install -d ${INSTDIR}/lib
++	install -d ${INSTDIR}/include
+ 	cp ${STATICLIB} ${INSTDIR}/lib/
+ 	cp ${DYNAMICLIB} ${INSTDIR}/lib/
++	ln -sf ${DYNAMICLIB} ${INSTDIR}/lib/libpfring.so.0
++	ln -sf ${DYNAMICLIB} ${INSTDIR}/lib/libpfring.so
+ 	cp pfring_e1000e_dna.h pfring.h ${INSTDIR}/include/
+-	ldconfig
+ 
+ clean:
+ 	@rm -f ${TARGETS} *.o *~
diff --git a/recipes/pf_ring/libpfring_svn.bb b/recipes/pf_ring/libpfring_svn.bb
new file mode 100644
index 0000000..711d289
--- /dev/null
+++ b/recipes/pf_ring/libpfring_svn.bb
@@ -0,0 +1,23 @@
+DESCRIPTION = "PF_RING is a new type of network socket that dramatically improves the packet capture speed, this package contains userspace library for interaction with kernel PF_RING module"
+SECTION = "optional"
+LICENSE = "GPL"
+HOMEPAGE = "http://www.ntop.org/PF_RING.html"
+DEPENDS += "pf-ring"
+PV = "4.4.0+svnr${SRCPV}"
+
+S = "${WORKDIR}/lib"
+
+SRCREV = "4326"
+SRC_URI = " \
+	svn://svn.ntop.org/svn/ntop/trunk/PF_RING/userland;module=lib;proto=https \
+	file://libpfring-makefile-fixes.patch;patch=1;pnum=0 \
+	"
+
+CFLAGS += "-fPIC"
+LDFLAGS += "-shared"
+
+do_install() {
+	oe_runmake DESTDIR=${D} install
+}
+
+RRECOMMENDS_${PN} = "pf-ring"
diff --git a/recipes/pf_ring/pf-ring_svn.bb b/recipes/pf_ring/pf-ring_svn.bb
new file mode 100644
index 0000000..55b5971
--- /dev/null
+++ b/recipes/pf_ring/pf-ring_svn.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "PF_RING is a new type of network socket that dramatically improves the packet capture speed, this package contains PF_RING kernel module"
+SECTION = "optional"
+HOMEPAGE = "http://www.ntop.org/PF_RING.html"
+LICENSE = "GPL"
+PV = "4.4.0+svnr${SRCPV}"
+
+S = "${WORKDIR}/kernel"
+
+SRCREV = "4326"
+SRC_URI = "svn://svn.ntop.org/svn/ntop/trunk/PF_RING;module=kernel;proto=https"
+
+inherit module
+
+MAKE_TARGETS = "modules"
+MODULE_MAKE_FLAGS += "-C ${STAGING_KERNEL_DIR} M=${S}"
+
+do_install_append() {
+	install -d ${D}${includedir}/linux
+	install -m 0644 linux/pf_ring.h ${D}${includedir}/linux
+}





More information about the Openembedded-commits mailing list