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.

62 lines
1.6 KiB

  1. # Copyright (c) 2017 Stan Grishin (stangri@melmac.net)
  2. # This is free software, licensed under the GNU General Public License v3.
  3. include $(TOPDIR)/rules.mk
  4. PKG_NAME:=simple-adblock
  5. PKG_VERSION:=1.5.8
  6. PKG_RELEASE:=1
  7. PKG_LICENSE:=GPL-3.0+
  8. PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
  9. include $(INCLUDE_DIR)/package.mk
  10. define Package/$(PKG_NAME)
  11. SECTION:=net
  12. CATEGORY:=Network
  13. TITLE:=Simple AdBlock Service
  14. PKGARCH:=all
  15. endef
  16. define Package/$(PKG_NAME)/description
  17. This service provides dnsmasq-based ad blocking.
  18. Please see the README for further information.
  19. endef
  20. define Package/$(PKG_NAME)/conffiles
  21. /etc/config/simple-adblock
  22. endef
  23. define Build/Prepare
  24. mkdir -p $(PKG_BUILD_DIR)/files/
  25. $(CP) ./files/simple-adblock.init $(PKG_BUILD_DIR)/files/simple-adblock.init
  26. sed -i "s|^\(PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|" $(PKG_BUILD_DIR)/files/simple-adblock.init
  27. endef
  28. define Build/Configure
  29. endef
  30. define Build/Compile
  31. endef
  32. define Package/$(PKG_NAME)/install
  33. $(INSTALL_DIR) $(1)/etc/init.d
  34. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/simple-adblock.init $(1)/etc/init.d/simple-adblock
  35. $(INSTALL_DIR) $(1)/etc/config
  36. $(INSTALL_CONF) ./files/simple-adblock.conf $(1)/etc/config/simple-adblock
  37. endef
  38. define Package/$(PKG_NAME)/prerm
  39. #!/bin/sh
  40. # check if we are on real system
  41. if [ -z "$${IPKG_INSTROOT}" ]; then
  42. echo "Stopping service and removing rc.d symlink for simple-adblock"
  43. /etc/init.d/simple-adblock stop || true
  44. /etc/init.d/simple-adblock killcache || true
  45. /etc/init.d/simple-adblock disable
  46. fi
  47. exit 0
  48. endef
  49. $(eval $(call BuildPackage,$(PKG_NAME)))