OpenWrt Forum Archive

Topic: Aircrack-ng 1.0beta2 Makefile & Cross Compilation for Fonera

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,
I just created a Makefile for Aircrack-ng 1.0beta2. It still has some hard coded paths in there as I'm in a bit of a hurry, but I wanted to share those:

#
# Copyright (C) 2006 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id: Makefile 9695 2007-12-09 18:59:01Z nbd $

include $(TOPDIR)/rules.mk

#http://download.aircrack-ng.org/aircrack-ng-1.0-beta2.tar.gz
PKG_NAME:=aircrack-ng
PKG_VERSION:=1.0-beta2
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://download.aircrack-ng.org/
PKG_MD5SUM:=66017aad4f23153419fdb04c83e65aaf

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install

include $(INCLUDE_DIR)/package.mk

define Package/aircrack-ng
  SECTION:=net
  CATEGORY:=Network
  DEPENDS:=+libpthread +libopenssl +libpcap
  TITLE:=next generation of aircrack with new features
  URL:=http://www.aircrack-ng.org/
  SUBMENU:=wireless
endef

define Package/aircrack-ng/description
Aircrack-ng is the next generation of aircrack with new features
endef

define Build/Configure
endef

define Build/Compile
   rm -rf $(PKG_INSTALL_DIR)
   mkdir -p $(PKG_INSTALL_DIR)
   $(MAKE) -C $(PKG_BUILD_DIR) \
      $(TARGET_CONFIGURE_OPTS) \
      CFLAGS="$(TARGET_CFLAGS) -Wall -I/home/hagen/fonera/trunk/staging_dir/mips/usr/include -I/home/hagen/fonera/trunk/build_dir/mips/aircrack-ng-1.0-beta2/src/include -D_REVISION=1" \
      prefix="/usr" \
      CPPFLAGS="$(TARGET_CPPFLAGS)  -I$(STAGING_DIR)/usr/include/ -I/home/hagen/fonera/trunk/build_dir/mips/aircrack-ng-1.0-beta2/src/include -D_REVISION=1" \
      LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
      CLAGS="$(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/" \
      destdir="$(PKG_INSTALL_DIR)" \
      DESTDIR="$(PKG_INSTALL_DIR)" \
      all install
endef

define Package/aircrack-ng/install
   $(INSTALL_DIR) $(1)/usr/bin
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aircrack-ng $(1)/usr/bin/
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/airdecap-ng $(1)/usr/bin/
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/packetforge-ng $(1)/usr/bin/
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ivstools $(1)/usr/bin/
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/makeivs-ng $(1)/usr/bin/   
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ivstools $(1)/usr/bin/
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kstats $(1)/usr/bin/
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/buddy-ng $(1)/usr/bin/
   $(INSTALL_DIR) $(1)/usr/sbin
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/aireplay-ng $(1)/usr/sbin/
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/wesside-ng $(1)/usr/sbin/
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/airserv-ng $(1)/usr/sbin/
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/airtun-ng $(1)/usr/sbin/
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/easside-ng $(1)/usr/sbin/
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/airodump-ng $(1)/usr/sbin/
   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/airmon-ng $(1)/usr/sbin/
endef

$(eval $(call BuildPackage,aircrack-ng))

You can see a discussion about that build and the IPKG package here:
http://fonerahacks.com/forums/viewtopic.php?t=82
You have to change the paths beginning with /home/hagen accordingly.

(Last edited by unbehagen on 1 Apr 2008, 12:35)

Here is a cleaner version, with some Big-Endian fixes that checks out from SVN and does not hardcode paths:

https://dev.openwrt.org/ticket/3298

The discussion might have continued from here.