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.

253 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:=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:=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. --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. $(1)/etc/bind/
  153. $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
  154. $(INSTALL_DIR) $(1)/etc/init.d
  155. $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
  156. find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
  157. endef
  158. define Package/bind-server/conffiles
  159. /etc/bind/db.0
  160. /etc/bind/db.127
  161. /etc/bind/db.255
  162. /etc/bind/db.local
  163. /etc/bind/db.root
  164. /etc/bind/named.conf
  165. endef
  166. define Package/bind-client/install
  167. $(INSTALL_DIR) $(1)/usr/bin
  168. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
  169. endef
  170. define Package/bind-tools/install
  171. $(INSTALL_DIR) $(1)/usr/bin
  172. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
  173. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
  174. $(INSTALL_DIR) $(1)/usr/sbin
  175. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
  176. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
  177. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
  178. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
  179. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
  180. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  181. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  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))