use target optimization flags, Makefile cleanup
[openwrt/svn-archive/archive.git] / libs / radiusclient-ng / 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:=radiusclient-ng
12 PKG_VERSION:=0.5.2
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://download.berlios.de/radiusclient-ng/
18 PKG_MD5SUM:=c54eb70e964bdd22dd44b39a9b4df8ca
19 PKG_CAT:=zcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libradiusclient-ng
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=A RADIUS client library
29 DESCRIPTION:=A RADIUS client library.\\\
30 Purpose of this project is to build a portable, easy-to-use and standard \\\
31 compliant library suitable for developing free and commercial software \\\
32 that need support for RADIUS protocol (RFCs 2128 and 2139).\\\
33 \\\
34 This package contains shared libraries, needed by other programs.
35 URL:=http://developer.berlios.de/projects/radiusclient-ng/
36 endef
37
38 define Package/libradiusclient-ng/conffiles
39 /etc/radiusclient-ng/issue
40 /etc/radiusclient-ng/port-id-map
41 /etc/radiusclient-ng/radiusclient.conf
42 /etc/radiusclient-ng/servers
43 endef
44
45 define Package/radiusclient-ng
46 SECTION:=net
47 CATEGORY:=Network
48 DEPENDS:=+libradiusclient-ng
49 TITLE:=A RADIUS client
50 DESCRIPTION:=A RADIUS client.\\\
51 Purpose of this project is to build a portable, easy-to-use and standard \\\
52 compliant library suitable for developing free and commercial software \\\
53 that need support for RADIUS protocol (RFCs 2128 and 2139).\\\
54 \\\
55 This package contains a RADIUS client.
56 URL:=http://www.balabit.com/products/syslog_ng/
57 endef
58
59 define Build/Configure
60 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
61 $(TARGET_CONFIGURE_OPTS) \
62 CFLAGS="$(TARGET_CFLAGS)" \
63 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
64 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
65 ./configure \
66 --target=$(GNU_TARGET_NAME) \
67 --host=$(GNU_TARGET_NAME) \
68 --build=$(GNU_HOST_NAME) \
69 --program-prefix="" \
70 --program-suffix="" \
71 --prefix=/usr \
72 --exec-prefix=/usr \
73 --bindir=/usr/bin \
74 --datadir=/usr/share \
75 --includedir=/usr/include \
76 --infodir=/usr/share/info \
77 --libdir=/usr/lib \
78 --libexecdir=/usr/lib \
79 --localstatedir=/var \
80 --mandir=/usr/share/man \
81 --sbindir=/usr/sbin \
82 --sysconfdir=/etc \
83 $(DISABLE_LARGEFILE) \
84 $(DISABLE_NLS) \
85 --enable-shared \
86 --enable-static \
87 --disable-rpath \
88 --with-gnu-ld \
89 );
90 endef
91
92 define Build/Compile
93 rm -rf $(PKG_INSTALL_DIR)
94 mkdir -p $(PKG_INSTALL_DIR)
95 $(MAKE) -C $(PKG_BUILD_DIR) \
96 DESTDIR="$(PKG_INSTALL_DIR)" \
97 all install
98 endef
99
100 define Package/libradiusclient-ng/install
101 install -d -m0755 $(1)/etc
102 $(CP) $(PKG_INSTALL_DIR)/etc/radiusclient-ng $(1)/etc/
103 install -d -m0755 $(1)/usr/lib
104 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libradiusclient-ng.so.* $(1)/usr/lib/
105 endef
106
107 define Package/radiusclient-ng/install
108 install -d -m0755 $(1)/usr/sbin
109 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/rad{acct,iusclient,login,status} $(1)/usr/sbin/
110 endef
111
112 define Build/InstallDev
113 mkdir -p $(STAGING_DIR)/usr/include
114 $(CP) $(PKG_INSTALL_DIR)/usr/include/radiusclient-ng.h $(STAGING_DIR)/usr/include/
115 mkdir -p $(STAGING_DIR)/usr/lib/
116 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libradiusclient-ng.{a,so}* $(STAGING_DIR)/usr/lib/
117 endef
118
119 define Build/UninstallDev
120 rm -rf \
121 $(STAGING_DIR)/usr/include/radiusclient-ng.h \
122 $(STAGING_DIR)/usr/lib/libradiusclient-ng.{a,so}*
123 endef
124
125 $(eval $(call BuildPackage,libradiusclient-ng))
126 $(eval $(call BuildPackage,radiusclient-ng))