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