packages/net/ddns-scripts/Makefile
Steven Barth 6ab4a265a2 ddns-scripts: Added support for custom update scripts
Squashed commit of the following:

commit 2701c8868e1ef4949db57e53b27958edba6abb59
Author: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Date:   Sun Oct 5 11:01:57 2014 +0200

    ddns-scripts: Added support for custom update scripts

    Sample script
    Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>

commit e07ecb90fa2c7404a97cf64024e89bd9d88aacd4
Author: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Date:   Sun Oct 5 11:00:11 2014 +0200

    ddns-scripts: Added support for custom update scripts

    Added support for custom update scripts with new option update_script.
    function get_service_url() renamed to get_service_data() and extended to detect scripts inside service / service_ipv6 for later use
    function send_update() modified to support custom update scripts.
    Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>

commit 39e41b2151a79a7ace71a9d40b87cd4d6ce09503
Author: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Date:   Sun Oct 5 10:52:44 2014 +0200

    ddns-scripts: Added support for custom update scripts

    Added support for custom update scripts with new option update_script
    Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>

commit 33f264768e37d8a6fe564faaafa51a7b45a0ee19
Author: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Date:   Sun Oct 5 10:48:21 2014 +0200

    ddns-scripts: Insert description for NEW option update_script

    Insert description for NEW option update_script
    Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>

commit 6f6a60244df53e0556f5c75845c69aa832f97e4c
Author: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Date:   Sun Oct 5 10:43:52 2014 +0200

    ddns-scripts: Update PKG_RELEASE

    Update_PKG_RELEASE to reflect changes
    Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
2014-10-06 08:39:59 +02:00

94 lines
2.2 KiB
Makefile

include $(TOPDIR)/rules.mk
PKG_NAME:=ddns-scripts
PKG_VERSION:=2.0.1
PKG_RELEASE:=7
PKG_LICENSE:=GPL-2.0
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/ddns-scripts
SECTION:=net
CATEGORY:=Network
SUBMENU:=IP Addresses and Names
TITLE:=Dynamic DNS Scripts (with IPv6 support)
PKGARCH:=all
MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
endef
define Package/ddns-scripts/description
A highly configurable set of scripts for doing dynamic dns updates.
NEW in this version:
- IPv6 support
- force communication to IPv4 or IPv6 only
- DNS server support
- using BIND host if installed
- DNS requests via TCP
- Proxy server support
- log file support
- support to run once
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/ddns-scripts/conffiles
/etc/config/ddns
endef
define Package/ddns-scripts/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/etc/config/* $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/* $(1)/etc/hotplug.d/iface
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/* $(1)/etc/init.d/
$(INSTALL_DIR) $(1)/usr/lib/ddns
$(INSTALL_DATA) ./files/usr/lib/ddns/service* $(1)/usr/lib/ddns
$(INSTALL_BIN) ./files/usr/lib/ddns/*.sh $(1)/usr/lib/ddns
endef
define Package/ddns-scripts/postinst
#!/bin/sh
# if run within buildroot exit
[ -n "${IPKG_INSTROOT}" ] && exit 0
# add new section "ddns" "global" if not exists
uci -q get ddns.global > /dev/null || uci -q set ddns.global='ddns'
uci -q get ddns.global.date_format > /dev/null || uci -q set ddns.global.date_format='%F %R'
uci -q get ddns.global.log_lines > /dev/null || uci -q set ddns.global.log_lines='250'
uci -q commit ddns
# clear LuCI indexcache
rm -f /tmp/luci-indexcache >/dev/null 2>&1
exit 0
endef
define Package/ddns-scripts/prerm
#!/bin/sh
# if run within buildroot exit
[ -n "${IPKG_INSTROOT}" ] && exit 0
# stop running scripts
/etc/init.d/ddns disable
/etc/init.d/ddns stop
# clear LuCI indexcache
rm -f /tmp/luci-indexcache >/dev/null 2>&1
exit 0
endef
$(eval $(call BuildPackage,ddns-scripts))