1 # Copyright 2023 MOSSDeF, Stan Grishin (stangri@melmac.ca)
2 # TLD optimization written by Dirk Brenken (dev@brenken.org)
3 # This is free software, licensed under the GNU General Public License v3.
5 include $(TOPDIR
)/rules.mk
10 PKG_MAINTAINER
:=Stan Grishin
<stangri@melmac.ca
>
11 PKG_LICENSE
:=GPL-3.0
-or-later
13 include $(INCLUDE_DIR
)/package.mk
15 define Package
/adblock-fast
18 TITLE
:=AdBlock Fast Service
19 URL
:=https
://docs.openwrt.melmac.net
/adblock-fast
/
21 DEPENDS
+=+!BUSYBOX_DEFAULT_AWK
:gawk
22 DEPENDS
+=+!BUSYBOX_DEFAULT_GREP
:grep
23 DEPENDS
+=+!BUSYBOX_DEFAULT_SED
:sed
24 DEPENDS
+=+!BUSYBOX_DEFAULT_SORT
:coreutils-sort
25 CONFLICTS
:=simple-adblock
26 PROVIDES
:=simple-adblock
30 define Package
/adblock-fast
/description
31 Fast AdBlocking script to block ad or abuse
/malware domains with Dnsmasq
, SmartDNS or Unbound.
32 Script supports local
/remote list of domains and hosts-files for both block-listing and allow-listing.
33 Please see https
://docs.openwrt.melmac.net
/adblock-fast
/ for more information.
36 define Package
/adblock-fast
/conffiles
37 /etc
/config
/adblock-fast
40 define Build
/Configure
46 define Package
/adblock-fast
/install
47 $(INSTALL_DIR
) $(1)/etc
/init.d
48 $(INSTALL_BIN
) .
/files
/etc
/init.d
/adblock-fast
$(1)/etc
/init.d
/adblock-fast
49 $(SED
) "s|^\(readonly PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(1)/etc
/init.d
/adblock-fast
50 $(INSTALL_DIR
) $(1)/etc
/config
51 $(INSTALL_CONF
) .
/files
/etc
/config
/adblock-fast
$(1)/etc
/config
/adblock-fast
52 $(INSTALL_DIR
) $(1)/tmp
53 $(INSTALL_DATA
) .
/files
/adblock-fast.config.update
$(1)/tmp
/adblock-fast.config.update
54 $(INSTALL_DIR
) $(1)/etc
/uci-defaults
55 $(INSTALL_BIN
) .
/files
/etc
/uci-defaults
/90-adblock-fast
$(1)/etc
/uci-defaults
/90-adblock-fast
58 define Package
/adblock-fast
/postinst
60 # check if we are on real system
61 if
[ -z
"$${IPKG_INSTROOT}" ]; then
62 sed
-f
/tmp
/adblock-fast.config.update
-i
/etc
/config
/adblock-fast || true
63 /etc
/init.d
/adblock-fast enable
68 define Package
/adblock-fast
/prerm
70 # check if we are on real system
71 if
[ -z
"$${IPKG_INSTROOT}" ]; then
72 echo
-n
"Stopping adblock-fast service... "
73 { /etc
/init.d
/adblock-fast stop
&& \
74 /etc
/init.d
/adblock-fast killcache
; } >/dev
/null
2>&1 && echo
"OK" || echo
"FAIL"
75 echo
-n
"Removing rc.d symlink for adblock-fast... "
76 /etc
/init.d
/adblock-fast disable
>/dev
/null
2>&1 && echo
"OK" || echo
"FAIL"
81 $(eval
$(call BuildPackage
,adblock-fast
))