Browse Source

wifidog: Bring back Wifidog at 1.2.1

This commit brings back Wifidog from the oldpackages
repository.

Changes:

* Wifidog version 1.2.1
* Add wifidog-tls package
* Init script uses procd

Signed-off-by: Michael Haas <haas@computerlinguist.org>
Michael Haas 10 years ago
parent
commit
17a51b7b86
2 changed files with 125 additions and 0 deletions
  1. 103
    0
      net/wifidog/Makefile
  2. 22
    0
      net/wifidog/files/wifidog.init

+ 103
- 0
net/wifidog/Makefile View File

@@ -0,0 +1,103 @@
1
+#
2
+# Copyright (C) 2006,2015 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:=wifidog
11
+PKG_VERSION:=1.2.1
12
+PKG_RELEASE=1
13
+
14
+
15
+PKG_LICENSE:=GPL-2.0
16
+# Note: Packaging is maintained upstream at
17
+# https://github.com/wifidog/packages
18
+PKG_MAINTAINER:=Michael Haas <haas@computerlinguist.org>
19
+PKG_LICENSE_FILES:=COPYING
20
+
21
+
22
+PKG_SOURCE_PROTO:=git
23
+PKG_SOURCE_URL:=git://github.com/wifidog/wifidog-gateway.git
24
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
25
+PKG_SOURCE_VERSION:=1.2.1
26
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
27
+
28
+PKG_FIXUP:=autoreconf
29
+# do not run make install
30
+PKG_INSTALL:=0
31
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
32
+
33
+include $(INCLUDE_DIR)/package.mk
34
+
35
+define Package/wifidog/Default
36
+  SUBMENU:=Captive Portals
37
+  SECTION:=net
38
+  CATEGORY:=Network
39
+  DEPENDS:=+iptables-mod-extra +iptables-mod-ipopt +iptables-mod-nat-extra +libpthread
40
+  TITLE:=A wireless captive portal solution
41
+  URL:=http://www.wifidog.org
42
+endef
43
+
44
+define Package/wifidog
45
+$(call Package/wifidog/Default)
46
+  VARIANT:=normal
47
+endef
48
+
49
+define Package/wifidog-tls
50
+$(call Package/wifidog/Default)
51
+  DEPENDS+= +libcyassl
52
+  VARIANT:=tls
53
+endef
54
+
55
+
56
+define Package/wifidog/description
57
+	The Wifidog project is a complete and embeddable captive
58
+	portal solution for wireless community groups or individuals
59
+	who wish to open a free Hotspot while still preventing abuse
60
+	of their Internet connection.
61
+endef
62
+
63
+define Package/wifidog-tls/description
64
+$(call Package/wifidog/description)
65
+
66
+This variant can talk TLS to the auth server.
67
+endef
68
+
69
+define Package/wifidog/conffiles
70
+/etc/wifidog.conf
71
+endef
72
+
73
+Package/wifidog-tls/conffiles = $(Package/wifidog/conffiles)
74
+
75
+
76
+define Package/wifidog/configure
77
+	$(call Build/Configure/Default)
78
+endef
79
+
80
+ifeq ($(BUILD_VARIANT),tls)
81
+
82
+CONFIGURE_ARGS += \
83
+  --enable-cyassl
84
+
85
+endif
86
+
87
+define Package/wifidog/install
88
+	$(INSTALL_DIR) $(1)/usr/bin
89
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wifidog $(1)/usr/bin/
90
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wdctl $(1)/usr/bin/
91
+	$(INSTALL_DIR) $(1)/usr/lib
92
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libhttpd.so* $(1)/usr/lib/
93
+	$(INSTALL_DIR) $(1)/etc
94
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/wifidog.conf $(1)/etc/
95
+	$(INSTALL_DATA) $(PKG_BUILD_DIR)/wifidog-msg.html $(1)/etc/
96
+	$(INSTALL_DIR) $(1)/etc/init.d
97
+	$(INSTALL_BIN) ./files/wifidog.init $(1)/etc/init.d/wifidog
98
+endef
99
+
100
+Package/wifidog-tls/install = $(Package/wifidog/install)
101
+
102
+$(eval $(call BuildPackage,wifidog))
103
+$(eval $(call BuildPackage,wifidog-tls))

+ 22
- 0
net/wifidog/files/wifidog.init View File

@@ -0,0 +1,22 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2006 OpenWrt.org
3
+START=65
4
+
5
+USE_PROCD=1
6
+
7
+EXTRA_COMMANDS="status"
8
+EXTRA_HELP="        status Print the status of the service"
9
+
10
+start_service() {
11
+    procd_open_instance
12
+    # -s: log to syslog
13
+    # -f: run in foreground
14
+    procd_set_param command /usr/bin/wifidog -s -f
15
+    procd_set_param respawn # respawn automatically if something died
16
+    procd_set_param file /etc/wifidog.conf
17
+    procd_close_instance
18
+}
19
+
20
+status() {
21
+    /usr/bin/wdctl status
22
+}