By default OpenWRT's /var is a symlink to /tmp.
[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
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/knock/Default
22 SECTION:=net
23 CATEGORY:=Network
24 DEPENDS:=+libpcap
25 TITLE:=Port-knocking
26 URL:=http://www.zeroflux.org/cgi-bin/cvstrac/knock/wiki
27 endef
28
29 define Package/knock
30 $(call Package/knock/Default)
31 TITLE+= client
32 endef
33
34 define Package/knock/description
35 =
36 It listens to all traffic on an ethernet (or PPP) interface,
37 looking for special "knock" sequences of port-hits. A client
38 makes these port-hits by sending a TCP (or UDP) packet to a
39 port on the server. This port need not be open -- since
40 knockd listens at the link-layer level, it sees all traffic
41 even if it's destined for a closed port. When the server
42 detects a specific sequence of port-hits, it runs a command
43 defined in its configuration file. This can be used to open
44 up holes in a firewall for quick access.
45 This package contains the port-knocking client.
46 endef
47
48 define Package/knockd
49 $(call Package/knock/Default)
50 TITLE+= server
51 endef
52
53 define Package/knockd/description
54 =
55 It listens to all traffic on an ethernet (or PPP) interface,
56 looking for special "knock" sequences of port-hits. A client
57 makes these port-hits by sending a TCP (or UDP) packet to a
58 port on the server. This port need not be open -- since
59 knockd listens at the link-layer level, it sees all traffic
60 even if it's destined for a closed port. When the server
61 detects a specific sequence of port-hits, it runs a command
62 defined in its configuration file. This can be used to open
63 up holes in a firewall for quick access.
64 This package contains the port-knocking server.
65 endef
66
67 define Package/knockd/conffiles
68 /etc/knockd.conf
69 endef
70
71 define Build/Configure
72 $(call Build/Configure/Default, \
73 , \
74 CFLAGS="$$$$CFLAGS $$$$CPPFLAGS" \
75 ac_cv_lib_pcap_pcap_open_live=yes \
76 )
77 endef
78
79 define Build/Compile
80 $(MAKE) -C $(PKG_BUILD_DIR) \
81 DESTDIR="$(PKG_INSTALL_DIR)" \
82 all install
83 endef
84
85 define Package/knock/install
86 $(INSTALL_DIR) $(1)/usr/bin
87 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knock $(1)/usr/bin/
88 endef
89
90 define Package/knockd/install
91 $(INSTALL_DIR) $(1)/etc
92 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/knockd.conf $(1)/etc/
93 $(INSTALL_DIR) $(1)/usr/sbin
94 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knockd $(1)/usr/sbin/
95 endef
96
97 $(eval $(call BuildPackage,knock))
98 $(eval $(call BuildPackage,knockd))