3fc6745fea2cdd9a0f131e73110a62a1fa385185
[openwrt/svn-archive/archive.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:=FTP
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 define Package/atftpd/postinst
42 #!/bin/sh
43 grep -q '^tftp[[:space:]]*69/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
44 if [ $$? -ne 0 ]; then
45 echo "tftp 69/tcp" >>$${IPKG_INSTROOT}/etc/services
46 echo "tftp 69/udp" >>$${IPKG_INSTROOT}/etc/services
47 echo "tftp-mcast 1758/tcp" >>$${IPKG_INSTROOT}/etc/services
48 echo "tftp-mcast 1758/udp" >>$${IPKG_INSTROOT}/etc/services
49 fi
50 endef
51
52 CONFIGURE_ARGS += \
53 --disable-libwrap
54
55 MAKE_FLAGS += \
56 CFLAGS="$(TARGET_CFLAGS) -Wall -D_REENTRANT" \
57 all
58
59 define Package/atftp/install
60 $(INSTALL_DIR) $(1)/usr/sbin
61 $(INSTALL_BIN) $(PKG_BUILD_DIR)/atftp $(1)/usr/sbin/
62 endef
63
64 define Package/atftpd/install
65 $(INSTALL_DIR) $(1)/etc
66 $(INSTALL_DIR) $(1)/usr/sbin
67 $(INSTALL_BIN) $(PKG_BUILD_DIR)/atftpd $(1)/usr/sbin/
68 endef
69
70 $(eval $(call BuildPackage,atftp))
71 $(eval $(call BuildPackage,atftpd))