diff --git a/pkg/libpcap/0001.patch b/pkg/libpcap/0001.patch new file mode 100644 index 0000000..5280b4e --- /dev/null +++ b/pkg/libpcap/0001.patch @@ -0,0 +1,12 @@ +diff --git a/pcap-usb-linux.c b/pcap-usb-linux.c +index 6f8adf6..b2068b4 100644 +--- a/pcap-usb-linux.c ++++ b/pcap-usb-linux.c +@@ -45,6 +45,7 @@ + #include "strerror.h" + #endif + ++#include + #include + #include + #include diff --git a/pkg/libpcap/build b/pkg/libpcap/build new file mode 100755 index 0000000..e6deb6b --- /dev/null +++ b/pkg/libpcap/build @@ -0,0 +1,35 @@ +VERSION="1.9.0" +SRCDIR="libpcap-${VERSION}" +TARBALL="${SRCDIR}.tar.gz" +URL="http://www.tcpdump.org/release/" +SHA256SUM="2edb88808e5913fdaa8e9c1fcaf272e19b2485338742b5074b9fe44d68f37019" +DEPENDS="toolchain libnl3" + +prepare() { + apply_patches +} + +build() { + cp -r ${1}/* ${PKGBUILDDIR} + sed -i "s#/usr/include/libnl3#$TCDIR/$TARGET/include/libnl3#g" configure + + ./configure --prefix="" --host="$TARGET" --sbindir=/bin \ + --libexecdir=/lib/libexec --with-pcap=linux \ + --enable-ipv6 + + make -j $NUMJOBS +} + +deploy() { + local SOURCE="$1" + local DEPLOY="$2" + + make DESTDIR="$DEPLOY" install + cp "$SCRIPTDIR/pkg/$PKGNAME/rootfs_files.txt" "$DEPLOY" +} + +check_update() { + curl --silent -L "$URL" | grep -o ">libpcap-[0-9.]*tar.gz<" | \ + sed 's/>libpcap-//g' | sed 's/.tar.gz&5 + $as_echo "not found" >&6; } +- +- # +- # Look for pcap-config. +- # +- if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}pcap-config", so it can be a program name with args. +-set dummy ${ac_tool_prefix}pcap-config; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if ${ac_cv_path_PCAP_CONFIG+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- case $PCAP_CONFIG in +- [\\/]* | ?:[\\/]*) +- ac_cv_path_PCAP_CONFIG="$PCAP_CONFIG" # Let the user override the test with a path. +- ;; +- *) +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_path_PCAP_CONFIG="$as_dir/$ac_word$ac_exec_ext" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +- done +-IFS=$as_save_IFS +- +- ;; +-esac +-fi +-PCAP_CONFIG=$ac_cv_path_PCAP_CONFIG +-if test -n "$PCAP_CONFIG"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCAP_CONFIG" >&5 +-$as_echo "$PCAP_CONFIG" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +- +- +-fi +-if test -z "$ac_cv_path_PCAP_CONFIG"; then +- ac_pt_PCAP_CONFIG=$PCAP_CONFIG +- # Extract the first word of "pcap-config", so it can be a program name with args. +-set dummy pcap-config; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if ${ac_cv_path_ac_pt_PCAP_CONFIG+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- case $ac_pt_PCAP_CONFIG in +- [\\/]* | ?:[\\/]*) +- ac_cv_path_ac_pt_PCAP_CONFIG="$ac_pt_PCAP_CONFIG" # Let the user override the test with a path. +- ;; +- *) +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_path_ac_pt_PCAP_CONFIG="$as_dir/$ac_word$ac_exec_ext" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +- done +-IFS=$as_save_IFS +- +- ;; +-esac +-fi +-ac_pt_PCAP_CONFIG=$ac_cv_path_ac_pt_PCAP_CONFIG +-if test -n "$ac_pt_PCAP_CONFIG"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PCAP_CONFIG" >&5 +-$as_echo "$ac_pt_PCAP_CONFIG" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +- +- if test "x$ac_pt_PCAP_CONFIG" = x; then +- PCAP_CONFIG="" +- else +- case $cross_compiling:$ac_tool_warned in +-yes:) +-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +-ac_tool_warned=yes ;; +-esac +- PCAP_CONFIG=$ac_pt_PCAP_CONFIG +- fi +-else +- PCAP_CONFIG="$ac_cv_path_PCAP_CONFIG" +-fi +- +- if test -n "$PCAP_CONFIG" ; then +- # +- # Found - use it to get the include flags for +- # libpcap and the flags to link with libpcap. +- # +- # Please read section 11.6 "Shell Substitutions" +- # in the autoconf manual before doing anything +- # to this that involves quoting. Especially note +- # the statement "There is just no portable way to use +- # double-quoted strings inside double-quoted back-quoted +- # expressions (pfew!)." +- # +- cflags=`"$PCAP_CONFIG" --cflags` +- V_INCLS="$cflags $V_INCLS" +- libpcap=`"$PCAP_CONFIG" --libs` +- else +- # +- # Not found; look for pcap. +- # +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpcap" >&5 +-$as_echo_n "checking for main in -lpcap... " >&6; } +-if ${ac_cv_lib_pcap_main+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- ac_check_lib_save_LIBS=$LIBS +-LIBS="-lpcap $LIBS" +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +- +-int +-main () +-{ +-return main (); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- ac_cv_lib_pcap_main=yes +-else +- ac_cv_lib_pcap_main=no +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-LIBS=$ac_check_lib_save_LIBS +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcap_main" >&5 +-$as_echo "$ac_cv_lib_pcap_main" >&6; } +-if test "x$ac_cv_lib_pcap_main" = xyes; then : +- libpcap="-lpcap" +-fi +- +- if test $libpcap = FAIL ; then +- as_fn_error $? "see the INSTALL doc for more info" "$LINENO" 5 +- fi +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extraneous pcap header directories" >&5 +-$as_echo_n "checking for extraneous pcap header directories... " >&6; } +- if test \( ! -r /usr/local/include/pcap.h \) -a \ +- \( ! -r /usr/include/pcap.h \); then +- if test -r /usr/local/include/pcap/pcap.h; then +- d="/usr/local/include/pcap" +- elif test -r /usr/include/pcap/pcap.h; then +- d="/usr/include/pcap" +- fi +- fi +- if test -z "$d" ; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +-$as_echo "not found" >&6; } +- else +- V_INCLS="-I$d $V_INCLS" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: found -- -I$d added" >&5 +-$as_echo "found -- -I$d added" >&6; } +- fi +- fi +- else +- V_PCAPDEP=$libpcap +- places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ +- egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'` +- places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \ +- egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'` +- pcapH=FAIL +- if test -r $d/pcap.h; then +- pcapH=$d +- else +- for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do +- if test -r $dir/pcap.h ; then +- pcapH=$dir +- fi +- done +- fi +- +- if test $pcapH = FAIL ; then +- as_fn_error $? "cannot find pcap.h: see INSTALL" "$LINENO" 5 +- fi +- V_INCLS="-I$pcapH $V_INCLS" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libpcap" >&5 +-$as_echo "$libpcap" >&6; } +- # Extract the first word of "pcap-config", so it can be a program name with args. +-set dummy pcap-config; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if ${ac_cv_path_PCAP_CONFIG+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- case $PCAP_CONFIG in +- [\\/]* | ?:[\\/]*) +- ac_cv_path_PCAP_CONFIG="$PCAP_CONFIG" # Let the user override the test with a path. +- ;; +- *) +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $d +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_path_PCAP_CONFIG="$as_dir/$ac_word$ac_exec_ext" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +- done +-IFS=$as_save_IFS +- +- ;; +-esac +-fi +-PCAP_CONFIG=$ac_cv_path_PCAP_CONFIG +-if test -n "$PCAP_CONFIG"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCAP_CONFIG" >&5 +-$as_echo "$PCAP_CONFIG" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +- +- +- if test -n "$PCAP_CONFIG"; then +- # +- # The libpcap directory has a pcap-config script. +- # Use it to get any additioal libraries needed +- # to link with the libpcap archive library in +- # that directory. +- # +- # Please read section 11.6 "Shell Substitutions" +- # in the autoconf manual before doing anything +- # to this that involves quoting. Especially note +- # the statement "There is just no portable way to use +- # double-quoted strings inside double-quoted back-quoted +- # expressions (pfew!)." +- # +- additional_libs=`"$PCAP_CONFIG" --additional-libs --static` +- libpcap="$libpcap $additional_libs" +- fi ++ libpcap="-lpcap -lnl-genl-3 -lnl-3" + fi + LIBS="$libpcap $LIBS" +- if ! test -n "$PCAP_CONFIG" ; then +- # +- # We don't have pcap-config; find out any additional link flags +- # we need. (If we have pcap-config, we assume it tells us what +- # we need.) +- # +- case "$host_os" in +- +- aix*) +- # +- # If libpcap is DLPI-based, we have to use /lib/pse.exp if +- # present, as we use the STREAMS routines. +- # +- # (XXX - true only if we're linking with a static libpcap?) +- # +- pseexe="/lib/pse.exp" +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $pseexe" >&5 +-$as_echo_n "checking for $pseexe... " >&6; } +- if test -f $pseexe ; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- LIBS="$LIBS -I:$pseexe" +- fi +- +- # +- # If libpcap is BPF-based, we need "-lodm" and "-lcfg", as +- # we use them to load the BPF module. +- # +- # (XXX - true only if we're linking with a static libpcap?) +- # +- LIBS="$LIBS -lodm -lcfg" +- ;; +- esac +- fi +- +- ac_fn_c_check_func "$LINENO" "pcap_loop" "ac_cv_func_pcap_loop" +-if test "x$ac_cv_func_pcap_loop" = xyes; then : +- +-else +- +- as_fn_error $? "This is a bug, please follow the guidelines in CONTRIBUTING and include the +-config.log file in your report. If you have downloaded libpcap from +-tcpdump.org, and built it yourself, please also include the config.log +-file from the libpcap source directory, the Makefile from the libpcap +-source directory, and the output of the make process for libpcap, as +-this could be a problem with the libpcap that was built, and we will +-not be able to determine why this is happening, and thus will not be +-able to fix it, without that information, as we have not been able to +-reproduce this problem ourselves." "$LINENO" 5 +- +-fi +- +- + + # + # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate diff --git a/pkg/tcpdump/build b/pkg/tcpdump/build new file mode 100755 index 0000000..d7819fa --- /dev/null +++ b/pkg/tcpdump/build @@ -0,0 +1,32 @@ +VERSION="4.9.2" +SRCDIR="tcpdump-${VERSION}" +TARBALL="${SRCDIR}.tar.gz" +URL="http://www.tcpdump.org/release/" +SHA256SUM="798b3536a29832ce0cbb07fafb1ce5097c95e308a6f592d14052e1ef1505fe79" +DEPENDS="toolchain libnl3 openssl libpcap" + +prepare() { + apply_patches +} + +build() { + $1/configure --prefix="" --host="$TARGET" --sbindir=/bin \ + --libexecdir=/lib/libexec --with-system-libpcap \ + --with-cap-ng --with-crypto="$TCDIR/$TARGET" + + make -j $NUMJOBS +} + +deploy() { + local SOURCE="$1" + local DEPLOY="$2" + + make DESTDIR="$DEPLOY" install + cp "$SCRIPTDIR/pkg/$PKGNAME/rootfs_files.txt" "$DEPLOY" +} + +check_update() { + curl --silent -L "$URL" | grep -o ">tcpdump-[0-9.]*tar.gz<" | \ + sed 's/>tcpdump-//g' | sed 's/.tar.gz