Fwknop: add flexibility to uci support
[feed/packages.git] / net / fwknop / Makefile
1 #
2 # Copyright (C) 2011-2012 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:=fwknop
11 PKG_VERSION:=2.6.6
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://www.cipherdyne.org/fwknop/download
16 PKG_MD5SUM:=1372aeaf1e33ab1d6b9906ef9b5cd02e
17 PKG_MAINTAINER:=Jonathan Bennett <JBennett@incomsystems.biz>
18 PKG_LICENSE:=GPLv2
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/fwknop/Default
24 TITLE:=FireWall KNock OPerator
25 URL:=http://www.cipherdyne.org/fwknop/
26 endef
27
28 define Package/fwknop/Default/description
29 Fwknop implements an authorization scheme known as Single Packet Authorization
30 (SPA) for Linux systems running iptables. This mechanism requires only a
31 single encrypted and non-replayed packet to communicate various pieces of
32 information including desired access through an iptables policy. The main
33 application of this program is to use iptables in a default-drop stance to
34 protect services such as SSH with an additional layer of security in order to
35 make the exploitation of vulnerabilities (both 0-day and unpatched code) much
36 more difficult.
37 endef
38
39 define Package/fwknopd
40 $(call Package/fwknop/Default)
41 SECTION:=net
42 CATEGORY:=Network
43 SUBMENU:=Firewall
44 TITLE+= Daemon
45 DEPENDS:=+iptables +libfko +libpcap +FWKNOP_GPG:gnupg
46 endef
47
48 define Package/fwknopd/description
49 $(call Package/fwknop/Default/description)
50 This package contains the fwknop daemon.
51 endef
52
53 define Package/fwknopd/conffiles
54 /etc/fwknop/access.conf
55 /etc/fwknop/fwknopd.conf
56 endef
57
58 define Package/fwknopd/config
59 source "$(SOURCE)/Config.in"
60 endef
61
62 define Package/fwknop
63 $(call Package/fwknop/Default)
64 SECTION:=net
65 CATEGORY:=Network
66 SUBMENU:=Firewall
67 TITLE+= Client
68 DEPENDS:=+libfko
69 endef
70
71 define Package/fwknop/description
72 $(call Package/fwknop/Default/description)
73 This package contains the fwknop client.
74 endef
75
76 define Package/libfko
77 $(call Package/fwknop/Default)
78 SECTION:=libs
79 CATEGORY:=Libraries
80 SUBMENU:=Firewall
81 TITLE+= Library
82 endef
83
84 define Package/libfko/description
85 $(call Package/fwknop/Default/description)
86 This package contains the libfko shared library.
87 endef
88
89
90 ifeq ($(CONFIG_FWKNOPD_GPG),n)
91 CONFIGURE_ARGS += --without-gpgme
92 endif
93
94 CONFIGURE_ARGS += \
95 --with-iptables=/usr/sbin/iptables
96
97 define Build/InstallDev
98 $(INSTALL_DIR) $(1)/usr/include
99 $(CP) $(PKG_INSTALL_DIR)/usr/include/fko.h $(1)/usr/include/
100 $(INSTALL_DIR) $(1)/usr/lib
101 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfko.{a,la,so*} $(1)/usr/lib/
102 endef
103
104 define Package/fwknopd/install
105 $(INSTALL_DIR) $(1)/etc/config
106 $(INSTALL_CONF) ./files/fwknopd $(1)/etc/config/fwknopd
107 $(INSTALL_DIR) $(1)/etc/fwknop
108 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/fwknop/{access,fwknopd}.conf \
109 $(1)/etc/fwknop/
110 $(INSTALL_DIR) $(1)/etc/init.d
111 $(INSTALL_BIN) ./files/fwknopd.init $(1)/etc/init.d/fwknopd
112 $(INSTALL_DIR) $(1)/usr/sbin
113 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fwknopd $(1)/usr/sbin/
114 endef
115
116 define Package/fwknopd/conffiles
117 /etc/config/fwknopd
118 endef
119
120 define Package/fwknop/install
121 $(INSTALL_DIR) $(1)/usr/bin
122 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fwknop $(1)/usr/bin/
123 endef
124
125 define Package/libfko/install
126 $(INSTALL_DIR) $(1)/usr/lib
127 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfko.so.* $(1)/usr/lib/
128 endef
129
130 $(eval $(call BuildPackage,fwknopd))
131 $(eval $(call BuildPackage,fwknop))
132 $(eval $(call BuildPackage,libfko))