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.

252 lines
6.3 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.2-P1
  11. PKG_RELEASE:=1
  12. USERID:=bind=57:bind=57
  13. PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>
  14. PKG_LICENSE := BSD-3-Clause
  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:=cec31548832fca3f85d95178d4019b7d702039e8595d4c93914feba337df1212
  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-readline=no \
  107. --sysconfdir=/etc/bind
  108. ifdef CONFIG_BIND_ENABLE_FILTER_AAAA
  109. CONFIGURE_ARGS += \
  110. --enable-filter-aaaa
  111. endif
  112. ifdef CONFIG_BIND_LIBJSON
  113. CONFIGURE_ARGS += \
  114. --with-libjson="$(STAGING_DIR)/usr"
  115. else
  116. CONFIGURE_ARGS += \
  117. --with-libjson=no
  118. endif
  119. ifdef CONFIG_BIND_LIBXML2
  120. CONFIGURE_ARGS += \
  121. --with-libxml2="$(STAGING_DIR)/usr"
  122. else
  123. CONFIGURE_ARGS += \
  124. --with-libxml2=no
  125. endif
  126. CONFIGURE_VARS += \
  127. BUILD_CC="$(TARGET_CC)" \
  128. define Build/Compile
  129. $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
  130. BUILD_CC="$(HOSTCC)" \
  131. CC="$(HOSTCC)" \
  132. CFLAGS="-O2" \
  133. LIBS="" \
  134. gen
  135. $(call Build/Compile/Default)
  136. endef
  137. define Package/bind-libs/install
  138. $(INSTALL_DIR) $(1)/usr/lib
  139. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
  140. endef
  141. define Package/bind-server/install
  142. $(INSTALL_DIR) $(1)/usr/sbin
  143. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
  144. $(INSTALL_DIR) $(1)/etc/bind
  145. $(CP) \
  146. ./files/bind/db.0 \
  147. ./files/bind/db.127 \
  148. ./files/bind/db.255 \
  149. ./files/bind/db.local \
  150. ./files/bind/db.root \
  151. $(1)/etc/bind/
  152. $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
  153. $(INSTALL_DIR) $(1)/etc/init.d
  154. $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
  155. find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
  156. endef
  157. define Package/bind-server/conffiles
  158. /etc/bind/db.0
  159. /etc/bind/db.127
  160. /etc/bind/db.255
  161. /etc/bind/db.local
  162. /etc/bind/db.root
  163. /etc/bind/named.conf
  164. endef
  165. define Package/bind-client/install
  166. $(INSTALL_DIR) $(1)/usr/bin
  167. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
  168. endef
  169. define Package/bind-tools/install
  170. $(INSTALL_DIR) $(1)/usr/bin
  171. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
  172. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
  173. $(INSTALL_DIR) $(1)/usr/sbin
  174. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
  175. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
  176. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
  177. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
  178. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
  179. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  180. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  181. endef
  182. define Package/bind-rndc/install
  183. $(INSTALL_DIR) $(1)/usr/sbin
  184. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  185. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  186. endef
  187. define Package/bind-check/install
  188. $(INSTALL_DIR) $(1)/usr/sbin
  189. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
  190. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
  191. endef
  192. define Package/bind-dnssec/install
  193. $(INSTALL_DIR) $(1)/usr/sbin
  194. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
  195. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
  196. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
  197. endef
  198. define Package/bind-host/install
  199. $(INSTALL_DIR) $(1)/usr/bin
  200. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
  201. endef
  202. define Package/bind-dig/install
  203. $(INSTALL_DIR) $(1)/usr/bin
  204. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
  205. endef
  206. $(eval $(call BuildPackage,bind-libs))
  207. $(eval $(call BuildPackage,bind-server))
  208. $(eval $(call BuildPackage,bind-client))
  209. $(eval $(call BuildPackage,bind-tools))
  210. $(eval $(call BuildPackage,bind-rndc))
  211. $(eval $(call BuildPackage,bind-check))
  212. $(eval $(call BuildPackage,bind-dnssec))
  213. $(eval $(call BuildPackage,bind-host))
  214. $(eval $(call BuildPackage,bind-dig))