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.

256 lines
6.1 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.8
  11. PKG_RELEASE:=2
  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:=e545aa75ced6695a9bf4b591606ef00260fb3c055c2865b299cfe0fe6eeea076
  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_CFLAGS += -DHAVE_JSON_C -UHAVE_JSON
  106. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  107. CONFIGURE_ARGS += \
  108. --disable-linux-caps \
  109. --with-openssl="$(STAGING_DIR)/usr" \
  110. --with-libtool \
  111. --without-lmdb \
  112. --enable-epoll \
  113. --without-gssapi \
  114. --without-readline \
  115. --without-python \
  116. --sysconfdir=/etc/bind
  117. ifdef CONFIG_BIND_LIBJSON
  118. CONFIGURE_ARGS += \
  119. --with-libjson="$(STAGING_DIR)/usr"
  120. else
  121. CONFIGURE_ARGS += \
  122. --without-libjson
  123. endif
  124. ifdef CONFIG_BIND_LIBXML2
  125. CONFIGURE_ARGS += \
  126. --with-libxml2="$(STAGING_DIR)/usr"
  127. else
  128. CONFIGURE_ARGS += \
  129. --without-libxml2
  130. endif
  131. CONFIGURE_VARS += \
  132. BUILD_CC="$(TARGET_CC)" \
  133. define Build/Compile
  134. $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
  135. BUILD_CC="$(HOSTCC)" \
  136. CC="$(HOSTCC)" \
  137. CFLAGS="-O2" \
  138. LIBS="" \
  139. gen
  140. $(call Build/Compile/Default)
  141. endef
  142. define Package/bind-libs/install
  143. $(INSTALL_DIR) $(1)/usr/lib
  144. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
  145. endef
  146. define Package/bind-server/install
  147. $(INSTALL_DIR) $(1)/usr/sbin
  148. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
  149. $(INSTALL_DIR) $(1)/etc/bind
  150. $(CP) \
  151. ./files/bind/db.0 \
  152. ./files/bind/db.127 \
  153. ./files/bind/db.255 \
  154. ./files/bind/db.local \
  155. ./files/bind/db.root \
  156. ./files/bind/bind.keys \
  157. $(1)/etc/bind/
  158. $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
  159. $(INSTALL_DIR) $(1)/etc/init.d
  160. $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
  161. find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
  162. endef
  163. define Package/bind-server/conffiles
  164. /etc/bind/db.0
  165. /etc/bind/db.127
  166. /etc/bind/db.255
  167. /etc/bind/db.local
  168. /etc/bind/db.root
  169. /etc/bind/named.conf
  170. endef
  171. define Package/bind-server-filter-aaaa/install
  172. $(INSTALL_DIR) $(1)/usr/lib/named
  173. $(CP) $(PKG_INSTALL_DIR)/usr/lib/named/filter-aaaa.so $(1)/usr/lib/named
  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-server-filter-aaaa))
  210. $(eval $(call BuildPackage,bind-client))
  211. $(eval $(call BuildPackage,bind-tools))
  212. $(eval $(call BuildPackage,bind-rndc))
  213. $(eval $(call BuildPackage,bind-check))
  214. $(eval $(call BuildPackage,bind-dnssec))
  215. $(eval $(call BuildPackage,bind-host))
  216. $(eval $(call BuildPackage,bind-dig))