simple-adblock: update to 1.9.3-1
[feed/packages.git] / net / simple-adblock / Makefile
1 # Copyright 2017-2022 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.
4
5 include $(TOPDIR)/rules.mk
6
7 PKG_NAME:=simple-adblock
8 PKG_VERSION:=1.9.3
9 PKG_RELEASE:=1
10 PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
11 PKG_LICENSE:=GPL-3.0-or-later
12
13 include $(INCLUDE_DIR)/package.mk
14
15 define Package/simple-adblock
16 SECTION:=net
17 CATEGORY:=Network
18 TITLE:=Simple AdBlock Service
19 URL:=https://docs.openwrt.melmac.net/simple-adblock/
20 DEPENDS:=+jshn +wget
21 PKGARCH:=all
22 endef
23
24 define Package/simple-adblock/description
25 Simple adblock script to block ad or abuse/malware domains with DNSMASQ or Unbound.
26 Script supports local/remote list of domains and hosts-files for both block-listing and allow-listing.
27 Please see https://docs.openwrt.melmac.net/simple-adblock/ for more information.
28 endef
29
30 define Package/simple-adblock/conffiles
31 /etc/config/simple-adblock
32 endef
33
34 define Build/Configure
35 endef
36
37 define Build/Compile
38 endef
39
40 define Package/simple-adblock/install
41 $(INSTALL_DIR) $(1)/etc/init.d
42 $(INSTALL_DIR) $(1)/etc/config
43 $(INSTALL_DIR) $(1)/tmp
44 $(INSTALL_BIN) ./files/simple-adblock.init $(1)/etc/init.d/simple-adblock
45 $(SED) "s|^\(readonly PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(1)/etc/init.d/simple-adblock
46 $(INSTALL_CONF) ./files/simple-adblock.conf $(1)/etc/config/simple-adblock
47 $(INSTALL_DATA) ./files/simple-adblock.conf.update $(1)/tmp/simple-adblock.conf.update
48 endef
49
50 define Package/simple-adblock/postinst
51 #!/bin/sh
52 # check if we are on real system
53 if [ -z "$${IPKG_INSTROOT}" ]; then
54 sed -f /tmp/simple-adblock.conf.update -i /etc/config/simple-adblock || true
55 /etc/init.d/simple-adblock enable
56 fi
57 exit 0
58 endef
59
60 define Package/simple-adblock/prerm
61 #!/bin/sh
62 # check if we are on real system
63 if [ -z "$${IPKG_INSTROOT}" ]; then
64 echo "Stopping service and removing rc.d symlink for simple-adblock"
65 /etc/init.d/simple-adblock stop || true
66 /etc/init.d/simple-adblock killcache || true
67 /etc/init.d/simple-adblock disable || true
68 fi
69 exit 0
70 endef
71
72 $(eval $(call BuildPackage,simple-adblock))