commit:     5f526ca1f2296712e05cbd88127338a75f9f5e49
Author:     NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Sun Feb 23 15:14:44 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Feb 24 21:26:23 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f526ca1

net-wireless/wepattack: fix build failure with C23

Seds in ebuild transformed into patch in the process.

Closes: https://bugs.gentoo.org/944166
Closes: https://bugs.gentoo.org/711032
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40717
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../wepattack/files/wepattack-0.1.3-seds.patch     | 48 +++++++++++++++++
 .../wepattack/files/wepattack-0.1.3-signals.patch  | 13 +++++
 net-wireless/wepattack/wepattack-0.1.3-r7.ebuild   | 60 ++++++++++++++++++++++
 3 files changed, 121 insertions(+)

diff --git a/net-wireless/wepattack/files/wepattack-0.1.3-seds.patch 
b/net-wireless/wepattack/files/wepattack-0.1.3-seds.patch
new file mode 100644
index 000000000000..ceda2344bc49
--- /dev/null
+++ b/net-wireless/wepattack/files/wepattack-0.1.3-seds.patch
@@ -0,0 +1,48 @@
+Transform seds from Makefile into patch. Were:
+       sed -i \
+               -e "/^CFLAGS=/s:=:=${CFLAGS} :" \
+               -e 's:-fno-for-scope::g' \
+               -e "/^CC=/s:gcc:$(tc-getCC):" \
+               -e "/^LD=/s:gcc:$(tc-getCC):" \
+               -e 's:log.o\\:log.o \\:' \
+               src/Makefile || die
+       sed -i \
+               -e "s/wordfile:/-wordlist=/" \
+               run/wepattack_word || die
+https://bugs.gentoo.org/711032
+--- a/run/wepattack_word
++++ b/run/wepattack_word
+@@ -28,7 +28,7 @@
+ 
+ if test -f $JOHNDIR/john; then
+ 
+-      $JOHNDIR/john -wordfile:$WORDLIST -rules -stdout:13\
++      $JOHNDIR/john --wordlist=$WORDLIST -rules -stdout:13\
+       | wepattack -f $1
+       exit 0;
+ else
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -2,11 +2,10 @@
+ # 15-10-2002 Dominik Blunk and Alain Girardet
+ #
+ #
+-CC=gcc
+-LD=gcc
++LD=${CC}
+ #
+ # CFLAGS
+-CFLAGS=-fno-for-scope -c -D__LINUX_WLAN__ -D__I386__
++CFLAGS += -c -D__LINUX_WLAN__ -D__I386__
+ #
+ #
+ # LDFLAGS
+@@ -21,7 +21,7 @@
+ INSTDIR=/usr/bin
+ 
+ wepattack:    wepattack.o rc4.o wepfilter.o log.o modes.o misc.o verify.o 
keygen.o
+-      $(LD) $(LDFLAGS) -o $@ wepattack.o rc4.o wepfilter.o log.o\
++      $(LD) $(LDFLAGS) -o $@ wepattack.o rc4.o wepfilter.o log.o \
+       modes.o misc.o verify.o keygen.o $(LIBS)
+ 
+ wepattack.o:  wepattack.c wepattack.h

diff --git a/net-wireless/wepattack/files/wepattack-0.1.3-signals.patch 
b/net-wireless/wepattack/files/wepattack-0.1.3-signals.patch
new file mode 100644
index 000000000000..90b694d08f8b
--- /dev/null
+++ b/net-wireless/wepattack/files/wepattack-0.1.3-signals.patch
@@ -0,0 +1,13 @@
+Fix signature for signal handler
+https://bugs.gentoo.org/944166
+--- a/src/wepattack.c
++++ b/src/wepattack.c
+@@ -216,7 +216,7 @@
+ //
+ // signal handler for ctrl+c
+ //
+-void sigint() {
++void sigint(int) {
+ 
+       printf("\nAborting... writing result to '%s'\n", logfile);
+ 

diff --git a/net-wireless/wepattack/wepattack-0.1.3-r7.ebuild 
b/net-wireless/wepattack/wepattack-0.1.3-r7.ebuild
new file mode 100644
index 000000000000..e31072b3b7ed
--- /dev/null
+++ b/net-wireless/wepattack/wepattack-0.1.3-r7.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+MY_P="WepAttack-${PV}"
+DESCRIPTION="WLAN tool for breaking 802.11 WEP keys"
+HOMEPAGE="https://wepattack.sourceforge.net/";
+SRC_URI="https://downloads.sourceforge.net/wepattack/${MY_P}.tar.gz";
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="john"
+
+DEPEND="
+       dev-libs/openssl:=
+       net-libs/libpcap
+       sys-libs/zlib
+"
+RDEPEND="
+       ${DEPEND}
+       john? (
+               || (
+                       app-crypt/johntheripper
+                       app-crypt/johntheripper-jumbo
+               )
+       )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-filter-mac-address.patch
+       "${FILESDIR}"/${P}-missed-string.h-warnings-fix.patch
+       "${FILESDIR}"/${P}-modern-c.patch
+       "${FILESDIR}"/${P}-seds.patch
+       "${FILESDIR}"/${P}-signals.patch
+)
+
+src_compile() {
+       tc-export CC
+       emake -C src
+}
+
+src_test() {
+       src/wepattack || die "Program can't start"
+}
+
+src_install() {
+       dodoc README
+       dobin src/wepattack
+
+       if use john; then
+               dosbin run/wepattack_{inc,word}
+               insinto /etc
+               doins "${FILESDIR}"/wepattack.conf
+       fi
+}

Reply via email to