2018-07-17 00:41:39 +00:00
|
|
|
# Copyright 2017-2018 Stan Grishin (stangri@melmac.net)
|
|
|
|
# TLD optimization written by Dirk Brenken (dev@brenken.org)
|
2017-01-23 14:33:32 +00:00
|
|
|
# This is free software, licensed under the GNU General Public License v3.
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=simple-adblock
|
2021-03-18 01:37:30 +00:00
|
|
|
PKG_VERSION:=1.8.7
|
2021-08-02 06:34:08 +00:00
|
|
|
PKG_RELEASE:=6
|
2017-01-23 14:33:32 +00:00
|
|
|
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
|
2019-07-04 22:38:58 +00:00
|
|
|
PKG_LICENSE:=GPL-3.0-or-later
|
2017-01-23 14:33:32 +00:00
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
2018-07-17 00:41:39 +00:00
|
|
|
define Package/simple-adblock
|
2017-01-23 14:33:32 +00:00
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
|
|
|
TITLE:=Simple AdBlock Service
|
2021-02-02 22:11:06 +00:00
|
|
|
URL:=https://docs.openwrt.melmac.net/simple-adblock/
|
2021-04-10 18:54:41 +00:00
|
|
|
DEPENDS:=+jshn +wget
|
2017-01-23 14:33:32 +00:00
|
|
|
PKGARCH:=all
|
|
|
|
endef
|
|
|
|
|
2018-07-17 00:41:39 +00:00
|
|
|
define Package/simple-adblock/description
|
2020-06-08 17:35:32 +00:00
|
|
|
Simple adblock script to block ad or abuse/malware domains with DNSMASQ or Unbound.
|
2020-10-08 02:38:54 +00:00
|
|
|
Script supports local/remote list of domains and hosts-files for both block-listing and allow-listing.
|
|
|
|
Please see https://docs.openwrt.melmac.net/simple-adblock/ for more information.
|
2017-01-23 14:33:32 +00:00
|
|
|
endef
|
|
|
|
|
2018-07-17 00:41:39 +00:00
|
|
|
define Package/simple-adblock/conffiles
|
2017-01-23 14:33:32 +00:00
|
|
|
/etc/config/simple-adblock
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Configure
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Compile
|
|
|
|
endef
|
|
|
|
|
2018-07-17 00:41:39 +00:00
|
|
|
define Package/simple-adblock/install
|
2021-03-18 01:37:30 +00:00
|
|
|
$(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/config $(1)/tmp
|
2020-12-12 21:58:21 +00:00
|
|
|
$(INSTALL_BIN) ./files/simple-adblock.init $(1)/etc/init.d/simple-adblock
|
2021-03-08 10:25:11 +00:00
|
|
|
$(SED) "s|^\(PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(1)/etc/init.d/simple-adblock
|
2017-01-23 14:33:32 +00:00
|
|
|
$(INSTALL_CONF) ./files/simple-adblock.conf $(1)/etc/config/simple-adblock
|
2021-04-10 18:54:41 +00:00
|
|
|
$(INSTALL_DATA) ./files/simple-adblock.conf.update $(1)/tmp/simple-adblock.conf.update
|
2017-01-23 14:33:32 +00:00
|
|
|
endef
|
|
|
|
|
2018-07-17 00:41:39 +00:00
|
|
|
define Package/simple-adblock/postinst
|
2018-01-26 03:35:52 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# check if we are on real system
|
|
|
|
if [ -z "$${IPKG_INSTROOT}" ]; then
|
2020-05-27 00:25:57 +00:00
|
|
|
sed -f /tmp/simple-adblock.conf.update -i /etc/config/simple-adblock || true
|
2018-07-17 00:41:39 +00:00
|
|
|
/etc/init.d/simple-adblock enable
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/simple-adblock/prerm
|
|
|
|
#!/bin/sh
|
|
|
|
# check if we are on real system
|
|
|
|
if [ -z "$${IPKG_INSTROOT}" ]; then
|
2018-01-26 03:35:52 +00:00
|
|
|
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
|
2018-07-17 00:41:39 +00:00
|
|
|
/etc/init.d/simple-adblock disable || true
|
2018-01-26 03:35:52 +00:00
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
endef
|
|
|
|
|
2018-07-17 00:41:39 +00:00
|
|
|
$(eval $(call BuildPackage,simple-adblock))
|