-
Notifications
You must be signed in to change notification settings - Fork 321
openwrt-portable-Makefile [reloaded] #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# | ||
# Copyright (C) 2006,2013 OpenWrt.org | ||
# | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=wifidog | ||
PKG_VERSION:=20130917 | ||
PKG_RELEASE:=1.1.6 | ||
|
||
|
||
PKG_SOURCE_PROTO:=git | ||
PKG_SOURCE_URL:=git://github.com/wifidog/wifidog-gateway.git | ||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE) | ||
PKG_SOURCE_VERSION:=master | ||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE).tar.gz | ||
|
||
PKG_FIXUP:=autoreconf | ||
PKG_INSTALL:=1 | ||
|
||
include $(INCLUDE_DIR)/package.mk | ||
|
||
### Adjust "files" directory to suit $RELEASE | ||
# Setting a default "files" directory | ||
OPENWRT_FILESDIR:=common | ||
# Managing exceptions | ||
ifeq ($(RELEASE),Barrier Breaker) | ||
OPENWRT_FILESDIR:=Barrier_Breaker | ||
endif | ||
|
||
define Package/wifidog | ||
SUBMENU:=Captive Portals | ||
SECTION:=net | ||
CATEGORY:=Network | ||
DEPENDS:=+iptables-mod-extra +iptables-mod-ipopt +iptables-mod-nat-extra +libpthread | ||
TITLE:=A wireless captive portal solution | ||
URL:=http://www.wifidog.org | ||
endef | ||
|
||
define Package/wifidog/description | ||
The Wifidog project is a complete and embeddable captive | ||
portal solution for wireless community groups or individuals | ||
who wish to open a free Hotspot while still preventing abuse | ||
of their Internet connection. | ||
endef | ||
|
||
define Package/wifidog/conffiles | ||
/etc/wifidog.conf | ||
endef | ||
|
||
define Package/wifidog/install | ||
$(INSTALL_DIR) $(1)/usr/bin | ||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/init.d/wifidog $(1)/usr/bin/wifidog-init | ||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wifidog $(1)/usr/bin/ | ||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wdctl $(1)/usr/bin/ | ||
$(INSTALL_DIR) $(1)/usr/lib | ||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libhttpd.so* $(1)/usr/lib/ | ||
$(INSTALL_DIR) $(1)/etc/ | ||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/wifidog.conf $(1)/etc/ | ||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/wifidog-msg.html $(1)/etc/ | ||
$(INSTALL_DIR) $(1)/etc/init.d | ||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/build-openwrt-global/wifidog/files/$(OPENWRT_FILESDIR)/wifidog.init $(1)/etc/init.d/wifidog | ||
endef | ||
|
||
$(eval $(call BuildPackage,wifidog)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh /etc/rc.common | ||
# Copyright (C) 2006 OpenWrt.org | ||
# Updated from post https://dev.openwrt.org/ticket/14761 | ||
|
||
USE_PROCD=1 | ||
|
||
START=99 | ||
EXTRA_COMMANDS="status" | ||
EXTRA_HELP=" status Print the status of the service" | ||
|
||
WIFIDOG_CONF=/etc/wifidog.conf | ||
|
||
|
||
start_service() { | ||
procd_open_instance | ||
procd_set_param command /usr/bin/wifidog-init start | ||
|
||
procd_set_param respawn # respawn automatically if something died, be careful if you have an alternative process supervisor | ||
procd_set_param file $WIFIDOG_CONF | ||
procd_close_instance | ||
} | ||
|
||
stop_service() { | ||
/usr/bin/wifidog-init stop | ||
} | ||
|
||
status() { | ||
/usr/bin/wifidog-init status | ||
} | ||
|
||
service_triggers() { | ||
### Trigger, reload service on network change | ||
procd_add_reload_interface_trigger "$(grep 'GatewayInterface' $WIFIDOG_CONF | grep -v ^# | awk '{print $2}')" | ||
procd_add_reload_trigger "$WIFIDOG_CONF" | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh /etc/rc.common | ||
# Copyright (C) 2006 OpenWrt.org | ||
START=65 | ||
EXTRA_COMMANDS="status" | ||
EXTRA_HELP=" status Print the status of the service" | ||
|
||
|
||
start() { | ||
/usr/bin/wifidog-init start | ||
} | ||
|
||
stop() { | ||
/usr/bin/wifidog-init stop | ||
} | ||
|
||
status() { | ||
/usr/bin/wifidog-init status | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work for Chaos Calmer :(
Either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chaos Calmer not beeing stable, I did not include it, but it is pretty easy to fix the Makefile.
By the way, rather than checking $(RELEASE), check for procd, as you suggest, or check for a versioning or a commit number would reduce code maintenance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please wait for a moment, we will fork openwrt/packages , then submit this code to there, should not in this project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sinkcup : Do you plan to delete "contrib" directory ?