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.

90 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.8.6
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_VERSION:=v$(PKG_VERSION)
  13. PKG_SOURCE_URL:=https://github.com/nextdns/nextdns.git
  14. PKG_MIRROR_HASH:=8a98fd998aa5ccd5b3ba6552859563e0f1b8cde59d4bf61ec3ac11f0e8b35d10
  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:=-s -w
  23. GO_PKG_LDFLAGS_X:=main.version=$(PKG_VERSION)
  24. include $(INCLUDE_DIR)/package.mk
  25. include ../../lang/golang/golang-package.mk
  26. define Package/nextdns
  27. SECTION:=net
  28. CATEGORY:=Network
  29. TITLE:=NextDNS DNS over HTTPS Proxy
  30. URL:=https://github.com/nextdns/nextdns
  31. DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
  32. endef
  33. define Package/nextdns/conffiles
  34. /etc/config/nextdns
  35. endef
  36. define Package/nextdns/install
  37. $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
  38. $(INSTALL_DIR) $(1)/usr/sbin
  39. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nextdns $(1)/usr/sbin/
  40. $(INSTALL_DIR) $(1)/etc/config
  41. $(INSTALL_CONF) ./files/nextdns.config $(1)/etc/config/nextdns
  42. endef
  43. define Package/nextdns/postinst
  44. #!/bin/sh
  45. if [ -z "$${IPKG_INSTROOT}" ]; then
  46. nextdns install
  47. fi
  48. endef
  49. define Package/nextdns/prerm
  50. #!/bin/sh
  51. if [ -z "$${IPKG_INSTROOT}" ]; then
  52. nextdns uninstall
  53. fi
  54. endef
  55. define Package/nextdns/description
  56. Official NextDNS DNS over HTTPS Proxy.
  57. endef
  58. define Package/golang-github-nextdns-nextdns-dev
  59. $(call Package/nextdns)
  60. $(call GoPackage/GoSubMenu)
  61. TITLE+= (source files)
  62. PKGARCH:=all
  63. endef
  64. define Package/golang-github-nextdns-nextdns-dev/description
  65. $(call Package/nextdns/description)
  66. This package provides the source files for the client/bridge program.
  67. endef
  68. $(eval $(call GoBinPackage,nextdns))
  69. $(eval $(call BuildPackage,nextdns))
  70. $(eval $(call GoSrcPackage,golang-github-nextdns-nextdns-dev))
  71. $(eval $(call BuildPackage,golang-github-nextdns-nextdns-dev))