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.11
  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:=00de7bad9291121f3b93e70a6959b540b002f742774823c358c7a416c2e2ed4b
  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. endef
  60. define Package/bind-server/config
  61. source "$(SOURCE)/Config.in"
  62. endef
  63. define Package/bind-server-filter-aaaa
  64. $(call Package/bind-server)
  65. DEPENDS:=bind-server
  66. TITLE+= filter AAAA plugin
  67. endef
  68. define Package/bind-client
  69. $(call Package/bind/Default)
  70. TITLE+= dynamic DNS client
  71. endef
  72. define Package/bind-tools
  73. $(call Package/bind/Default)
  74. TITLE+= administration tools (all)
  75. DEPENDS:= \
  76. +bind-check \
  77. +bind-dig \
  78. +bind-nslookup \
  79. +bind-dnssec \
  80. +bind-host \
  81. +bind-rndc
  82. endef
  83. define Package/bind-rndc
  84. $(call Package/bind/Default)
  85. TITLE+= administration tools (rndc and rndc-confgen only)
  86. endef
  87. define Package/bind-check
  88. $(call Package/bind/Default)
  89. TITLE+= administration tools (named-checkconf and named-checkzone only)
  90. endef
  91. define Package/bind-dnssec
  92. $(call Package/bind/Default)
  93. TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
  94. endef
  95. define Package/bind-host
  96. $(call Package/bind/Default)
  97. TITLE+= simple DNS client
  98. endef
  99. define Package/bind-dig
  100. $(call Package/bind/Default)
  101. TITLE+= DNS excavation tool
  102. endef
  103. define Package/bind-nslookup
  104. $(call Package/bind/Default)
  105. TITLE+= nslookup utility
  106. ALTERNATIVES:= \
  107. 200:/usr/bin/nslookup:/usr/libexec/nslookup-bind
  108. endef
  109. export BUILD_CC="$(TARGET_CC)"
  110. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  111. CONFIGURE_ARGS += \
  112. --disable-linux-caps \
  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))