1 # Copyright 2017-2018 Stan Grishin (stangri@melmac.net)
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
7 PKG_NAME
:=simple-adblock
10 PKG_MAINTAINER
:=Stan Grishin
<stangri@melmac.net
>
11 PKG_LICENSE
:=GPL-3.0
-or-later
13 include $(INCLUDE_DIR
)/package.mk
15 define Package
/simple-adblock
18 TITLE
:=Simple AdBlock Service
22 define Package
/simple-adblock
/description
23 This service provides DNSMASQ or Unbound based ad blocking.
24 Please see the project
's README at github for further information.
28 define Package/simple-adblock/conffiles
29 /etc/config/simple-adblock
33 mkdir -p $(PKG_BUILD_DIR)/files/
34 $(CP) ./files/simple-adblock.init $(PKG_BUILD_DIR)/files/simple-adblock.init
35 sed -i "s|^\(PKG_VERSION\).*|\1='$(PKG_VERSION
)-$(PKG_RELEASE
)'|" $(PKG_BUILD_DIR)/files/simple-adblock.init
38 define Build/Configure
44 define Package/simple-adblock/install
45 $(INSTALL_DIR) $(1)/etc/init.d
46 $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/simple-adblock.init $(1)/etc/init.d/simple-adblock
47 $(INSTALL_DIR) $(1)/etc/config
48 $(INSTALL_CONF) ./files/simple-adblock.conf $(1)/etc/config/simple-adblock
49 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
50 $(INSTALL_BIN) ./files/simple-adblock.hotplug $(1)/etc/hotplug.d/iface/80-simple-adblock
53 define Package/simple-adblock/postinst
55 # check if we are on real system
56 if [ -z "$${IPKG_INSTROOT}" ]; then
57 /etc/init.d/simple-adblock enable
62 define Package/simple-adblock/prerm
64 # check if we are on real system
65 if [ -z "$${IPKG_INSTROOT}" ]; then
66 echo "Stopping service and removing rc.d symlink for simple-adblock"
67 /etc/init.d/simple-adblock stop || true
68 /etc/init.d/simple-adblock killcache || true
69 /etc/init.d/simple-adblock disable || true
74 $(eval $(call BuildPackage,simple-adblock))