ignore tar errors in atftp
[openwrt/svn-archive/archive.git] / net / atftp / Makefile
1 # Copyright (C) 2006 OpenWrt.org
2 #
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
5 #
6 # $Id$
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=atftp
11 PKG_VERSION:=0.7
12 PKG_RELEASE:=1
13 PKG_MD5SUM:=3b27365772d918050b2251d98a9c7c82
14
15 PKG_SOURCE_URL:=ftp://ftp.mamalinux.com/pub/atftp/
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_CAT:=zcat
18 TAR_OPTIONS += || true
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/atftp
26 SECTION:=net
27 CATEGORY:=Network
28 DEPENDS:=+libreadline +libpcre
29 MENU:=1
30 TITLE:=TFTP client
31 DESCRIPTION:=TFTP client
32 URL:=ftp://ftp.mamalinux.com/pub/atftp/
33 endef
34
35 define Package/atftpd
36 SECTION:=net
37 CATEGORY:=Network
38 DEPENDS:=atftp +libreadline +libpcre
39 TITLE:=TFTP server
40 DESCRIPTION:=TFTP server
41 URL:=ftp://ftp.mamalinux.com/pub/atftp/
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 define Build/Compile
56 rm -rf $(PKG_INSTALL_DIR)
57 mkdir -p $(PKG_INSTALL_DIR)
58 $(MAKE) -C $(PKG_BUILD_DIR) \
59 $(TARGET_CONFIGURE_OPTS) \
60 CFLAGS="$(TARGET_CFLAGS) -Wall -D_REENTRANT" \
61 DESTDIR=$(PKG_INSTALL_DIR) \
62 all install
63 endef
64
65 define Package/atftp/install
66 install -m0755 -d $(1)/usr/sbin
67 $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin
68 endef
69
70 define Package/atftpd/install
71 install -m0755 -d $(1)/usr/sbin
72 $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
73 endef
74
75 $(eval $(call BuildPackage,atftp))
76 $(eval $(call BuildPackage,atftpd))