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