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.11.5-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:=6cd6dbf016569f12d4a0ed629e44e895d9ed41c6908274ed2e617666c5491928
  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. endef
  60. define Package/bind-server/config
  61. source "$(SOURCE)/Config.in"
  62. endef
  63. define Package/bind-client
  64. $(call Package/bind/Default)
  65. TITLE+= dynamic DNS client
  66. endef
  67. define Package/bind-tools
  68. $(call Package/bind/Default)
  69. TITLE+= administration tools (all)
  70. DEPENDS:= \
  71. +bind-check \
  72. +bind-dig \
  73. +bind-dnssec \
  74. +bind-host \
  75. +bind-rndc
  76. endef
  77. define Package/bind-rndc
  78. $(call Package/bind/Default)
  79. TITLE+= administration tools (rndc and rndc-confgen only)
  80. endef
  81. define Package/bind-check
  82. $(call Package/bind/Default)
  83. TITLE+= administration tools (named-checkconf and named-checkzone only)
  84. endef
  85. define Package/bind-dnssec
  86. $(call Package/bind/Default)
  87. TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
  88. endef
  89. define Package/bind-host
  90. $(call Package/bind/Default)
  91. TITLE+= simple DNS client
  92. endef
  93. define Package/bind-dig
  94. $(call Package/bind/Default)
  95. TITLE+= DNS excavation tool
  96. endef
  97. export BUILD_CC="$(TARGET_CC)"
  98. CONFIGURE_ARGS += \
  99. --enable-shared \
  100. --enable-static \
  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))