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.

89 lines
2.1 KiB

  1. #
  2. # Copyright (C) 2019 NextDNS Inc
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=nextdns
  9. PKG_VERSION:=1.37.2
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=nextdns-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_VERSION:=v$(PKG_VERSION)
  13. PKG_SOURCE_URL:=https://codeload.github.com/nextdns/nextdns/tar.gz/v$(PKG_VERSION)?
  14. PKG_HASH:=a8b15c4b35cc1201b51503559a53605c4fdb140e8bb81a8ce1a36786c28eba40
  15. PKG_MAINTAINER:=Olivier Poitrey <rs@nextdns.io>
  16. PKG_LICENSE:=MIT
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_BUILD_DEPENDS:=golang/host
  19. PKG_BUILD_PARALLEL:=1
  20. PKG_USE_MIPS16:=0
  21. GO_PKG:=github.com/nextdns/nextdns
  22. GO_PKG_LDFLAGS_X:=main.version=$(PKG_VERSION)
  23. include $(INCLUDE_DIR)/package.mk
  24. include ../../lang/golang/golang-package.mk
  25. define Package/nextdns
  26. SECTION:=net
  27. CATEGORY:=Network
  28. TITLE:=NextDNS DNS over HTTPS Proxy
  29. URL:=https://github.com/nextdns/nextdns
  30. DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
  31. endef
  32. define Package/nextdns/conffiles
  33. /etc/config/nextdns
  34. endef
  35. define Package/nextdns/install
  36. $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
  37. $(INSTALL_DIR) $(1)/usr/sbin
  38. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nextdns $(1)/usr/sbin/
  39. $(INSTALL_DIR) $(1)/etc/config
  40. $(INSTALL_CONF) ./files/nextdns.config $(1)/etc/config/nextdns
  41. endef
  42. define Package/nextdns/postinst
  43. #!/bin/sh
  44. if [ -z "$${IPKG_INSTROOT}" ]; then
  45. nextdns install
  46. fi
  47. endef
  48. define Package/nextdns/prerm
  49. #!/bin/sh
  50. if [ -z "$${IPKG_INSTROOT}" ]; then
  51. nextdns uninstall
  52. fi
  53. endef
  54. define Package/nextdns/description
  55. Official NextDNS DNS over HTTPS Proxy.
  56. endef
  57. define Package/golang-github-nextdns-nextdns-dev
  58. $(call Package/nextdns)
  59. $(call GoPackage/GoSubMenu)
  60. TITLE+= (source files)
  61. PKGARCH:=all
  62. endef
  63. define Package/golang-github-nextdns-nextdns-dev/description
  64. $(call Package/nextdns/description)
  65. This package provides the source files for the client/bridge program.
  66. endef
  67. $(eval $(call GoBinPackage,nextdns))
  68. $(eval $(call BuildPackage,nextdns))
  69. $(eval $(call GoSrcPackage,golang-github-nextdns-nextdns-dev))
  70. $(eval $(call BuildPackage,golang-github-nextdns-nextdns-dev))