Skip to content

Instantly share code, notes, and snippets.

@jlongman
Created May 11, 2015 21:02
Show Gist options
  • Save jlongman/c683a8f7ec69236efa9f to your computer and use it in GitHub Desktop.
Save jlongman/c683a8f7ec69236efa9f to your computer and use it in GitHub Desktop.
Build wireplay on FreeBSD
WIREPLAY_HOME=~/wireplay
cd /usr/ports/net/libnet11; make install
cd $WIREPLAY/libnids-1.23; ./configure --enable-shared --disable-libglib; make
cd /usr/ports/lang/ruby18; make install
cd $WIREPLAY
# uncomment the lib defn in include/config.h (or workaround)
# in src/wireplay.c, add #include <sys/socket.h>
cat << EOF > makefile.patch
Index: Makefile
===================================================================
--- Makefile (revision 18)
+++ Makefile (working copy)
@@ -1,8 +1,11 @@
ROOT := $(PWD)
CC := gcc
-RUBYINC := /usr/lib/ruby/1.8/i486-linux
+RUBYINC := /usr/local/lib/ruby/1.8/i386-freebsd7 -I /usr/local/lib/ruby/1.8
+#RUBYINC := /usr/local/include/ruby-1.9/i386-freebsd7 -I /usr/local/include/ruby-1.9
CFLAGS := -DDEBUG -I $(ROOT)/include -I $(RUBYINC) -I $(ROOT)/libnids-1.23/src/ -ggdb
-LDFLAGS := -ggdb -L$(ROOT)/libnids-1.23/src/ -lnids -lpcap -lnet -lruby1.8
+LDFLAGS := -ggdb -L$(ROOT)/libnids-1.23/src/ -L/usr/local/lib /usr/local/lib/libruby18.a /usr/local/lib/libnids.a /usr/local/lib/libnet.a /usr/lib/libpcap.a -lm -lcrypt
+#LDFLAGS := -ggdb -L$(ROOT)/libnids-1.23/src/ -lnids -lpcap -lnet -L/usr/local/lib -lruby18
+#LDFLAGS := -ggdb -L$(ROOT)/libnids-1.23/src/ -lnids -lpcap -lnet -lruby1.8
PACKAGE := wireplay-$(shell date "+%Y%m%d").tar.gz
DEVPACKAGE := wireplay-dev-$(shell date "+%Y%m%d").tar.gz
SVNPATH := https://wireplay.googlecode.com/svn/trunk
EOF
patch < makefile.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment