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.1
  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:=57c7afd871694d615cb4defb1c1bd6ed023350943d7458414db8d493ef560427
  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. DISABLE_NLS:=
  35. define Package/bind/Default
  36. SECTION:=net
  37. CATEGORY:=Network
  38. DEPENDS:=+bind-libs +@OPENSSL_WITH_EC
  39. TITLE:=bind
  40. URL:=https://www.isc.org/software/bind
  41. SUBMENU:=IP Addresses and Names
  42. endef
  43. define Package/bind-libs
  44. SECTION:=libs
  45. CATEGORY:=Libraries
  46. DEPENDS:=+libopenssl \
  47. +zlib \
  48. +libpthread \
  49. +libatomic \
  50. +libuv \
  51. +BIND_ENABLE_DOH:libnghttp2 \
  52. +BIND_LIBXML2:libxml2 \
  53. +BIND_LIBJSON:libjson-c
  54. TITLE:=bind shared libraries
  55. URL:=https://www.isc.org/software/bind
  56. endef
  57. define Package/bind-server
  58. $(call Package/bind/Default)
  59. TITLE+= DNS server
  60. DEPENDS+= +libcap
  61. endef
  62. define Package/bind-server/config
  63. source "$(SOURCE)/Config.in"
  64. endef
  65. define Package/bind-server-filter-aaaa
  66. $(call Package/bind-server)
  67. DEPENDS:=bind-server
  68. TITLE+= filter AAAA plugin
  69. endef
  70. define Package/bind-client
  71. $(call Package/bind/Default)
  72. TITLE+= dynamic DNS client
  73. endef
  74. define Package/bind-tools
  75. $(call Package/bind/Default)
  76. TITLE+= administration tools (all)
  77. DEPENDS:= \
  78. +bind-check \
  79. +bind-dig \
  80. +bind-nslookup \
  81. +bind-dnssec \
  82. +bind-host \
  83. +bind-rndc
  84. endef
  85. define Package/bind-rndc
  86. $(call Package/bind/Default)
  87. TITLE+= administration tools (rndc and rndc-confgen only)
  88. endef
  89. define Package/bind-check
  90. $(call Package/bind/Default)
  91. TITLE+= administration tools (named-checkconf and named-checkzone only)
  92. endef
  93. define Package/bind-dnssec
  94. $(call Package/bind/Default)
  95. TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
  96. endef
  97. define Package/bind-host
  98. $(call Package/bind/Default)
  99. TITLE+= simple DNS client
  100. endef
  101. define Package/bind-dig
  102. $(call Package/bind/Default)
  103. TITLE+= DNS excavation tool
  104. endef
  105. define Package/bind-nslookup
  106. $(call Package/bind/Default)
  107. TITLE+= nslookup utility
  108. ALTERNATIVES:= \
  109. 200:/usr/bin/nslookup:/usr/libexec/nslookup-bind
  110. endef
  111. export BUILD_CC="$(TARGET_CC)"
  112. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  113. CONFIGURE_ARGS += \
  114. --with-openssl="$(STAGING_DIR)/usr" \
  115. --without-lmdb \
  116. --enable-epoll \
  117. --without-gssapi \
  118. --without-readline \
  119. --sysconfdir=/etc/bind
  120. ifdef CONFIG_BIND_LIBJSON
  121. TARGET_CFLAGS += -DHAVE_JSON_C -UHAVE_JSON
  122. CONFIGURE_ARGS += \
  123. --with-json-c=yes
  124. else
  125. CONFIGURE_ARGS += \
  126. --with-json-c=no
  127. endif
  128. ifdef CONFIG_BIND_LIBXML2
  129. CONFIGURE_ARGS += \
  130. --with-libxml2=yes
  131. else
  132. CONFIGURE_ARGS += \
  133. --with-libxml2=no
  134. endif
  135. ifdef CONFIG_BIND_ENABLE_DOH
  136. CONFIGURE_ARGS += \
  137. --enable-doh
  138. else
  139. CONFIGURE_ARGS += \
  140. --disable-doh
  141. endif
  142. CONFIGURE_VARS += \
  143. BUILD_CC="$(TARGET_CC)" \
  144. define Build/Compile
  145. $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
  146. BUILD_CC="$(HOSTCC)" \
  147. CC="$(HOSTCC)" \
  148. CFLAGS="-O2" \
  149. LIBS="" \
  150. gen
  151. $(call Build/Compile/Default)
  152. endef
  153. define Package/bind-libs/install
  154. $(INSTALL_DIR) $(1)/usr/lib
  155. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
  156. endef
  157. define Package/bind-server/install
  158. $(INSTALL_DIR) $(1)/usr/sbin
  159. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
  160. $(INSTALL_DIR) $(1)/etc/bind
  161. $(CP) \
  162. ./files/bind/db.0 \
  163. ./files/bind/db.127 \
  164. ./files/bind/db.255 \
  165. ./files/bind/db.local \
  166. ./files/bind/db.root \
  167. ./files/bind/bind.keys \
  168. $(1)/etc/bind/
  169. sed -e '1s/ broadcast / empty rfc1918 /' \
  170. < ./files/bind/db.0 \
  171. > $(1)/etc/bind/db.empty
  172. $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
  173. $(INSTALL_DIR) $(1)/etc/init.d
  174. $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
  175. find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
  176. endef
  177. define Package/bind-server/conffiles
  178. /etc/bind/db.0
  179. /etc/bind/db.127
  180. /etc/bind/db.255
  181. /etc/bind/db.local
  182. /etc/bind/db.root
  183. /etc/bind/named.conf
  184. endef
  185. define Package/bind-server-filter-aaaa/install
  186. $(INSTALL_DIR) $(1)/usr/lib/bind
  187. $(CP) $(PKG_INSTALL_DIR)/usr/lib/bind/filter-aaaa.so $(1)/usr/lib/bind
  188. endef
  189. define Package/bind-client/install
  190. $(INSTALL_DIR) $(1)/usr/bin
  191. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
  192. endef
  193. define Package/bind-tools/install
  194. $(INSTALL_DIR) $(1)/usr/bin
  195. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/delv $(1)/usr/bin/
  196. endef
  197. define Package/bind-rndc/install
  198. $(INSTALL_DIR) $(1)/usr/sbin
  199. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  200. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  201. endef
  202. define Package/bind-check/install
  203. $(INSTALL_DIR) $(1)/usr/bin
  204. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/named-checkconf $(1)/usr/bin/
  205. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/named-checkzone $(1)/usr/bin/
  206. endef
  207. define Package/bind-dnssec/install
  208. $(INSTALL_DIR) $(1)/usr/bin
  209. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-keygen $(1)/usr/bin/
  210. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-settime $(1)/usr/bin/
  211. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-signzone $(1)/usr/bin/
  212. endef
  213. define Package/bind-host/install
  214. $(INSTALL_DIR) $(1)/usr/bin
  215. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
  216. endef
  217. define Package/bind-dig/install
  218. $(INSTALL_DIR) $(1)/usr/bin
  219. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
  220. endef
  221. define Package/bind-nslookup/install
  222. $(INSTALL_DIR) $(1)/usr/libexec
  223. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nslookup $(1)/usr/libexec/nslookup-bind
  224. endef
  225. $(eval $(call BuildPackage,bind-libs))
  226. $(eval $(call BuildPackage,bind-server))
  227. $(eval $(call BuildPackage,bind-server-filter-aaaa))
  228. $(eval $(call BuildPackage,bind-client))
  229. $(eval $(call BuildPackage,bind-tools))
  230. $(eval $(call BuildPackage,bind-rndc))
  231. $(eval $(call BuildPackage,bind-check))
  232. $(eval $(call BuildPackage,bind-dnssec))
  233. $(eval $(call BuildPackage,bind-host))
  234. $(eval $(call BuildPackage,bind-dig))
  235. $(eval $(call BuildPackage,bind-nslookup))