[packages] Various Makefile cleanups.
[packages.git] / net / airpwn / Makefile
1 #
2 # Copyright (C) 2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=airpwn
11 PKG_RELEASE:=1
12 PKG_VERSION:=1.3
13 PKG_SOURCE:=airpwn-$(PKG_VERSION).tgz
14 PKG_SOURCE_URL:=@SF/airpwn
15 PKG_BUILD_DEPENDS:=libnet1 libopenssl libpcap libpcre
16
17 PKG_FIXUP = libtool
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/airpwn
22         SECTION:=net
23         CATEGORY:=Network
24         TITLE:=Packet injection pwnage
25         DEPENDS:=+libnet1 +libopenssl +libpcap +libpcre
26         URL:=http://airpwn.sourceforge.net/Airpwn.html
27 endef
28
29 define Package/airpwn/description
30   Airpwn is a framework for 802.11 (wireless) packet injection.
31   Airpwn listens to incoming wireless packets, and if the data
32   matches a pattern specified in the config files, custom content
33   is injected "spoofed" from the wireless access point. From the
34   perspective of the wireless client, airpwn becomes the server.
35 endef
36
37 CONFIGURE_VARS:= \
38         CC="$(TARGET_CC)" \
39         LD="$(TARGET_LD)" \
40         CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/lib/libnet-1.1.x/include -I$(STAGING_DIR)/usr/include -I$(PKG_BUILD_DIR)/lorcon" \
41         LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib/libnet-1.1.x/lib -L$(PKG_BUILD_DIR)/lorcon/.libs -lcrypto -lssl" \
42         LIBTOOL="$(STAGING_DIR)/host/bin/libtool"
43
44 define Build/Configure
45         ( cd $(PKG_BUILD_DIR); tar -xzf lorcon-current.tgz; cd lorcon; \
46         $(CONFIGURE_VARS) ./configure $(CONFIGURE_ARGS); \
47         $(MAKE) -C $(PKG_BUILD_DIR)/lorcon $(CONFIGURE_VARS); cd ..; \
48         $(CONFIGURE_VARS) ./configure $(CONFIGURE_ARGS) )
49 endef
50
51 define Build/Compile
52         $(MAKE) -C $(PKG_BUILD_DIR) $(CONFIGURE_VARS)
53 endef
54
55 define Package/airpwn/install
56         $(INSTALL_DIR) $(1)/etc/airpwn
57         $(INSTALL_DATA) $(PKG_BUILD_DIR)/conf/* $(1)/etc/airpwn/
58         $(INSTALL_DIR) $(1)/usr/bin
59         $(INSTALL_BIN) $(PKG_BUILD_DIR)/airpwn $(1)/usr/bin/
60         $(INSTALL_DIR) $(1)/usr/lib
61         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lorcon/.libs/liborcon-1.0.0.so $(1)/usr/lib/
62         ( cd $(1)/usr/lib; ln -s liborcon-1.0.0.so liborcon.so )
63 endef
64
65 $(eval $(call BuildPackage,airpwn))