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.

279 lines
6.6 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.18.0
  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:=56525bf5caf01fd8fd9d90910880cc0f8a90a27a97d169187d651d4ecf0c411c
  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_CONFIG_DEPENDS := \
  28. CONFIG_BIND_LIBJSON \
  29. CONFIG_BIND_LIBXML2 \
  30. CONFIG_BIND_ENABLE_DOH
  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. +BIND_ENABLE_DOH: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. ifdef CONFIG_BIND_ENABLE_DOH
  137. CONFIGURE_ARGS += \
  138. --enable-doh
  139. else
  140. CONFIGURE_ARGS += \
  141. --disable-doh
  142. endif
  143. CONFIGURE_VARS += \
  144. BUILD_CC="$(TARGET_CC)" \
  145. define Build/Compile
  146. $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
  147. BUILD_CC="$(HOSTCC)" \
  148. CC="$(HOSTCC)" \
  149. CFLAGS="-O2" \
  150. LIBS="" \
  151. gen
  152. $(call Build/Compile/Default)
  153. endef
  154. define Package/bind-libs/install
  155. $(INSTALL_DIR) $(1)/usr/lib
  156. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
  157. endef
  158. define Package/bind-server/install
  159. $(INSTALL_DIR) $(1)/usr/sbin
  160. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
  161. $(INSTALL_DIR) $(1)/etc/bind
  162. $(CP) \
  163. ./files/bind/db.0 \
  164. ./files/bind/db.127 \
  165. ./files/bind/db.255 \
  166. ./files/bind/db.local \
  167. ./files/bind/db.root \
  168. ./files/bind/bind.keys \
  169. $(1)/etc/bind/
  170. sed -e '1s/ broadcast / empty rfc1918 /' \
  171. < ./files/bind/db.0 \
  172. > $(1)/etc/bind/db.empty
  173. $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
  174. $(INSTALL_DIR) $(1)/etc/init.d
  175. $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
  176. find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
  177. endef
  178. define Package/bind-server/conffiles
  179. /etc/bind/db.0
  180. /etc/bind/db.127
  181. /etc/bind/db.255
  182. /etc/bind/db.local
  183. /etc/bind/db.root
  184. /etc/bind/named.conf
  185. endef
  186. define Package/bind-server-filter-aaaa/install
  187. $(INSTALL_DIR) $(1)/usr/lib/bind
  188. $(CP) $(PKG_INSTALL_DIR)/usr/lib/bind/filter-aaaa.so $(1)/usr/lib/bind
  189. endef
  190. define Package/bind-client/install
  191. $(INSTALL_DIR) $(1)/usr/bin
  192. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
  193. endef
  194. define Package/bind-tools/install
  195. $(INSTALL_DIR) $(1)/usr/bin
  196. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/delv $(1)/usr/bin/
  197. endef
  198. define Package/bind-rndc/install
  199. $(INSTALL_DIR) $(1)/usr/sbin
  200. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  201. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  202. endef
  203. define Package/bind-check/install
  204. $(INSTALL_DIR) $(1)/usr/bin
  205. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/named-checkconf $(1)/usr/bin/
  206. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/named-checkzone $(1)/usr/bin/
  207. endef
  208. define Package/bind-dnssec/install
  209. $(INSTALL_DIR) $(1)/usr/bin
  210. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-keygen $(1)/usr/bin/
  211. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-settime $(1)/usr/bin/
  212. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-signzone $(1)/usr/bin/
  213. endef
  214. define Package/bind-host/install
  215. $(INSTALL_DIR) $(1)/usr/bin
  216. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
  217. endef
  218. define Package/bind-dig/install
  219. $(INSTALL_DIR) $(1)/usr/bin
  220. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
  221. endef
  222. define Package/bind-nslookup/install
  223. $(INSTALL_DIR) $(1)/usr/libexec
  224. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nslookup $(1)/usr/libexec/nslookup-bind
  225. endef
  226. $(eval $(call BuildPackage,bind-libs))
  227. $(eval $(call BuildPackage,bind-server))
  228. $(eval $(call BuildPackage,bind-server-filter-aaaa))
  229. $(eval $(call BuildPackage,bind-client))
  230. $(eval $(call BuildPackage,bind-tools))
  231. $(eval $(call BuildPackage,bind-rndc))
  232. $(eval $(call BuildPackage,bind-check))
  233. $(eval $(call BuildPackage,bind-dnssec))
  234. $(eval $(call BuildPackage,bind-host))
  235. $(eval $(call BuildPackage,bind-dig))
  236. $(eval $(call BuildPackage,bind-nslookup))