replace lots of manual install commands with INSTALL_* variables
[openwrt/svn-archive/archive.git] / net / knock / 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:=knock
12 PKG_VERSION:=0.5
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.zeroflux.org/knock/files/
17 PKG_MD5SUM:=ca09d61458974cff90a700aba6120891
18 PKG_CAT:=zcat
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/knock/Default
26 SECTION:=net
27 CATEGORY:=Network
28 DEPENDS:=+libpcap
29 TITLE:=Port-knocking
30 DESCRIPTION:=\
31 It listens to all traffic on an ethernet (or PPP) interface, \\\
32 looking for special "knock" sequences of port-hits. A client \\\
33 makes these port-hits by sending a TCP (or UDP) packet to a \\\
34 port on the server. This port need not be open -- since \\\
35 knockd listens at the link-layer level, it sees all traffic \\\
36 even if it's destined for a closed port. When the server \\\
37 detects a specific sequence of port-hits, it runs a command \\\
38 defined in its configuration file. This can be used to open \\\
39 up holes in a firewall for quick access.
40 URL:=http://www.zeroflux.org/cgi-bin/cvstrac/knock/wiki
41 endef
42
43 define Package/knock
44 $(call Package/knock/Default)
45 TITLE+= client
46 DESCRIPTION+=\\\
47 \\\
48 This package contains the port-knocking client.
49 endef
50
51 define Package/knockd
52 $(call Package/knock/Default)
53 TITLE+= server
54 DESCRIPTION+=\\\
55 \\\
56 This package contains the port-knocking server.
57 endef
58
59 define Package/knockd/conffiles
60 /etc/knockd.conf
61 endef
62
63 define Build/Configure
64 $(call Build/Configure/Default, \
65 , \
66 CFLAGS="$$$$CFLAGS $$$$CPPFLAGS" \
67 ac_cv_lib_pcap_pcap_open_live=yes \
68 )
69 endef
70
71 define Build/Compile
72 $(MAKE) -C $(PKG_BUILD_DIR) \
73 DESTDIR="$(PKG_INSTALL_DIR)" \
74 all install
75 endef
76
77 define Package/knock/install
78 $(INSTALL_DIR) $(1)/usr/bin
79 $(CP) $(PKG_INSTALL_DIR)/usr/bin/knock $(1)/usr/bin/
80 endef
81
82 define Package/kockd/install
83 $(INSTALL_DIR) $(1)/etc
84 install -m0600 $(PKG_INSTALL_DIR)/etc/knockd.conf $(1)/etc/
85 $(INSTALL_DIR) $(1)/usr/sbin
86 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/knockd $(1)/usr/sbin/
87 endef
88
89 $(eval $(call BuildPackage,knock))
90 $(eval $(call BuildPackage,knockd))