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