simple-adblock: better download processing, luci-app integration, lists optimization, firewall integration

Signed-off-by: Stan Grishin <stangri@melmac.net>
(cherry picked from commit ac34bf910e)
This commit is contained in:
Stan Grishin
2018-07-16 17:41:39 -07:00
committed by Hannu Nyman
parent d3b43be6c9
commit 45f6a81fb2
5 changed files with 418 additions and 197 deletions
+32 -13
View File
@@ -1,30 +1,31 @@
# Copyright (c) 2017 Stan Grishin (stangri@melmac.net)
# Copyright 2017-2018 Stan Grishin (stangri@melmac.net)
# TLD optimization written by Dirk Brenken (dev@brenken.org)
# This is free software, licensed under the GNU General Public License v3.
include $(TOPDIR)/rules.mk
PKG_NAME:=simple-adblock
PKG_VERSION:=1.5.8
PKG_RELEASE:=1
PKG_VERSION:=1.6.3
PKG_RELEASE:=5
PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
define Package/simple-adblock
SECTION:=net
CATEGORY:=Network
TITLE:=Simple AdBlock Service
PKGARCH:=all
endef
define Package/$(PKG_NAME)/description
define Package/simple-adblock/description
This service provides dnsmasq-based ad blocking.
Please see the README for further information.
endef
define Package/$(PKG_NAME)/conffiles
define Package/simple-adblock/conffiles
/etc/config/simple-adblock
endef
@@ -40,23 +41,41 @@ endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
define Package/simple-adblock/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/simple-adblock.init $(1)/etc/init.d/simple-adblock
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/simple-adblock.conf $(1)/etc/config/simple-adblock
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) ./files/simple-adblock.hotplug $(1)/etc/hotplug.d/iface/80-simple-adblock
endef
define Package/$(PKG_NAME)/prerm
define Package/simple-adblock/postinst
#!/bin/sh
# check if we are on real system
if [ -z "$${IPKG_INSTROOT}" ]; then
echo "Stopping service and removing rc.d symlink for simple-adblock"
/etc/init.d/simple-adblock stop || true
/etc/init.d/simple-adblock killcache || true
/etc/init.d/simple-adblock disable
/etc/init.d/simple-adblock enable
while uci -q del ucitrack.@simple-adblock[-1]; do :; done
uci -q batch <<-EOF >/dev/null
add ucitrack simple-adblock
set ucitrack.@simple-adblock[0].init='simple-adblock'
commit ucitrack
EOF
fi
exit 0
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
define Package/simple-adblock/prerm
#!/bin/sh
# check if we are on real system
if [ -z "$${IPKG_INSTROOT}" ]; then
while uci -q del ucitrack.@simple-adblock[-1]; do :; done
echo "Stopping service and removing rc.d symlink for simple-adblock"
/etc/init.d/simple-adblock stop || true
/etc/init.d/simple-adblock killcache || true
/etc/init.d/simple-adblock disable || true
fi
exit 0
endef
$(eval $(call BuildPackage,simple-adblock))