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.

255 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.14.7
  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_LICENSE_FILES:=LICENSE
  16. PKG_CPE_ID:=cpe:/a:isc:bind
  17. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  18. PKG_SOURCE_URL:= \
  19. https://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION) \
  20. https://ftp.isc.org/isc/bind9/$(PKG_VERSION)
  21. PKG_HASH:=cea0f54e5908f77ffd21eb312ee9dd4f3f8f93ca312c6118f27d6c0fba45291d
  22. PKG_FIXUP:=autoreconf
  23. PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
  24. PKG_INSTALL:=1
  25. PKG_USE_MIPS16:=0
  26. PKG_BUILD_PARALLEL:=1
  27. PKG_CONFIG_DEPENDS := \
  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 +libpthread +libatomic
  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-server-filter-aaaa
  66. $(call Package/bind-server)
  67. DEPENDS:=+bind-server
  68. TITLE+= filter AAAA plugin
  69. endef
  70. define Package/bind-client
  71. $(call Package/bind/Default)
  72. TITLE+= dynamic DNS client
  73. endef
  74. define Package/bind-tools
  75. $(call Package/bind/Default)
  76. TITLE+= administration tools (all)
  77. DEPENDS:= \
  78. +bind-check \
  79. +bind-dig \
  80. +bind-dnssec \
  81. +bind-host \
  82. +bind-rndc
  83. endef
  84. define Package/bind-rndc
  85. $(call Package/bind/Default)
  86. TITLE+= administration tools (rndc and rndc-confgen only)
  87. endef
  88. define Package/bind-check
  89. $(call Package/bind/Default)
  90. TITLE+= administration tools (named-checkconf and named-checkzone only)
  91. endef
  92. define Package/bind-dnssec
  93. $(call Package/bind/Default)
  94. TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
  95. endef
  96. define Package/bind-host
  97. $(call Package/bind/Default)
  98. TITLE+= simple DNS client
  99. endef
  100. define Package/bind-dig
  101. $(call Package/bind/Default)
  102. TITLE+= DNS excavation tool
  103. endef
  104. export BUILD_CC="$(TARGET_CC)"
  105. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  106. CONFIGURE_ARGS += \
  107. --disable-linux-caps \
  108. --with-openssl="$(STAGING_DIR)/usr" \
  109. --with-libtool \
  110. --without-lmdb \
  111. --enable-epoll \
  112. --without-gssapi \
  113. --without-readline \
  114. --without-python \
  115. --sysconfdir=/etc/bind
  116. ifdef CONFIG_BIND_LIBJSON
  117. CONFIGURE_ARGS += \
  118. --with-libjson="$(STAGING_DIR)/usr"
  119. else
  120. CONFIGURE_ARGS += \
  121. --without-libjson
  122. endif
  123. ifdef CONFIG_BIND_LIBXML2
  124. CONFIGURE_ARGS += \
  125. --with-libxml2="$(STAGING_DIR)/usr"
  126. else
  127. CONFIGURE_ARGS += \
  128. --without-libxml2
  129. endif
  130. CONFIGURE_VARS += \
  131. BUILD_CC="$(TARGET_CC)" \
  132. define Build/Compile
  133. $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
  134. BUILD_CC="$(HOSTCC)" \
  135. CC="$(HOSTCC)" \
  136. CFLAGS="-O2" \
  137. LIBS="" \
  138. gen
  139. $(call Build/Compile/Default)
  140. endef
  141. define Package/bind-libs/install
  142. $(INSTALL_DIR) $(1)/usr/lib
  143. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
  144. endef
  145. define Package/bind-server/install
  146. $(INSTALL_DIR) $(1)/usr/sbin
  147. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
  148. $(INSTALL_DIR) $(1)/etc/bind
  149. $(CP) \
  150. ./files/bind/db.0 \
  151. ./files/bind/db.127 \
  152. ./files/bind/db.255 \
  153. ./files/bind/db.local \
  154. ./files/bind/db.root \
  155. ./files/bind/bind.keys \
  156. $(1)/etc/bind/
  157. $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
  158. $(INSTALL_DIR) $(1)/etc/init.d
  159. $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
  160. find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
  161. endef
  162. define Package/bind-server/conffiles
  163. /etc/bind/db.0
  164. /etc/bind/db.127
  165. /etc/bind/db.255
  166. /etc/bind/db.local
  167. /etc/bind/db.root
  168. /etc/bind/named.conf
  169. endef
  170. define Package/bind-server-filter-aaaa/install
  171. $(INSTALL_DIR) $(1)/usr/lib/named
  172. $(CP) $(PKG_INSTALL_DIR)/usr/lib/named/filter-aaaa.so $(1)/usr/lib/named
  173. endef
  174. define Package/bind-client/install
  175. $(INSTALL_DIR) $(1)/usr/bin
  176. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
  177. endef
  178. define Package/bind-tools/install
  179. $(INSTALL_DIR) $(1)/usr/bin
  180. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/delv $(1)/usr/bin/
  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-server-filter-aaaa))
  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))