From 855dea4eff61750ead97ca6d3e49fd41c3d68e40 Mon Sep 17 00:00:00 2001 From: Nathan Owens Date: Wed, 30 Dec 2020 18:32:49 -0600 Subject: [PATCH] yersinia: simplify cross-build patch --- srcpkgs/yersinia/patches/0001-fix-cross.patch | 53 ++++++ srcpkgs/yersinia/patches/fix_crossbuild.patch | 176 ------------------ srcpkgs/yersinia/template | 10 +- 3 files changed, 58 insertions(+), 181 deletions(-) create mode 100644 srcpkgs/yersinia/patches/0001-fix-cross.patch delete mode 100644 srcpkgs/yersinia/patches/fix_crossbuild.patch diff --git a/srcpkgs/yersinia/patches/0001-fix-cross.patch b/srcpkgs/yersinia/patches/0001-fix-cross.patch new file mode 100644 index 00000000000..9879a236cda --- /dev/null +++ b/srcpkgs/yersinia/patches/0001-fix-cross.patch @@ -0,0 +1,53 @@ +From 784ccf7e6aebc80263e5a2bfac2427d597867259 Mon Sep 17 00:00:00 2001 +From: Nathan Owens +Date: Wed, 30 Dec 2020 18:30:54 -0600 +Subject: [PATCH] fix cross + +Use AC_COMPILE_IFELSE instead of AC_TRY_RUN +--- + configure.in | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git configure.in configure.in +index e796198..892312b 100644 +--- configure.in ++++ configure.in +@@ -105,7 +105,7 @@ dnl Check for BSD's BPF + disable_bpf=no + have_bpf=no + AC_MSG_CHECKING(for BPF device sending support) +-AC_TRY_RUN([ ++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ + #include + #include + #include +@@ -127,7 +127,7 @@ main(int argc, char *argv[]) { + + /* else suck, no good */ + exit(-1); +-}], ++}])], + [ + if test $disable_bpf = no ; then + AC_DEFINE([HAVE_BPF], [1], +@@ -217,7 +217,7 @@ dnl AC_MSG_ERROR(...i'm sure you'll take the right decision.) + dnl fi + + AC_MSG_CHECKING(if libnet is at least version 1.1.2) +-AC_TRY_RUN([ ++AC_COMPILE_IFELSE([ + #include + #include + #define HOPE_MAJOR 1 +@@ -403,7 +403,7 @@ AC_CHECK_FUNCS(strerror_r, have_strerror_r=yes,have_strerror_r=no) + + if test $have_strerror_r = yes; then + AC_MSG_CHECKING(if strerror_r is on glibc version >= 2.0) +-AC_TRY_RUN([ ++AC_COMPILE_IFELSE([ + #include + #include + int main() +-- +2.30.0 + diff --git a/srcpkgs/yersinia/patches/fix_crossbuild.patch b/srcpkgs/yersinia/patches/fix_crossbuild.patch deleted file mode 100644 index e7705d01527..00000000000 --- a/srcpkgs/yersinia/patches/fix_crossbuild.patch +++ /dev/null @@ -1,176 +0,0 @@ ---- configure.orig -+++ configure -@@ -4843,59 +4843,6 @@ - - disable_bpf=no - have_bpf=no --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BPF device sending support" >&5 --$as_echo_n "checking for BPF device sending support... " >&6; } --if test "$cross_compiling" = yes; then : -- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 --$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} --as_fn_error $? "cannot run test program while cross compiling --See \`config.log' for more details" "$LINENO" 5; } --else -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --#include --#include --#include --#include -- --int --main(int argc, char *argv[]) { -- int fd; -- -- fd = open("/dev/bpf0", O_RDONLY, 0); -- -- /* if we opened it, we're good */ -- if (fd > 1) -- exit(0); -- -- /* if we got EBUSY or permission denied it exists, so we're good */ -- if (fd < 0 && (errno == EBUSY || errno == 13)) -- exit(0); -- -- /* else suck, no good */ -- exit(-1); --} --_ACEOF --if ac_fn_c_try_run "$LINENO"; then : -- -- if test $disable_bpf = no ; then -- --$as_echo "#define HAVE_BPF 1" >>confdefs.h -- -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; } -- have_bpf=yes -- else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- fi -- --fi --rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -- conftest.$ac_objext conftest.beam conftest.$ac_ext --fi -- - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a complete set of libnet headers" >&5 - $as_echo_n "checking for a complete set of libnet headers... " >&6; } -@@ -4947,11 +4894,6 @@ - LIBNET_INCLUDE="-I$libnet_dir" - LIBNET_LINK="-L`dirname $libnet_dir`/lib" - LIBNET_CONFIG="$libnet_config_dir/libnet-config" -- -- -- -- -- - fi - - if test "$LIBNET_LINK" != "-L/usr/lib" ; then -@@ -4961,99 +4903,7 @@ - CFLAGS="$CFLAGS $LIBNET_INCLUDE" - fi - --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnet_build_stp_conf in -lnet" >&5 --$as_echo_n "checking for libnet_build_stp_conf in -lnet... " >&6; } --if ${ac_cv_lib_net_libnet_build_stp_conf+:} false; then : -- $as_echo_n "(cached) " >&6 --else -- ac_check_lib_save_LIBS=$LIBS --LIBS="-lnet $LIBS" --cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --/* Override any GCC internal prototype to avoid an error. -- Use char because int might match the return type of a GCC -- builtin and then its argument prototype would still apply. */ --#ifdef __cplusplus --extern "C" --#endif --char libnet_build_stp_conf (); --int --main () --{ --return libnet_build_stp_conf (); -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_link "$LINENO"; then : -- ac_cv_lib_net_libnet_build_stp_conf=yes --else -- ac_cv_lib_net_libnet_build_stp_conf=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_net_libnet_build_stp_conf" >&5 --$as_echo "$ac_cv_lib_net_libnet_build_stp_conf" >&6; } --if test "x$ac_cv_lib_net_libnet_build_stp_conf" = xyes; then : -- have_libnet=yes --else -- have_libnet=no --fi -- --if test $have_libnet = no; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ouch!! Libnet library 1.1.2 is needed in order to compile Yersinia!!..." >&5 --$as_echo "$as_me: WARNING: Ouch!! Libnet library 1.1.2 is needed in order to compile Yersinia!!..." >&2;} -- as_fn_error $? "...i'm sure you'll take the right decision." "$LINENO" 5 --fi -- -- --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libnet is at least version 1.1.2" >&5 --$as_echo_n "checking if libnet is at least version 1.1.2... " >&6; } --if test "$cross_compiling" = yes; then : -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; }; have_libnet=no --else -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --#include --#include --#define HOPE_MAJOR 1 --#define HOPE_MEDIUM 1 --#define HOPE_MINOR 2 --int main() --{ -- unsigned int major,medium,minor,current, desired; -- desired = HOPE_MAJOR*10000 + HOPE_MEDIUM*100 + HOPE_MINOR; -- sscanf( LIBNET_VERSION, "%d.%d.%d", &major, &medium, &minor); -- current = major*10000 + medium*100 + minor; -- if ( current >= desired ) -- exit(0); -- exit(1); --} --_ACEOF --if ac_fn_c_try_run "$LINENO"; then : -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; }; have_libnet=yes --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; }; have_libnet=no --fi --rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -- conftest.$ac_objext conftest.beam conftest.$ac_ext --fi -- -- --if test $have_libnet = no; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ouch!! At least Libnet library version 1.1.2 is needed in order to compile Yersinia!!..." >&5 --$as_echo "$as_me: WARNING: Ouch!! At least Libnet library version 1.1.2 is needed in order to compile Yersinia!!..." >&2;} -- as_fn_error $? "...i'm sure you'll take the right decision." "$LINENO" 5 --fi -- -- -+have_libnet=yes - - for ac_header in sys/sockio.h sys/ioctl.h net/if.h - do : - diff --git a/srcpkgs/yersinia/template b/srcpkgs/yersinia/template index f9d57cfe9ff..0eb39ee50bf 100644 --- a/srcpkgs/yersinia/template +++ b/srcpkgs/yersinia/template @@ -4,8 +4,9 @@ version=0.8.2 revision=2 build_style=gnu-configure configure_args="--disable-gtk" -hostmakedepends="pkg-config automake" -makedepends="libpcap-devel libnet-devel ncurses-devel gettext-devel" +hostmakedepends="automake libtool gettext pkg-config" +makedepends="libpcap-devel libnet-devel ncurses-devel gettext-devel + glib-devel" short_desc="Framework for layer 2 security testing" maintainer="Alex Childs " license="GPL-2.0-or-later" @@ -17,7 +18,6 @@ if [ -n "$CROSS_BUILD" ]; then hostmakedepends+=" ${makedepends}" fi -post_configure() { - # configure doesn't honor env CFLAGS - vsed -i src/Makefile -e'/^CFLAGS/s/$/ -fcommon/' +pre_configure() { + autoreconf -fi }