54e8a0954d20b08d74084be604f3a38f617ff492
[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 # $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:=http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/distfiles/
17 PKG_MD5SUM:=3b27365772d918050b2251d98a9c7c82
18
19 PKG_BUILD_DEPENDS:=libncurses libpcre libreadline
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/atftp/Default
24 SECTION:=net
25 CATEGORY:=Network
26 TITLE:=TFTP
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) \
57 -Wall -D_REENTRANT" \
58 all
59
60 define Package/atftp/install
61 $(INSTALL_DIR) $(1)/usr/sbin
62 $(INSTALL_BIN) $(PKG_BUILD_DIR)/atftp $(1)/usr/sbin/
63 endef
64
65 define Package/atftpd/install
66 $(INSTALL_DIR) $(1)/etc
67 $(INSTALL_DIR) $(1)/usr/sbin
68 $(INSTALL_BIN) $(PKG_BUILD_DIR)/atftpd $(1)/usr/sbin/
69 endef
70
71 $(eval $(call BuildPackage,atftp))
72 $(eval $(call BuildPackage,atftpd))