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.

73 lines
1.8 KiB

  1. #
  2. # Copyright (c) 2018 Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
  3. # This is free software, licensed under the MIT License
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=safe-search
  7. PKG_VERSION:=1.0.1
  8. PKG_RELEASE:=1
  9. PKG_LICENSE:=MIT
  10. PKG_MAINTAINER:=Gregory L. Dietsche <Gregory.Dietsche@cuw.edu>
  11. include $(INCLUDE_DIR)/package.mk
  12. define Package/safe-search
  13. SECTION:=net
  14. CATEGORY:=Network
  15. TITLE:=Safe Search
  16. PKGARCH:=all
  17. endef
  18. define Package/safe-search/description
  19. This package prevents adult content from appearing in search results by
  20. configuring dnsmasq to force all devices on your network to use Google and
  21. Bing's Safe Search IP addresses. This is designed to be approperiate for most
  22. businesses and families. The default filtering rules do not interfere with
  23. normal web browsing.
  24. endef
  25. define Package/safe-search/conffiles
  26. /etc/config/safe-search
  27. endef
  28. define Build/Compile
  29. endef
  30. define Package/safe-search/install
  31. $(INSTALL_DIR) $(1)/etc/uci-defaults
  32. $(CP) ./files/safe-search.defaults $(1)/etc/uci-defaults/safe-search
  33. $(INSTALL_DIR) $(1)/etc/config
  34. $(INSTALL_CONF) ./files/safe-search.conf $(1)/etc/config/safe-search
  35. $(INSTALL_DIR) $(1)/usr/sbin
  36. $(INSTALL_BIN) ./files/safe-search-update $(1)/usr/sbin/safe-search-update
  37. $(INSTALL_DIR) $(1)/etc/safe-search/enabled
  38. $(INSTALL_DIR) $(1)/etc/safe-search/available
  39. $(INSTALL_DATA) ./files/hosts/* $(1)/etc/safe-search/available/
  40. endef
  41. define Package/safe-search/prerm
  42. #!/bin/sh
  43. if [ -z "$${IPGK_INSTROOT}" ]; then
  44. uci del_list dhcp.@dnsmasq[0].addnhosts=/etc/safe-search/enabled
  45. uci commit dhcp
  46. /etc/init.d/dnsmasq reload
  47. fi
  48. exit 0
  49. endef
  50. define Package/safe-search/postrm
  51. #!/bin/sh
  52. if [ -z "$${IPGK_INSTROOT}" ]; then
  53. rm -rf /etc/safe-search/enabled
  54. rmdir /etc/safe-search/available
  55. rmdir /etc/safe-search/
  56. fi
  57. exit 0
  58. endef
  59. $(eval $(call BuildPackage,safe-search))