cosmetic change: rename PKG_BUILDDEP to PKG_BUILD_DEPENDS
[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 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=atftp
12 PKG_VERSION:=0.7
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=ftp://ftp.mamalinux.com/pub/atftp/
17 PKG_MD5SUM:=3b27365772d918050b2251d98a9c7c82
18 PKG_CAT:=zcat
19 TAR_OPTIONS += || true
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22
23 PKG_BUILD_DEPENDS:=libncurses libpcre libreadline
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/atftp/Default
28   SECTION:=net
29   CATEGORY:=Network
30   TITLE:=TFTP
31   URL:=ftp://ftp.mamalinux.com/pub/atftp/
32 endef
33
34 define Package/atftp
35   $(call Package/atftp/Default)
36   DEPENDS:=+libreadline +libncurses
37   TITLE+= client
38 endef
39
40 define Package/atftpd
41   $(call Package/atftp/Default)
42   DEPENDS:=+libpcre +libpthread
43   TITLE+= server
44 endef
45
46 define Package/atftpd/postinst
47 #!/bin/sh
48 grep -q '^tftp[[:space:]]*69/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
49 if [ $$? -ne 0 ]; then
50         echo "tftp            69/tcp" >>$${IPKG_INSTROOT}/etc/services
51         echo "tftp            69/udp" >>$${IPKG_INSTROOT}/etc/services
52         echo "tftp-mcast    1758/tcp" >>$${IPKG_INSTROOT}/etc/services
53         echo "tftp-mcast    1758/udp" >>$${IPKG_INSTROOT}/etc/services
54 fi
55 endef
56
57 define Build/Configure
58         $(call Build/Configure/Default, \
59                 --disable-libwrap \
60         )
61 endef
62
63 define Build/Compile
64         $(MAKE) -C $(PKG_BUILD_DIR) \
65                 $(TARGET_CONFIGURE_OPTS) \
66                 CFLAGS="$(TARGET_CFLAGS) -Wall -D_REENTRANT" \
67                 all
68 endef
69
70 define Package/atftp/install
71         $(INSTALL_DIR) $(1)/usr/sbin
72         $(INSTALL_BIN) $(PKG_BUILD_DIR)/atftp $(1)/usr/sbin/
73 endef
74
75 define Package/atftpd/install
76         $(INSTALL_DIR) $(1)/usr/sbin
77         $(INSTALL_BIN) $(PKG_BUILD_DIR)/atftpd $(1)/usr/sbin/
78 endef
79
80 $(eval $(call BuildPackage,atftp))
81 $(eval $(call BuildPackage,atftpd))