bumped version to 2.0
[fwknop.git] / extras / openwrt / package / fwknop / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=fwknopd
4 PKG_VERSION:=2.0
5 PKG_RELEASE:=1
6
7 PKG_BUILD_DIR:=$(BUILD_DIR)/fwknop-$(PKG_VERSION)
8 PKG_SOURCE:=fwknop-$(PKG_VERSION).tar.gz
9 PKG_SOURCE_URL:=http://www.cipherdyne.org/fwknop/download
10 PKG_MD5SUM:=c78252216fa9627cacf61b453da915a8
11 PKG_CAT:=zcat
12 include $(INCLUDE_DIR)/package.mk
13
14 define Package/fwknopd
15        SECTION:=net
16        CATEGORY:=Network
17        DEFAULT:=n
18        TITLE:=Firewall Knock Operator Daemon
19        URL:=http://http://www.cipherdyne.org/fwknop/
20        MAINTAINER:=Jonathan Bennett <jbscience87@gmail.com>
21        DEPENDS:=+libpcap +iptables
22 endef
23
24 define Package/fwknopd/description
25        Firewall Knock Operator Daemon
26        Fwknop implements an authorization scheme known as Single Packet
27        Authorization (SPA) for Linux systems running iptables.  This mechanism
28        requires only a single encrypted and non-replayed packet to communicate
29        various pieces of information including desired access through an iptables
30        policy. The main application of this program is to use iptables in a
31        default-drop stance to protect services such as SSH with an additional
32        layer of security in order to make the exploitation of vulnerabilities
33        (both 0-day and unpatched code) much more difficult.
34 endef
35
36 define Package/Conffiles
37        fwknopd.conf
38 endef
39
40 CONFIGURE_ARGS += \
41        --disable-client \
42        --without-gpgme \
43        --with-iptables=/usr/sbin/iptables
44
45
46
47 define Package/fwknopd/install
48        $(INSTALL_DIR) $(1)/usr/sbin
49        $(INSTALL_DIR) $(1)/etc/fwknop
50        $(INSTALL_DIR) $(1)/etc/init.d
51        $(INSTALL_DIR) $(1)/usr/lib
52        $(INSTALL_BIN) $(PKG_BUILD_DIR)/extras/fwknop.init.openwrt $(1)/etc/init.d/fwknopd
53        $(INSTALL_BIN) $(PKG_BUILD_DIR)/server/.libs/fwknopd $(1)/usr/sbin/
54        $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/.libs/libfko.so.0.0.2 $(1)/usr/lib/libfko.so.0
55        $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/.libs/libfko.so.0.0.2 $(1)/usr/lib/libfko.so.0.0.2
56        $(INSTALL_CONF) $(PKG_BUILD_DIR)/server/fwknopd.conf $(1)/etc/fwknop/
57        $(INSTALL_CONF) $(PKG_BUILD_DIR)/server/access.conf $(1)/etc/fwknop/
58
59 endef
60
61 $(eval $(call BuildPackage,fwknopd))
62 #
63 # Copyright (C) 2006-2009 OpenWrt.org
64 #
65 # This is free software, licensed under the GNU General Public License v2.
66 # See /LICENSE for more information.
67 #
68
69 include $(TOPDIR)/rules.mk
70
71 PKG_NAME:=fwknop
72 PKG_VERSION:=2.0.0rc1
73 PKG_RELEASE:=1
74
75 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
76 PKG_SOURCE_URL:=http://www.dstuart.org/fwknop/
77 PKG_MD5SUM:=86c41edbe78bd15e6e5e351741cb26dd
78
79 include $(INCLUDE_DIR)/package.mk
80
81 PKG_INSTALL=1
82
83 define Package/fwknop
84   SECTION:=net
85   CATEGORY:=Network
86   DEPENDS:=+gpgme +libgdbm +libpcap +iptables
87   TITLE:=Firewall KNock OPerator - fwknop
88   URL:=http://www.cipherdyne.org/fwknop
89 endef
90
91 define Package/fwknop/description
92         Fwknop implements an authorization scheme known as Single Packet
93         Authorization (SPA) for Linux systems running iptables.  This mechanism
94         requires only a single encrypted and non-replayed packet to communicate
95         various pieces of information including desired access through an iptables
96         policy. The main application of this program is to use iptables in a
97         default-drop stance to protect services such as SSH with an additional
98         layer of security in order to make the exploitation of vulnerabilities
99         (both 0-day and unpatched code) much more difficult.
100 endef
101
102 TARGET_CFLAGS += $(FPIC)
103
104 define Build/Configure
105         $(call Build/Configure/Default, \
106                 --enable-shared \
107                 --enable-static \
108                 --with-gpgme \
109                 --with-gpg=/usr/bin/gpg \
110                 --with-iptables=/usr/sbin/iptables \
111                 --with-sh=/bin/sh \
112         )
113 endef
114
115 define Build/InstallDev
116         $(INSTALL_DIR) $(1)/usr/include
117         $(INSTALL_DATA) \
118                 $(PKG_INSTALL_DIR)/usr/include/fko.h \
119                 $(1)/usr/include/
120
121         $(INSTALL_DIR) $(1)/usr/lib
122         $(INSTALL_DATA) \
123                 $(PKG_INSTALL_DIR)/usr/lib/libfko.{la,a,so*} \
124                 $(1)/usr/lib/
125 endef
126
127 define Package/fwknop/install
128         $(INSTALL_DIR) $(1)/usr/lib
129         $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libfko.so.* $(1)/usr/lib/
130         $(INSTALL_DIR) $(1)/usr/bin
131         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fwknop $(1)/usr/bin/
132         $(INSTALL_DIR) $(1)/usr/sbin
133         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fwknopd $(1)/usr/sbin/
134         $(INSTALL_DIR) $(1)/etc/fwknop
135         $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/fwknop/fwknopd.conf $(1)/etc/fwknop/
136         $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/fwknop/access.conf $(1)/etc/fwknop/
137         $(INSTALL_DIR) $(1)/etc/init.d
138         $(INSTALL_BIN) ./files/fwknopd.init $(1)/etc/init.d/fwknopd
139 endef
140
141 $(eval $(call BuildPackage,fwknop))