You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.1 KiB

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