Port knock to -ng
[openwrt/svn-archive/archive.git] / net / knock / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=knock
6 PKG_VERSION:=0.5
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=ca09d61458974cff90a700aba6120891
9
10 PKG_SOURCE_URL:=http://www.zeroflux.org/knock/files/
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_CAT:=zcat
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
16
17 include $(INCLUDE_DIR)/package.mk
18
19 define Package/knock
20 SECTION:=net
21 CATEGORY:=Network
22 DEPENDS:=+libpcap
23 TITLE:=A port-knocking client
24 DESCRIPTION:=It listens to all traffic on an ethernet (or PPP) interface,\\\
25 looking for special "knock" sequences of port-hits. A client\\\
26 makes these port-hits by sending a TCP (or UDP) packet to a\\\
27 port on the server. This port need not be open -- since\\\
28 knockd listens at the link-layer level, it sees all traffic\\\
29 even if it's destined for a closed port. When the server\\\
30 detects a specific sequence of port-hits, it runs a command\\\
31 defined in its configuration file. This can be used to open\\\
32 up holes in a firewall for quick access.\\\
33 URL:=http://www.zeroflux.org/cgi-bin/cvstrac/knock/wiki
34 endef
35
36 define Package/knockd
37 SECTION:=net
38 CATEGORY:=Network
39 DEPENDS:=+libpcap
40 TITLE:=A port-knocking server
41 DESCRIPTION:=It listens to all traffic on an ethernet (or PPP) interface,\\\
42 looking for special "knock" sequences of port-hits. A client\\\
43 makes these port-hits by sending a TCP (or UDP) packet to a\\\
44 port on the server. This port need not be open -- since\\\
45 knockd listens at the link-layer level, it sees all traffic\\\
46 even if it's destined for a closed port. When the server\\\
47 detects a specific sequence of port-hits, it runs a command\\\
48 defined in its configuration file. This can be used to open\\\
49 up holes in a firewall for quick access.\\\
50 URL:=http://www.zeroflux.org/cgi-bin/cvstrac/knock/wiki
51 endef
52
53 define Package/knockd/conffiles
54 /etc/knockd.conf
55 endef
56
57
58 define Build/Configure
59 (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
60 $(TARGET_CONFIGURE_OPTS) \
61 CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
62 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
63 ac_cv_lib_pcap_pcap_open_live=yes \
64 ./configure \
65 --target=$(GNU_TARGET_NAME) \
66 --host=$(GNU_TARGET_NAME) \
67 --build=$(GNU_HOST_NAME) \
68 --program-prefix="" \
69 --program-suffix="" \
70 --prefix=/usr \
71 --exec-prefix=/usr \
72 --bindir=/usr/bin \
73 --datadir=/usr/share \
74 --includedir=/usr/include \
75 --infodir=/usr/share/info \
76 --libdir=/usr/lib \
77 --libexecdir=/usr/lib \
78 --localstatedir=/var \
79 --mandir=/usr/share/man \
80 --sbindir=/usr/sbin \
81 --sysconfdir=/etc/kismet \
82 $(DISABLE_LARGEFILE) \
83 $(DISABLE_NLS) \
84 --enable-shared \
85 --disable-static \
86 --disable-rpath \
87 --with-gnu-ld \
88 );
89 endef
90
91 define Build/Compile
92 rm -rf $(PKG_INSTALL_DIR)
93 mkdir -p $(PKG_INSTALL_DIR)
94 $(MAKE) -C $(PKG_BUILD_DIR) \
95 CFLAGS="-I$(STAGING_DIR)/usr/include" \
96 DESTDIR="$(PKG_INSTALL_DIR)" \
97 all install
98 endef
99
100 define Package/knock/install
101 install -d -m0755 $(1)/usr/bin
102 $(CP) $(PKG_INSTALL_DIR)/usr/bin/knock $(1)/usr/bin/
103 endef
104
105 define Package/kockd/install
106 install -d -m0755 $(1)/etc
107 install -m0600 $(PKG_INSTALL_DIR)/etc/knockd.conf $(1)/etc/
108 install -d -m0755 $(1)/usr/sbin
109 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/knockd $(1)/usr/sbin/
110 endef
111
112 $(eval $(call BuildPackage,knock))
113 $(eval $(call BuildPackage,knockd))