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.

251 lines
5.9 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.12.3-P1
  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. https://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION) \
  18. https://ftp.isc.org/isc/bind9/$(PKG_VERSION)
  19. PKG_HASH:=6cb79389d787368af27f01c65a9fa09be1fd062eda37c94819a1a0178d5ded73
  20. PKG_FIXUP:=autoreconf
  21. PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
  22. PKG_INSTALL:=1
  23. PKG_USE_MIPS16:=0
  24. PKG_BUILD_PARALLEL:=1
  25. PKG_CONFIG_DEPENDS := \
  26. CONFIG_BIND_ENABLE_FILTER_AAAA \
  27. CONFIG_BIND_LIBJSON \
  28. CONFIG_BIND_LIBXML2
  29. ifdef CONFIG_BIND_LIBXML2
  30. PKG_BUILD_DEPENDS += libxml2
  31. endif
  32. ifdef CONFIG_BIND_LIBJSON
  33. PKG_BUILD_DEPENDS += libjson-c
  34. endif
  35. include $(INCLUDE_DIR)/package.mk
  36. define Package/bind/Default
  37. SECTION:=net
  38. CATEGORY:=Network
  39. DEPENDS:=+bind-libs +@OPENSSL_WITH_EC
  40. TITLE:=bind
  41. URL:=https://www.isc.org/software/bind
  42. SUBMENU:=IP Addresses and Names
  43. endef
  44. define Package/bind-libs
  45. SECTION:=libs
  46. CATEGORY:=Libraries
  47. DEPENDS:=+libopenssl +zlib
  48. TITLE:=bind shared libraries
  49. URL:=https://www.isc.org/software/bind
  50. ifdef CONFIG_BIND_LIBJSON
  51. DEPENDS+= +libjson-c
  52. endif
  53. ifdef CONFIG_BIND_LIBXML2
  54. DEPENDS+= +libxml2
  55. endif
  56. endef
  57. define Package/bind-server
  58. $(call Package/bind/Default)
  59. TITLE+= DNS server
  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. DEPENDS:= \
  72. +bind-check \
  73. +bind-dig \
  74. +bind-dnssec \
  75. +bind-host \
  76. +bind-rndc
  77. endef
  78. define Package/bind-rndc
  79. $(call Package/bind/Default)
  80. TITLE+= administration tools (rndc and rndc-confgen only)
  81. endef
  82. define Package/bind-check
  83. $(call Package/bind/Default)
  84. TITLE+= administration tools (named-checkconf and named-checkzone only)
  85. endef
  86. define Package/bind-dnssec
  87. $(call Package/bind/Default)
  88. TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
  89. endef
  90. define Package/bind-host
  91. $(call Package/bind/Default)
  92. TITLE+= simple DNS client
  93. endef
  94. define Package/bind-dig
  95. $(call Package/bind/Default)
  96. TITLE+= DNS excavation tool
  97. endef
  98. export BUILD_CC="$(TARGET_CC)"
  99. CONFIGURE_ARGS += \
  100. --enable-ipv6=$(if $(CONFIG_IPV6),yes,no) \
  101. --with-randomdev="/dev/urandom" \
  102. --disable-threads \
  103. --disable-linux-caps \
  104. --with-openssl="$(STAGING_DIR)/usr" \
  105. --with-libtool \
  106. --without-lmdb \
  107. --enable-epoll=yes \
  108. --with-gost=no \
  109. --with-gssapi=no \
  110. --with-ecdsa=$(if $(CONFIG_OPENSSL_WITH_EC),yes,no) \
  111. --with-eddsa=$(if $(CONFIG_BIND_ENABLE_EDDSA),yes,no) \
  112. --with-readline=no \
  113. --enable-atomic=no \
  114. --sysconfdir=/etc/bind
  115. ifdef CONFIG_BIND_ENABLE_FILTER_AAAA
  116. CONFIGURE_ARGS += \
  117. --enable-filter-aaaa
  118. endif
  119. ifdef CONFIG_BIND_LIBJSON
  120. CONFIGURE_ARGS += \
  121. --with-libjson="$(STAGING_DIR)/usr"
  122. else
  123. CONFIGURE_ARGS += \
  124. --with-libjson=no
  125. endif
  126. ifdef CONFIG_BIND_LIBXML2
  127. CONFIGURE_ARGS += \
  128. --with-libxml2="$(STAGING_DIR)/usr"
  129. else
  130. CONFIGURE_ARGS += \
  131. --with-libxml2=no
  132. endif
  133. CONFIGURE_VARS += \
  134. BUILD_CC="$(TARGET_CC)" \
  135. define Build/Compile
  136. $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
  137. BUILD_CC="$(HOSTCC)" \
  138. CC="$(HOSTCC)" \
  139. CFLAGS="-O2" \
  140. LIBS="" \
  141. gen
  142. $(call Build/Compile/Default)
  143. endef
  144. define Package/bind-libs/install
  145. $(INSTALL_DIR) $(1)/usr/lib
  146. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
  147. endef
  148. define Package/bind-server/install
  149. $(INSTALL_DIR) $(1)/usr/sbin
  150. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
  151. $(INSTALL_DIR) $(1)/etc/bind
  152. $(CP) \
  153. ./files/bind/db.0 \
  154. ./files/bind/db.127 \
  155. ./files/bind/db.255 \
  156. ./files/bind/db.local \
  157. ./files/bind/db.root \
  158. ./files/bind/bind.keys \
  159. $(1)/etc/bind/
  160. $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
  161. $(INSTALL_DIR) $(1)/etc/init.d
  162. $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
  163. find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
  164. endef
  165. define Package/bind-server/conffiles
  166. /etc/bind/db.0
  167. /etc/bind/db.127
  168. /etc/bind/db.255
  169. /etc/bind/db.local
  170. /etc/bind/db.root
  171. /etc/bind/named.conf
  172. endef
  173. define Package/bind-client/install
  174. $(INSTALL_DIR) $(1)/usr/bin
  175. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
  176. endef
  177. define Package/bind-tools/install
  178. $(INSTALL_DIR) $(1)/usr/bin
  179. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/delv $(1)/usr/bin/
  180. endef
  181. define Package/bind-rndc/install
  182. $(INSTALL_DIR) $(1)/usr/sbin
  183. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  184. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  185. endef
  186. define Package/bind-check/install
  187. $(INSTALL_DIR) $(1)/usr/sbin
  188. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
  189. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
  190. endef
  191. define Package/bind-dnssec/install
  192. $(INSTALL_DIR) $(1)/usr/sbin
  193. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
  194. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
  195. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
  196. endef
  197. define Package/bind-host/install
  198. $(INSTALL_DIR) $(1)/usr/bin
  199. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
  200. endef
  201. define Package/bind-dig/install
  202. $(INSTALL_DIR) $(1)/usr/bin
  203. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
  204. endef
  205. $(eval $(call BuildPackage,bind-libs))
  206. $(eval $(call BuildPackage,bind-server))
  207. $(eval $(call BuildPackage,bind-client))
  208. $(eval $(call BuildPackage,bind-tools))
  209. $(eval $(call BuildPackage,bind-rndc))
  210. $(eval $(call BuildPackage,bind-check))
  211. $(eval $(call BuildPackage,bind-dnssec))
  212. $(eval $(call BuildPackage,bind-host))
  213. $(eval $(call BuildPackage,bind-dig))