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