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.

246 lines
5.9 KiB

  1. #
  2. # Copyright (C) 2006-2012 OpenWrt.org
  3. # 2014-2020 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.16.1
  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.xz
  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:=a913d7e78135b9123d233215b58102fa0f18130fb1e158465a1c2b6f3bd75e91
  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. PKG_BUILD_DEPENDS += BIND_LIBXML2:libxml2 BIND_LIBJSON:libjson-c
  31. include $(INCLUDE_DIR)/package.mk
  32. define Package/bind/Default
  33. SECTION:=net
  34. CATEGORY:=Network
  35. DEPENDS:=+bind-libs +@OPENSSL_WITH_EC
  36. TITLE:=bind
  37. URL:=https://www.isc.org/software/bind
  38. SUBMENU:=IP Addresses and Names
  39. endef
  40. define Package/bind-libs
  41. SECTION:=libs
  42. CATEGORY:=Libraries
  43. DEPENDS:=+libopenssl +zlib +libpthread +libatomic +libuv \
  44. +BIND_LIBXML2:libxml2 +BIND_LIBJSON:libjson-c
  45. TITLE:=bind shared libraries
  46. URL:=https://www.isc.org/software/bind
  47. endef
  48. define Package/bind-server
  49. $(call Package/bind/Default)
  50. TITLE+= DNS server
  51. endef
  52. define Package/bind-server/config
  53. source "$(SOURCE)/Config.in"
  54. endef
  55. define Package/bind-server-filter-aaaa
  56. $(call Package/bind-server)
  57. DEPENDS:=bind-server
  58. TITLE+= filter AAAA plugin
  59. endef
  60. define Package/bind-client
  61. $(call Package/bind/Default)
  62. TITLE+= dynamic DNS client
  63. endef
  64. define Package/bind-tools
  65. $(call Package/bind/Default)
  66. TITLE+= administration tools (all)
  67. DEPENDS:= \
  68. +bind-check \
  69. +bind-dig \
  70. +bind-dnssec \
  71. +bind-host \
  72. +bind-rndc
  73. endef
  74. define Package/bind-rndc
  75. $(call Package/bind/Default)
  76. TITLE+= administration tools (rndc and rndc-confgen only)
  77. endef
  78. define Package/bind-check
  79. $(call Package/bind/Default)
  80. TITLE+= administration tools (named-checkconf and named-checkzone only)
  81. endef
  82. define Package/bind-dnssec
  83. $(call Package/bind/Default)
  84. TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
  85. endef
  86. define Package/bind-host
  87. $(call Package/bind/Default)
  88. TITLE+= simple DNS client
  89. endef
  90. define Package/bind-dig
  91. $(call Package/bind/Default)
  92. TITLE+= DNS excavation tool
  93. endef
  94. export BUILD_CC="$(TARGET_CC)"
  95. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  96. CONFIGURE_ARGS += \
  97. --disable-linux-caps \
  98. --with-openssl="$(STAGING_DIR)/usr" \
  99. --with-libtool \
  100. --without-lmdb \
  101. --enable-epoll \
  102. --without-gssapi \
  103. --without-readline \
  104. --without-python \
  105. --sysconfdir=/etc/bind
  106. ifdef CONFIG_BIND_LIBJSON
  107. TARGET_CFLAGS += -DHAVE_JSON_C -UHAVE_JSON
  108. CONFIGURE_ARGS += \
  109. --with-json-c=yes
  110. else
  111. CONFIGURE_ARGS += \
  112. --with-json-c=no
  113. endif
  114. ifdef CONFIG_BIND_LIBXML2
  115. CONFIGURE_ARGS += \
  116. --with-libxml2=yes
  117. else
  118. CONFIGURE_ARGS += \
  119. --with-libxml2=no
  120. endif
  121. CONFIGURE_VARS += \
  122. BUILD_CC="$(TARGET_CC)" \
  123. define Build/Compile
  124. $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
  125. BUILD_CC="$(HOSTCC)" \
  126. CC="$(HOSTCC)" \
  127. CFLAGS="-O2" \
  128. LIBS="" \
  129. gen
  130. $(call Build/Compile/Default)
  131. endef
  132. define Package/bind-libs/install
  133. $(INSTALL_DIR) $(1)/usr/lib
  134. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
  135. endef
  136. define Package/bind-server/install
  137. $(INSTALL_DIR) $(1)/usr/sbin
  138. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
  139. $(INSTALL_DIR) $(1)/etc/bind
  140. $(CP) \
  141. ./files/bind/db.0 \
  142. ./files/bind/db.127 \
  143. ./files/bind/db.255 \
  144. ./files/bind/db.local \
  145. ./files/bind/db.root \
  146. ./files/bind/bind.keys \
  147. $(1)/etc/bind/
  148. $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
  149. $(INSTALL_DIR) $(1)/etc/init.d
  150. $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
  151. find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
  152. endef
  153. define Package/bind-server/conffiles
  154. /etc/bind/db.0
  155. /etc/bind/db.127
  156. /etc/bind/db.255
  157. /etc/bind/db.local
  158. /etc/bind/db.root
  159. /etc/bind/named.conf
  160. endef
  161. define Package/bind-server-filter-aaaa/install
  162. $(INSTALL_DIR) $(1)/usr/lib/named
  163. $(CP) $(PKG_INSTALL_DIR)/usr/lib/named/filter-aaaa.so $(1)/usr/lib/named
  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/delv $(1)/usr/bin/
  172. endef
  173. define Package/bind-rndc/install
  174. $(INSTALL_DIR) $(1)/usr/sbin
  175. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  176. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  177. endef
  178. define Package/bind-check/install
  179. $(INSTALL_DIR) $(1)/usr/sbin
  180. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
  181. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
  182. endef
  183. define Package/bind-dnssec/install
  184. $(INSTALL_DIR) $(1)/usr/sbin
  185. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
  186. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
  187. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
  188. endef
  189. define Package/bind-host/install
  190. $(INSTALL_DIR) $(1)/usr/bin
  191. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
  192. endef
  193. define Package/bind-dig/install
  194. $(INSTALL_DIR) $(1)/usr/bin
  195. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
  196. endef
  197. $(eval $(call BuildPackage,bind-libs))
  198. $(eval $(call BuildPackage,bind-server))
  199. $(eval $(call BuildPackage,bind-server-filter-aaaa))
  200. $(eval $(call BuildPackage,bind-client))
  201. $(eval $(call BuildPackage,bind-tools))
  202. $(eval $(call BuildPackage,bind-rndc))
  203. $(eval $(call BuildPackage,bind-check))
  204. $(eval $(call BuildPackage,bind-dnssec))
  205. $(eval $(call BuildPackage,bind-host))
  206. $(eval $(call BuildPackage,bind-dig))