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.

254 lines
6.4 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.3
  11. PKG_RELEASE:=2
  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:=0d9dde14b2ec7f9cdc3b69f19540c7a2e4eee7b6c727965dfae48810965876f5
  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. DEPENDS+= +@OPENSSL_WITH_DEPRECATED
  60. endef
  61. define Package/bind-server/config
  62. source "$(SOURCE)/Config.in"
  63. endef
  64. define Package/bind-client
  65. $(call Package/bind/Default)
  66. TITLE+= dynamic DNS client
  67. endef
  68. define Package/bind-tools
  69. $(call Package/bind/Default)
  70. TITLE+= administration tools (all)
  71. endef
  72. define Package/bind-rndc
  73. $(call Package/bind/Default)
  74. TITLE+= administration tools (rndc and rndc-confgen only)
  75. endef
  76. define Package/bind-check
  77. $(call Package/bind/Default)
  78. TITLE+= administration tools (named-checkconf and named-checkzone only)
  79. endef
  80. define Package/bind-dnssec
  81. $(call Package/bind/Default)
  82. TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
  83. endef
  84. define Package/bind-host
  85. $(call Package/bind/Default)
  86. TITLE+= simple DNS client
  87. endef
  88. define Package/bind-dig
  89. $(call Package/bind/Default)
  90. TITLE+= DNS excavation tool
  91. endef
  92. export BUILD_CC="$(TARGET_CC)"
  93. CONFIGURE_ARGS += \
  94. --enable-shared \
  95. --enable-static \
  96. --with-randomdev="/dev/urandom" \
  97. --disable-threads \
  98. --disable-linux-caps \
  99. --with-openssl="$(STAGING_DIR)/usr" \
  100. --with-libtool \
  101. --without-lmdb \
  102. --enable-epoll=yes \
  103. --with-gost=no \
  104. --with-gssapi=no \
  105. --with-ecdsa=$(if $(CONFIG_OPENSSL_WITH_EC),yes,no) \
  106. --with-eddsa=$(if $(CONFIG_BIND_ENABLE_EDDSA),yes,no) \
  107. --with-readline=no \
  108. --enable-atomic=no \
  109. --sysconfdir=/etc/bind
  110. ifdef CONFIG_BIND_ENABLE_FILTER_AAAA
  111. CONFIGURE_ARGS += \
  112. --enable-filter-aaaa
  113. endif
  114. ifdef CONFIG_BIND_LIBJSON
  115. CONFIGURE_ARGS += \
  116. --with-libjson="$(STAGING_DIR)/usr"
  117. else
  118. CONFIGURE_ARGS += \
  119. --with-libjson=no
  120. endif
  121. ifdef CONFIG_BIND_LIBXML2
  122. CONFIGURE_ARGS += \
  123. --with-libxml2="$(STAGING_DIR)/usr"
  124. else
  125. CONFIGURE_ARGS += \
  126. --with-libxml2=no
  127. endif
  128. CONFIGURE_VARS += \
  129. BUILD_CC="$(TARGET_CC)" \
  130. define Build/Compile
  131. $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
  132. BUILD_CC="$(HOSTCC)" \
  133. CC="$(HOSTCC)" \
  134. CFLAGS="-O2" \
  135. LIBS="" \
  136. gen
  137. $(call Build/Compile/Default)
  138. endef
  139. define Package/bind-libs/install
  140. $(INSTALL_DIR) $(1)/usr/lib
  141. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
  142. endef
  143. define Package/bind-server/install
  144. $(INSTALL_DIR) $(1)/usr/sbin
  145. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
  146. $(INSTALL_DIR) $(1)/etc/bind
  147. $(CP) \
  148. ./files/bind/db.0 \
  149. ./files/bind/db.127 \
  150. ./files/bind/db.255 \
  151. ./files/bind/db.local \
  152. ./files/bind/db.root \
  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_DIR) $(1)/usr/sbin
  176. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
  177. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
  178. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
  179. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
  180. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
  181. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  182. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  183. endef
  184. define Package/bind-rndc/install
  185. $(INSTALL_DIR) $(1)/usr/sbin
  186. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  187. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  188. endef
  189. define Package/bind-check/install
  190. $(INSTALL_DIR) $(1)/usr/sbin
  191. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
  192. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
  193. endef
  194. define Package/bind-dnssec/install
  195. $(INSTALL_DIR) $(1)/usr/sbin
  196. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
  197. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
  198. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
  199. endef
  200. define Package/bind-host/install
  201. $(INSTALL_DIR) $(1)/usr/bin
  202. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
  203. endef
  204. define Package/bind-dig/install
  205. $(INSTALL_DIR) $(1)/usr/bin
  206. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
  207. endef
  208. $(eval $(call BuildPackage,bind-libs))
  209. $(eval $(call BuildPackage,bind-server))
  210. $(eval $(call BuildPackage,bind-client))
  211. $(eval $(call BuildPackage,bind-tools))
  212. $(eval $(call BuildPackage,bind-rndc))
  213. $(eval $(call BuildPackage,bind-check))
  214. $(eval $(call BuildPackage,bind-dnssec))
  215. $(eval $(call BuildPackage,bind-host))
  216. $(eval $(call BuildPackage,bind-dig))