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.

74 lines
2.0 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.3
  7. PKG_RELEASE:=1
  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. PKGARCH:=all
  16. endef
  17. define Package/simple-adblock/description
  18. This service provides DNSMASQ or Unbound based ad blocking.
  19. Please see the project's README at github for further information.
  20. endef
  21. define Package/simple-adblock/conffiles
  22. /etc/config/simple-adblock
  23. endef
  24. define Build/Prepare
  25. mkdir -p $(PKG_BUILD_DIR)/files/
  26. $(CP) ./files/simple-adblock.init $(PKG_BUILD_DIR)/files/simple-adblock.init
  27. sed -i "s|^\(PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(PKG_BUILD_DIR)/files/simple-adblock.init
  28. endef
  29. define Build/Configure
  30. endef
  31. define Build/Compile
  32. endef
  33. define Package/simple-adblock/install
  34. $(INSTALL_DIR) $(1)/etc/init.d
  35. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/simple-adblock.init $(1)/etc/init.d/simple-adblock
  36. $(INSTALL_DIR) $(1)/etc/config
  37. $(INSTALL_CONF) ./files/simple-adblock.conf $(1)/etc/config/simple-adblock
  38. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  39. $(INSTALL_BIN) ./files/simple-adblock.hotplug $(1)/etc/hotplug.d/iface/80-simple-adblock
  40. endef
  41. define Package/simple-adblock/postinst
  42. #!/bin/sh
  43. # check if we are on real system
  44. if [ -z "$${IPKG_INSTROOT}" ]; then
  45. /etc/init.d/simple-adblock enable
  46. fi
  47. exit 0
  48. endef
  49. define Package/simple-adblock/prerm
  50. #!/bin/sh
  51. # check if we are on real system
  52. if [ -z "$${IPKG_INSTROOT}" ]; then
  53. echo "Stopping service and removing rc.d symlink for simple-adblock"
  54. /etc/init.d/simple-adblock stop || true
  55. /etc/init.d/simple-adblock killcache || true
  56. /etc/init.d/simple-adblock disable || true
  57. fi
  58. exit 0
  59. endef
  60. $(eval $(call BuildPackage,simple-adblock))