Port xsupplicant to -ng
[packages.git] / net / xsupplicant / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=xsupplicant
12 PKG_VERSION:=1.2.3
13 PKG_RELEASE:=1
14 PKG_MD5SUM:=c9b17b2e1879bac85c583980338fed85
15
16 PKG_SOURCE_URL:=@SF/open1x
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/xsupplicant
26   SECTION:=net
27   CATEGORY:=Network
28   DEPENDS:=+libopenssl +wireless-tools
29   TITLE:=A fully compliant 802.1x authenticator
30   DESCRIPTION:=This software allows a GNU/Linux or BSD workstation to authenticate with\\\
31         a RADIUS server using 802.1x and various EAP protocols.\\\
32   URL:=http://open1x.sourceforge.net/
33 endef
34
35 define Package/xsupplicant/conffiles
36 /etc/xsupplicant.conf
37 endef
38
39 define Build/Configure  
40         (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
41                 touch configure.in; \
42                 touch aclocal.m4; \
43                 touch Makefile.in; \
44                 touch configure; \
45                 $(TARGET_CONFIGURE_OPTS) \
46                 CFLAGS="$(TARGET_CFLAGS)" \
47                 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include \
48                         -I$(PKG_BUILD_DIR)/lib/libxsupconfig/ \
49                         -I$(STAGING_DIR)/usr/include/madwifi" \
50                 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
51                 ./configure \
52                         --target=$(GNU_TARGET_NAME) \
53                         --host=$(GNU_TARGET_NAME) \
54                         --build=$(GNU_HOST_NAME) \
55                         --program-prefix="" \
56                         --program-suffix="" \
57                         --prefix=/usr \
58                         --exec-prefix=/usr \
59                         --bindir=/usr/bin \
60                         --datadir=/usr/share \
61                         --includedir=/usr/include \
62                         --infodir=/usr/share/info \
63                         --libdir=/usr/lib \
64                         --libexecdir=/usr/lib \
65                         --localstatedir=/var \
66                         --mandir=/usr/share/man \
67                         --sbindir=/usr/sbin \
68                         --sysconfdir=/etc \
69                         $(DISABLE_LARGEFILE) \
70                         $(DISABLE_NLS) \
71                         --with-openssl="$(STAGING_DIR)/usr" \
72                         --with-madwifi-path="$(STAGING_DIR)/usr/include/madwifi" \
73         );
74 endef
75
76 define Build/Compile    
77         rm -rf $(PKG_INSTALL_DIR)
78         mkdir -p $(PKG_INSTALL_DIR)
79         $(MAKE) -C $(PKG_BUILD_DIR) \
80                 DESTDIR=$(PKG_INSTALL_DIR) \
81                 all install
82 endef
83
84 define Package/xsupplicant/install      
85         install -d -m0755 $(1)/etc
86         install -m0644 $(PKG_BUILD_DIR)/etc/xsupplicant.conf $(1)/etc/
87         install -d -m0755 $(1)/usr/bin
88         $(CP) $(PKG_INSTALL_DIR)/usr/bin/xsup_* $(1)/usr/bin/
89         install -d -m0755 $(1)/usr/sbin
90         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/xsupplicant $(1)/usr/sbin/
91 endef
92
93 $(eval $(call BuildPackage,xsupplicant))