misc cosmetic fixes:
[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:=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 include $(INCLUDE_DIR)/package.mk
24
25 define Package/atftp/Default
26 SECTION:=net
27 CATEGORY:=Network
28 TITLE:=TFTP
29 URL:=ftp://ftp.mamalinux.com/pub/atftp/
30 endef
31
32 define Package/atftp
33 $(call Package/atftp/Default)
34 DEPENDS:=+libreadline +libpcre +libncurses
35 TITLE+= client
36 endef
37
38 define Package/atftpd
39 $(call Package/atftp/Default)
40 DEPENDS:=+libreadline +libpcre +libpthread
41 TITLE+= server
42 endef
43
44 define Package/atftpd/postinst
45 #!/bin/sh
46 grep -q '^tftp[[:space:]]*69/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
47 if [ $$? -ne 0 ]; then
48 echo "tftp 69/tcp" >>$${IPKG_INSTROOT}/etc/services
49 echo "tftp 69/udp" >>$${IPKG_INSTROOT}/etc/services
50 echo "tftp-mcast 1758/tcp" >>$${IPKG_INSTROOT}/etc/services
51 echo "tftp-mcast 1758/udp" >>$${IPKG_INSTROOT}/etc/services
52 fi
53 endef
54
55 # uses GNU configure
56
57 define Build/Compile
58 $(MAKE) -C $(PKG_BUILD_DIR) \
59 $(TARGET_CONFIGURE_OPTS) \
60 CFLAGS="$(TARGET_CFLAGS) -Wall -D_REENTRANT" \
61 all
62 endef
63
64 define Package/atftp/install
65 $(INSTALL_DIR) $(1)/usr/sbin
66 $(INSTALL_BIN) $(PKG_BUILD_DIR)/atftp $(1)/usr/sbin/
67 endef
68
69 define Package/atftpd/install
70 $(INSTALL_DIR) $(1)/usr/sbin
71 $(INSTALL_BIN) $(PKG_BUILD_DIR)/atftpd $(1)/usr/sbin/
72 endef
73
74 $(eval $(call BuildPackage,atftp))
75 $(eval $(call BuildPackage,atftpd))