From 579ca1ec392de3232022122cddb08ef34aa80200 Mon Sep 17 00:00:00 2001 From: Robert Buchholz Date: Thu, 12 Mar 2009 17:59:10 +0000 Subject: Reintroduce iw as a dep on Linux that got dropped in the bump (bug # 260177), Improve support for current FreeBSD (bug #253803): applied some patches and remove airmon-ng application. (Portage version: 2.1.6.7/cvs/Linux x86_64) --- net-wireless/aircrack-ng/ChangeLog | 11 ++- .../aircrack-ng/aircrack-ng-1.0_rc2-r1.ebuild | 68 +++++++++++++ .../aircrack-ng/aircrack-ng-1.0_rc2.ebuild | 49 ---------- .../files/aircrack-ng-1.0_rc2-freebsd.patch | 108 +++++++++++++++++++++ 4 files changed, 186 insertions(+), 50 deletions(-) create mode 100644 net-wireless/aircrack-ng/aircrack-ng-1.0_rc2-r1.ebuild delete mode 100644 net-wireless/aircrack-ng/aircrack-ng-1.0_rc2.ebuild create mode 100644 net-wireless/aircrack-ng/files/aircrack-ng-1.0_rc2-freebsd.patch (limited to 'net-wireless/aircrack-ng') diff --git a/net-wireless/aircrack-ng/ChangeLog b/net-wireless/aircrack-ng/ChangeLog index 9944a86694cc..1ed8797337d8 100644 --- a/net-wireless/aircrack-ng/ChangeLog +++ b/net-wireless/aircrack-ng/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for net-wireless/aircrack-ng # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/aircrack-ng/ChangeLog,v 1.37 2009/03/01 16:57:50 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-wireless/aircrack-ng/ChangeLog,v 1.38 2009/03/12 17:59:10 rbu Exp $ + +*aircrack-ng-1.0_rc2-r1 (12 Mar 2009) + + 12 Mar 2009; Robert Buchholz + +files/aircrack-ng-1.0_rc2-freebsd.patch, -aircrack-ng-1.0_rc2.ebuild, + +aircrack-ng-1.0_rc2-r1.ebuild: + Reintroduce iw as a dep on Linux that got dropped in the bump (bug # 260177), + Improve support for current FreeBSD (bug #253803): applied some patches and + remove airmon-ng application. *aircrack-ng-1.0_rc2 (01 Mar 2009) diff --git a/net-wireless/aircrack-ng/aircrack-ng-1.0_rc2-r1.ebuild b/net-wireless/aircrack-ng/aircrack-ng-1.0_rc2-r1.ebuild new file mode 100644 index 000000000000..ac030802e2f0 --- /dev/null +++ b/net-wireless/aircrack-ng/aircrack-ng-1.0_rc2-r1.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-wireless/aircrack-ng/aircrack-ng-1.0_rc2-r1.ebuild,v 1.1 2009/03/12 17:59:10 rbu Exp $ + +EAPI=2 +inherit versionator eutils toolchain-funcs + +MY_PV=$(replace_version_separator 2 '-') + +DESCRIPTION="WLAN tools for breaking 802.11 WEP/WPA keys" +HOMEPAGE="http://www.aircrack-ng.org" +SRC_URI="http://download.aircrack-ng.org/${PN}-${MY_PV}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+sqlite kernel_linux kernel_FreeBSD" + +DEPEND="dev-libs/openssl + sqlite? ( >=dev-db/sqlite-3.4 )" +RDEPEND="${DEPEND} + kernel_linux? ( net-wireless/iw )" + +S="${WORKDIR}/${PN}-${MY_PV}" + +have_sqlite() { + use sqlite && echo "true" || echo "false" +} + +src_prepare() { + epatch "${FILESDIR}/sha-compile-fix-64bit.patch" + if use kernel_FreeBSD ; then + epatch "${FILESDIR}/${P}-freebsd.patch" + sed -i -e "s:^\(SCRIPTS.*\)airmon-ng:\1:g" Makefile + sed -i -e "s:airmon-ng.1::g" manpages/Makefile + fi +} + +src_compile() { + emake CC="$(tc-getCC)" LD="$(tc-getLD)" sqlite=$(have_sqlite) || die "emake failed" +} + +src_install() { + emake \ + prefix="/usr" \ + mandir="/usr/share/man/man1" \ + DESTDIR="${D}" \ + sqlite=$(have_sqlite) \ + install \ + || die "emake install failed" + + dodoc AUTHORS ChangeLog README +} + +pkg_postinst() { + # Message is (c) FreeBSD + # http://www.freebsd.org/cgi/cvsweb.cgi/ports/net-mgmt/aircrack-ng/files/pkg-message.in?rev=1.5 + if use kernel_FreeBSD ; then + einfo "Contrary to Linux, it is not necessary to use airmon-ng to enable the monitor" + einfo "mode of your wireless card. So do not care about what the manpages say about" + einfo "airmon-ng, airodump-ng sets monitor mode automatically." + echo + einfo "To return from monitor mode, issue the following command:" + einfo " ifconfig \${INTERFACE} -mediaopt monitor" + einfo + einfo "For aireplay-ng you need FreeBSD >= 7.0." + fi +} diff --git a/net-wireless/aircrack-ng/aircrack-ng-1.0_rc2.ebuild b/net-wireless/aircrack-ng/aircrack-ng-1.0_rc2.ebuild deleted file mode 100644 index d1fe1b3204b9..000000000000 --- a/net-wireless/aircrack-ng/aircrack-ng-1.0_rc2.ebuild +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/aircrack-ng/aircrack-ng-1.0_rc2.ebuild,v 1.1 2009/03/01 16:57:50 patrick Exp $ - -EAPI=1 -inherit versionator eutils toolchain-funcs - -MY_PV=$(replace_version_separator 2 '-') - -DESCRIPTION="WLAN tools for breaking 802.11 WEP/WPA keys" -HOMEPAGE="http://www.aircrack-ng.org" -SRC_URI="http://download.aircrack-ng.org/${PN}-${MY_PV}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="+sqlite" - -DEPEND="dev-libs/openssl - sqlite? ( >=dev-db/sqlite-3.4 )" -RDEPEND="${DEPEND}" - -S="${WORKDIR}/${PN}-${MY_PV}" - -have_sqlite() { - use sqlite && echo "true" || echo "false" -} - -src_unpack() { - unpack ${A} - cd "${S}" - epatch "${FILESDIR}/sha-compile-fix-64bit.patch" -} - -src_compile() { - emake CC="$(tc-getCC)" LD="$(tc-getLD)" sqlite=$(have_sqlite) || die "emake failed" -} - -src_install() { - emake \ - prefix="/usr" \ - mandir="/usr/share/man/man1" \ - DESTDIR="${D}" \ - sqlite=$(have_sqlite) \ - install \ - || die "emake install failed" - - dodoc AUTHORS ChangeLog README -} diff --git a/net-wireless/aircrack-ng/files/aircrack-ng-1.0_rc2-freebsd.patch b/net-wireless/aircrack-ng/files/aircrack-ng-1.0_rc2-freebsd.patch new file mode 100644 index 000000000000..e3e0ebabd7bf --- /dev/null +++ b/net-wireless/aircrack-ng/files/aircrack-ng-1.0_rc2-freebsd.patch @@ -0,0 +1,108 @@ +http://www.freebsd.org/cgi/cvsweb.cgi/ports/net-mgmt/aircrack-ng/files/patch-src_airserv-ng.c?rev=1.1 +--- src/airserv-ng.c.orig 2008-06-10 02:55:09.000000000 +0700 ++++ src/airserv-ng.c 2008-08-11 13:39:46.000000000 +0700 +@@ -37,6 +37,15 @@ + + #ifdef __MACH__ + #include ++#elif defined(__FreeBSD__) ++#include ++#if BYTE_ORDER == BIG_ENDIAN ++# define __cpu_to_be32(x) (x) ++# define __cpu_to_be64(x) (x) ++#elif BYTE_ORDER == LITTLE_ENDIAN ++# define __cpu_to_be32(x) __bswap32(x) ++# define __cpu_to_be64(x) __bswap64(x) ++#endif + #else + #include + #endif /* __MACH__ */ + + +http://www.freebsd.org/cgi/cvsweb.cgi/ports/net-mgmt/aircrack-ng/files/patch-src_osdep_network.c?rev=1.1 +--- src/osdep/network.c.orig 2008-06-10 02:55:09.000000000 +0700 ++++ src/osdep/network.c 2008-08-11 13:29:42.000000000 +0700 +@@ -32,6 +32,15 @@ + + #ifdef __MACH__ + #include ++#elif defined(__FreeBSD__) ++#include ++#if BYTE_ORDER == BIG_ENDIAN ++# define __be32_to_cpu(x) (x) ++# define __be64_to_cpu(x) (x) ++#elif BYTE_ORDER == LITTLE_ENDIAN ++# define __be32_to_cpu(x) __bswap32(x) ++# define __be64_to_cpu(x) __bswap64(x) ++#endif + #elif defined (__sun) && defined (__sparc) /* Solaris SPARC, not Solaris x86 */ + #include + #else + + +http://www.freebsd.org/cgi/cvsweb.cgi/ports/net-mgmt/aircrack-ng/files/patch-src_osdep_freebsd.c?rev=1.1 +--- src/osdep/freebsd.c.orig 2008-06-10 02:55:09.000000000 +0700 ++++ src/osdep/freebsd.c 2008-08-11 20:01:53.000000000 +0700 +@@ -53,7 +53,9 @@ + unsigned char pf_buf[4096]; + unsigned char *pf_next; + int pf_totlen; ++#if __FreeBSD_version > 700018 + struct ieee80211_bpf_params pf_txparams; ++#endif + + /* setchan */ + int pf_s; +@@ -280,13 +282,16 @@ + static int fbsd_write(struct wif *wi, unsigned char *h80211, int len, + struct tx_info *ti) + { ++#if __FreeBSD_version > 700018 + struct iovec iov[2]; ++#endif + struct priv_fbsd *pf = wi_priv(wi); + int rc; + + /* XXX make use of ti */ + if (ti) {} + ++#if __FreeBSD_version > 700018 + iov[0].iov_base = &pf->pf_txparams; + iov[0].iov_len = pf->pf_txparams.ibp_len; + +@@ -294,12 +299,19 @@ + iov[1].iov_len = len; + + rc = writev(pf->pf_fd, iov, 2); ++#else ++ rc = write(pf->pf_fd, h80211, len); ++#endif + if (rc == -1) + return rc; ++#if __FreeBSD_version > 700018 + if (rc < (int) iov[0].iov_len) + return 0; + + return rc - iov[0].iov_len; ++#else ++ return 0; ++#endif + } + + static int fbsd_set_channel(struct wif *wi, int chan) +@@ -542,6 +554,7 @@ + /* setup private state */ + pf = wi_priv(wi); + pf->pf_fd = fd; ++#if __FreeBSD_version > 700018 + pf->pf_txparams.ibp_vers = IEEE80211_BPF_VERSION; + pf->pf_txparams.ibp_len = sizeof(struct ieee80211_bpf_params) - 6; + pf->pf_txparams.ibp_rate1 = 2; /* 1 MB/s XXX */ +@@ -549,6 +562,7 @@ + pf->pf_txparams.ibp_flags = IEEE80211_BPF_NOACK; + pf->pf_txparams.ibp_power = 100; /* nominal max */ + pf->pf_txparams.ibp_pri = WME_AC_VO; /* high priority */ ++#endif + + return wi; + } -- cgit v1.2.3-65-gdbad