atftp: fix picking the right argz.h header file on eglibc
[packages.git] / net / atftp / 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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=atftp
11 PKG_VERSION:=0.7
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/distfiles/
16 PKG_MD5SUM:=3b27365772d918050b2251d98a9c7c82
17
18 PKG_BUILD_DEPENDS:=libncurses libpcre libreadline
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/atftp/Default
23   SECTION:=net
24   CATEGORY:=Network
25   TITLE:=TFTP
26   SUBMENU:=File Transfer
27 endef
28
29 define Package/atftp
30   $(call Package/atftp/Default)
31   DEPENDS:=+libreadline +libncurses
32   TITLE+= client
33 endef
34
35 define Package/atftpd
36   $(call Package/atftp/Default)
37   DEPENDS:=+libpcre +libpthread
38   TITLE+= server
39 endef
40
41 CONFIGURE_ARGS += \
42         --disable-libwrap
43
44 ifdef CONFIG_USE_EGLIBC
45   TARGET_CFLAGS += -DHAVE_ARGZ=1
46
47   define Build/Prepare
48         $(Build/Prepare/Default)
49         echo '#include_next <argz.h>' > $(PKG_BUILD_DIR)/argz.h
50   endef
51 endif
52
53 MAKE_FLAGS += \
54         CFLAGS="$(TARGET_CFLAGS) -Wall -D_REENTRANT" \
55         all
56
57 define Package/atftp/install
58         $(INSTALL_DIR) $(1)/usr/sbin
59         $(INSTALL_BIN) $(PKG_BUILD_DIR)/atftp $(1)/usr/sbin/
60 endef
61
62 define Package/atftpd/install
63         $(INSTALL_DIR) $(1)/etc
64         $(INSTALL_DIR) $(1)/usr/sbin
65         $(INSTALL_BIN) $(PKG_BUILD_DIR)/atftpd $(1)/usr/sbin/
66 endef
67
68 $(eval $(call BuildPackage,atftp))
69 $(eval $(call BuildPackage,atftpd))