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.

255 lines
6.5 KiB

  1. #
  2. # Copyright (C) 2006-2012 OpenWrt.org
  3. # 2014-2017 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.11.5
  11. PKG_RELEASE:=1
  12. USERID:=bind=57:bind=57
  13. PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>
  14. PKG_LICENSE := MPL-2.0
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  16. PKG_SOURCE_URL:= \
  17. http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION) \
  18. http://ftp.isc.org/isc/bind9/$(PKG_VERSION)
  19. PKG_HASH:=a4cae11dad954bdd4eb592178f875bfec09fcc7e29fe0f6b7a4e5b5c6bc61322
  20. PKG_FIXUP:=autoreconf
  21. PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
  22. PKG_INSTALL:=1
  23. PKG_USE_MIPS16:=0
  24. PKG_CONFIG_DEPENDS := \
  25. CONFIG_BIND_ENABLE_FILTER_AAAA \
  26. CONFIG_BIND_LIBJSON \
  27. CONFIG_BIND_LIBXML2
  28. ifdef CONFIG_BIND_LIBXML2
  29. PKG_BUILD_DEPENDS += libxml2
  30. endif
  31. ifdef CONFIG_BIND_LIBJSON
  32. PKG_BUILD_DEPENDS += libjson-c
  33. endif
  34. include $(INCLUDE_DIR)/package.mk
  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 +zlib
  47. TITLE:=bind shared libraries
  48. URL:=https://www.isc.org/software/bind
  49. ifdef CONFIG_BIND_LIBJSON
  50. DEPENDS+= +libjson-c
  51. endif
  52. ifdef CONFIG_BIND_LIBXML2
  53. DEPENDS+= +libxml2
  54. endif
  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-client
  64. $(call Package/bind/Default)
  65. TITLE+= dynamic DNS client
  66. endef
  67. define Package/bind-tools
  68. $(call Package/bind/Default)
  69. TITLE+= administration tools (all)
  70. endef
  71. define Package/bind-rndc
  72. $(call Package/bind/Default)
  73. TITLE+= administration tools (rndc and rndc-confgen only)
  74. endef
  75. define Package/bind-check
  76. $(call Package/bind/Default)
  77. TITLE+= administration tools (named-checkconf and named-checkzone only)
  78. endef
  79. define Package/bind-dnssec
  80. $(call Package/bind/Default)
  81. TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
  82. endef
  83. define Package/bind-host
  84. $(call Package/bind/Default)
  85. TITLE+= simple DNS client
  86. endef
  87. define Package/bind-dig
  88. $(call Package/bind/Default)
  89. TITLE+= DNS excavation tool
  90. endef
  91. export BUILD_CC="$(TARGET_CC)"
  92. CONFIGURE_ARGS += \
  93. --enable-shared \
  94. --enable-static \
  95. --with-randomdev="/dev/urandom" \
  96. --disable-threads \
  97. --disable-linux-caps \
  98. --with-openssl="$(STAGING_DIR)/usr" \
  99. --with-libtool \
  100. --without-lmdb \
  101. --enable-epoll=yes \
  102. --with-gost=no \
  103. --with-gssapi=no \
  104. --with-ecdsa=$(if $(CONFIG_OPENSSL_WITH_EC),yes,no) \
  105. --with-eddsa=$(if $(CONFIG_BIND_ENABLE_EDDSA),yes,no) \
  106. --with-readline=no \
  107. --enable-atomic=no \
  108. --sysconfdir=/etc/bind
  109. ifdef CONFIG_BIND_ENABLE_FILTER_AAAA
  110. CONFIGURE_ARGS += \
  111. --enable-filter-aaaa
  112. endif
  113. ifdef CONFIG_BIND_LIBJSON
  114. CONFIGURE_ARGS += \
  115. --with-libjson="$(STAGING_DIR)/usr"
  116. else
  117. CONFIGURE_ARGS += \
  118. --with-libjson=no
  119. endif
  120. ifdef CONFIG_BIND_LIBXML2
  121. CONFIGURE_ARGS += \
  122. --with-libxml2="$(STAGING_DIR)/usr"
  123. else
  124. CONFIGURE_ARGS += \
  125. --with-libxml2=no
  126. endif
  127. CONFIGURE_VARS += \
  128. BUILD_CC="$(TARGET_CC)" \
  129. define Build/Compile
  130. $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
  131. BUILD_CC="$(HOSTCC)" \
  132. CC="$(HOSTCC)" \
  133. CFLAGS="-O2" \
  134. LIBS="" \
  135. gen
  136. $(call Build/Compile/Default)
  137. endef
  138. define Package/bind-libs/install
  139. $(INSTALL_DIR) $(1)/usr/lib
  140. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
  141. endef
  142. define Package/bind-server/install
  143. $(INSTALL_DIR) $(1)/usr/sbin
  144. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
  145. $(INSTALL_DIR) $(1)/etc/bind
  146. $(CP) \
  147. ./files/bind/db.0 \
  148. ./files/bind/db.127 \
  149. ./files/bind/db.255 \
  150. ./files/bind/db.local \
  151. ./files/bind/db.root \
  152. ./files/bind/bind.keys \
  153. $(1)/etc/bind/
  154. $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
  155. $(INSTALL_DIR) $(1)/etc/init.d
  156. $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
  157. find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
  158. endef
  159. define Package/bind-server/conffiles
  160. /etc/bind/db.0
  161. /etc/bind/db.127
  162. /etc/bind/db.255
  163. /etc/bind/db.local
  164. /etc/bind/db.root
  165. /etc/bind/named.conf
  166. endef
  167. define Package/bind-client/install
  168. $(INSTALL_DIR) $(1)/usr/bin
  169. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
  170. endef
  171. define Package/bind-tools/install
  172. $(INSTALL_DIR) $(1)/usr/bin
  173. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
  174. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
  175. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/delv $(1)/usr/bin/
  176. $(INSTALL_DIR) $(1)/usr/sbin
  177. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
  178. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
  179. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
  180. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
  181. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
  182. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  183. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  184. endef
  185. define Package/bind-rndc/install
  186. $(INSTALL_DIR) $(1)/usr/sbin
  187. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  188. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  189. endef
  190. define Package/bind-check/install
  191. $(INSTALL_DIR) $(1)/usr/sbin
  192. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
  193. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
  194. endef
  195. define Package/bind-dnssec/install
  196. $(INSTALL_DIR) $(1)/usr/sbin
  197. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
  198. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
  199. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
  200. endef
  201. define Package/bind-host/install
  202. $(INSTALL_DIR) $(1)/usr/bin
  203. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
  204. endef
  205. define Package/bind-dig/install
  206. $(INSTALL_DIR) $(1)/usr/bin
  207. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
  208. endef
  209. $(eval $(call BuildPackage,bind-libs))
  210. $(eval $(call BuildPackage,bind-server))
  211. $(eval $(call BuildPackage,bind-client))
  212. $(eval $(call BuildPackage,bind-tools))
  213. $(eval $(call BuildPackage,bind-rndc))
  214. $(eval $(call BuildPackage,bind-check))
  215. $(eval $(call BuildPackage,bind-dnssec))
  216. $(eval $(call BuildPackage,bind-host))
  217. $(eval $(call BuildPackage,bind-dig))