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.

272 lines
6.5 KiB

  1. #
  2. # Copyright (C) 2006-2012 OpenWrt.org
  3. # 2014-2020 Noah Meyerhans <frodo@morgul.net>
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=bind
  10. PKG_VERSION:=9.17.20
  11. PKG_RELEASE:=$(AUTORELEASE)
  12. USERID:=bind=57:bind=57
  13. PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>
  14. PKG_LICENSE:=MPL-2.0
  15. PKG_LICENSE_FILES:=LICENSE
  16. PKG_CPE_ID:=cpe:/a:isc:bind
  17. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  18. PKG_SOURCE_URL:= \
  19. https://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION) \
  20. https://ftp.isc.org/isc/bind9/$(PKG_VERSION)
  21. PKG_HASH:=93a961f6b4072af260c5d900299eb660defec035f9a000c864ea5b78869a4d35
  22. PKG_FIXUP:=autoreconf
  23. PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
  24. PKG_INSTALL:=1
  25. PKG_USE_MIPS16:=0
  26. PKG_BUILD_PARALLEL:=1
  27. PKG_BUILD_DEPENDS:=nghttp2
  28. PKG_CONFIG_DEPENDS := \
  29. CONFIG_BIND_LIBJSON \
  30. CONFIG_BIND_LIBXML2
  31. PKG_BUILD_DEPENDS += BIND_LIBXML2:libxml2 BIND_LIBJSON:libjson-c
  32. include $(INCLUDE_DIR)/package.mk
  33. include $(INCLUDE_DIR)/nls.mk
  34. define Package/bind/Default
  35. SECTION:=net
  36. CATEGORY:=Network
  37. DEPENDS:=+bind-libs +@OPENSSL_WITH_EC
  38. TITLE:=bind
  39. URL:=https://www.isc.org/software/bind
  40. SUBMENU:=IP Addresses and Names
  41. endef
  42. define Package/bind-libs
  43. SECTION:=libs
  44. CATEGORY:=Libraries
  45. DEPENDS:=+libopenssl \
  46. +zlib \
  47. +libpthread \
  48. +libatomic \
  49. +libuv \
  50. +libnghttp2 \
  51. +BIND_LIBXML2:libxml2 \
  52. +BIND_LIBJSON:libjson-c
  53. TITLE:=bind shared libraries
  54. URL:=https://www.isc.org/software/bind
  55. endef
  56. define Package/bind-server
  57. $(call Package/bind/Default)
  58. TITLE+= DNS server
  59. DEPENDS+= libcap
  60. endef
  61. define Package/bind-server/config
  62. source "$(SOURCE)/Config.in"
  63. endef
  64. define Package/bind-server-filter-aaaa
  65. $(call Package/bind-server)
  66. DEPENDS:=bind-server
  67. TITLE+= filter AAAA plugin
  68. endef
  69. define Package/bind-client
  70. $(call Package/bind/Default)
  71. TITLE+= dynamic DNS client
  72. endef
  73. define Package/bind-tools
  74. $(call Package/bind/Default)
  75. TITLE+= administration tools (all)
  76. DEPENDS:= \
  77. +bind-check \
  78. +bind-dig \
  79. +bind-nslookup \
  80. +bind-dnssec \
  81. +bind-host \
  82. +bind-rndc
  83. endef
  84. define Package/bind-rndc
  85. $(call Package/bind/Default)
  86. TITLE+= administration tools (rndc and rndc-confgen only)
  87. endef
  88. define Package/bind-check
  89. $(call Package/bind/Default)
  90. TITLE+= administration tools (named-checkconf and named-checkzone only)
  91. endef
  92. define Package/bind-dnssec
  93. $(call Package/bind/Default)
  94. TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
  95. endef
  96. define Package/bind-host
  97. $(call Package/bind/Default)
  98. TITLE+= simple DNS client
  99. endef
  100. define Package/bind-dig
  101. $(call Package/bind/Default)
  102. TITLE+= DNS excavation tool
  103. endef
  104. define Package/bind-nslookup
  105. $(call Package/bind/Default)
  106. TITLE+= nslookup utility
  107. ALTERNATIVES:= \
  108. 200:/usr/bin/nslookup:/usr/libexec/nslookup-bind
  109. endef
  110. export BUILD_CC="$(TARGET_CC)"
  111. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  112. CONFIGURE_ARGS += \
  113. --with-openssl="$(STAGING_DIR)/usr" \
  114. --with-libtool \
  115. --without-lmdb \
  116. --enable-epoll \
  117. --without-gssapi \
  118. --without-readline \
  119. --without-python \
  120. --sysconfdir=/etc/bind
  121. ifdef CONFIG_BIND_LIBJSON
  122. TARGET_CFLAGS += -DHAVE_JSON_C -UHAVE_JSON
  123. CONFIGURE_ARGS += \
  124. --with-json-c=yes
  125. else
  126. CONFIGURE_ARGS += \
  127. --with-json-c=no
  128. endif
  129. ifdef CONFIG_BIND_LIBXML2
  130. CONFIGURE_ARGS += \
  131. --with-libxml2=yes
  132. else
  133. CONFIGURE_ARGS += \
  134. --with-libxml2=no
  135. endif
  136. CONFIGURE_VARS += \
  137. BUILD_CC="$(TARGET_CC)" \
  138. define Build/Compile
  139. $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
  140. BUILD_CC="$(HOSTCC)" \
  141. CC="$(HOSTCC)" \
  142. CFLAGS="-O2" \
  143. LIBS="" \
  144. gen
  145. $(call Build/Compile/Default)
  146. endef
  147. define Package/bind-libs/install
  148. $(INSTALL_DIR) $(1)/usr/lib
  149. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
  150. endef
  151. define Package/bind-server/install
  152. $(INSTALL_DIR) $(1)/usr/sbin
  153. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
  154. $(INSTALL_DIR) $(1)/etc/bind
  155. $(CP) \
  156. ./files/bind/db.0 \
  157. ./files/bind/db.127 \
  158. ./files/bind/db.255 \
  159. ./files/bind/db.local \
  160. ./files/bind/db.root \
  161. ./files/bind/bind.keys \
  162. $(1)/etc/bind/
  163. sed -e '1s/ broadcast / empty rfc1918 /' \
  164. < ./files/bind/db.0 \
  165. > $(1)/etc/bind/db.empty
  166. $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
  167. $(INSTALL_DIR) $(1)/etc/init.d
  168. $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
  169. find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
  170. endef
  171. define Package/bind-server/conffiles
  172. /etc/bind/db.0
  173. /etc/bind/db.127
  174. /etc/bind/db.255
  175. /etc/bind/db.local
  176. /etc/bind/db.root
  177. /etc/bind/named.conf
  178. endef
  179. define Package/bind-server-filter-aaaa/install
  180. $(INSTALL_DIR) $(1)/usr/lib/bind
  181. $(CP) $(PKG_INSTALL_DIR)/usr/lib/bind/filter-aaaa.so $(1)/usr/lib/bind
  182. endef
  183. define Package/bind-client/install
  184. $(INSTALL_DIR) $(1)/usr/bin
  185. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
  186. endef
  187. define Package/bind-tools/install
  188. $(INSTALL_DIR) $(1)/usr/bin
  189. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/delv $(1)/usr/bin/
  190. endef
  191. define Package/bind-rndc/install
  192. $(INSTALL_DIR) $(1)/usr/sbin
  193. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  194. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  195. endef
  196. define Package/bind-check/install
  197. $(INSTALL_DIR) $(1)/usr/bin
  198. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/named-checkconf $(1)/usr/bin/
  199. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/named-checkzone $(1)/usr/bin/
  200. endef
  201. define Package/bind-dnssec/install
  202. $(INSTALL_DIR) $(1)/usr/bin
  203. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-keygen $(1)/usr/bin/
  204. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-settime $(1)/usr/bin/
  205. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-signzone $(1)/usr/bin/
  206. endef
  207. define Package/bind-host/install
  208. $(INSTALL_DIR) $(1)/usr/bin
  209. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
  210. endef
  211. define Package/bind-dig/install
  212. $(INSTALL_DIR) $(1)/usr/bin
  213. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
  214. endef
  215. define Package/bind-nslookup/install
  216. $(INSTALL_DIR) $(1)/usr/libexec
  217. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nslookup $(1)/usr/libexec/nslookup-bind
  218. endef
  219. $(eval $(call BuildPackage,bind-libs))
  220. $(eval $(call BuildPackage,bind-server))
  221. $(eval $(call BuildPackage,bind-server-filter-aaaa))
  222. $(eval $(call BuildPackage,bind-client))
  223. $(eval $(call BuildPackage,bind-tools))
  224. $(eval $(call BuildPackage,bind-rndc))
  225. $(eval $(call BuildPackage,bind-check))
  226. $(eval $(call BuildPackage,bind-dnssec))
  227. $(eval $(call BuildPackage,bind-host))
  228. $(eval $(call BuildPackage,bind-dig))
  229. $(eval $(call BuildPackage,bind-nslookup))