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.

260 lines
6.3 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.3
  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.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:=27ac6513de5f8d0db34b9f241da53baa15a14b2ad21338d0cde0826eaf564f7e
  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-nslookup \
  71. +bind-dnssec \
  72. +bind-host \
  73. +bind-rndc
  74. endef
  75. define Package/bind-rndc
  76. $(call Package/bind/Default)
  77. TITLE+= administration tools (rndc and rndc-confgen only)
  78. endef
  79. define Package/bind-check
  80. $(call Package/bind/Default)
  81. TITLE+= administration tools (named-checkconf and named-checkzone only)
  82. endef
  83. define Package/bind-dnssec
  84. $(call Package/bind/Default)
  85. TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
  86. endef
  87. define Package/bind-host
  88. $(call Package/bind/Default)
  89. TITLE+= simple DNS client
  90. endef
  91. define Package/bind-dig
  92. $(call Package/bind/Default)
  93. TITLE+= DNS excavation tool
  94. endef
  95. define Package/bind-nslookup
  96. $(call Package/bind/Default)
  97. TITLE+= nslookup utility
  98. ALTERNATIVES:= \
  99. 200:/usr/bin/nslookup:/usr/libexec/nslookup-bind
  100. endef
  101. export BUILD_CC="$(TARGET_CC)"
  102. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  103. CONFIGURE_ARGS += \
  104. --disable-linux-caps \
  105. --with-openssl="$(STAGING_DIR)/usr" \
  106. --with-libtool \
  107. --without-lmdb \
  108. --enable-epoll \
  109. --without-gssapi \
  110. --without-readline \
  111. --without-python \
  112. --sysconfdir=/etc/bind
  113. ifdef CONFIG_BIND_LIBJSON
  114. TARGET_CFLAGS += -DHAVE_JSON_C -UHAVE_JSON
  115. CONFIGURE_ARGS += \
  116. --with-json-c=yes
  117. else
  118. CONFIGURE_ARGS += \
  119. --with-json-c=no
  120. endif
  121. ifdef CONFIG_BIND_LIBXML2
  122. CONFIGURE_ARGS += \
  123. --with-libxml2=yes
  124. else
  125. CONFIGURE_ARGS += \
  126. --with-libxml2=no
  127. endif
  128. CONFIGURE_VARS += \
  129. BUILD_CC="$(TARGET_CC)" \
  130. define Build/Compile
  131. $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
  132. BUILD_CC="$(HOSTCC)" \
  133. CC="$(HOSTCC)" \
  134. CFLAGS="-O2" \
  135. LIBS="" \
  136. gen
  137. $(call Build/Compile/Default)
  138. endef
  139. define Package/bind-libs/install
  140. $(INSTALL_DIR) $(1)/usr/lib
  141. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
  142. endef
  143. define Package/bind-server/install
  144. $(INSTALL_DIR) $(1)/usr/sbin
  145. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
  146. $(INSTALL_DIR) $(1)/etc/bind
  147. $(CP) \
  148. ./files/bind/db.0 \
  149. ./files/bind/db.127 \
  150. ./files/bind/db.255 \
  151. ./files/bind/db.local \
  152. ./files/bind/db.root \
  153. ./files/bind/bind.keys \
  154. $(1)/etc/bind/
  155. $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
  156. $(INSTALL_DIR) $(1)/etc/init.d
  157. $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
  158. find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
  159. endef
  160. define Package/bind-server/conffiles
  161. /etc/bind/db.0
  162. /etc/bind/db.127
  163. /etc/bind/db.255
  164. /etc/bind/db.local
  165. /etc/bind/db.root
  166. /etc/bind/named.conf
  167. endef
  168. define Package/bind-server-filter-aaaa/install
  169. $(INSTALL_DIR) $(1)/usr/lib/named
  170. $(CP) $(PKG_INSTALL_DIR)/usr/lib/named/filter-aaaa.so $(1)/usr/lib/named
  171. endef
  172. define Package/bind-client/install
  173. $(INSTALL_DIR) $(1)/usr/bin
  174. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
  175. endef
  176. define Package/bind-tools/install
  177. $(INSTALL_DIR) $(1)/usr/bin
  178. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/delv $(1)/usr/bin/
  179. endef
  180. define Package/bind-rndc/install
  181. $(INSTALL_DIR) $(1)/usr/sbin
  182. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  183. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  184. endef
  185. define Package/bind-check/install
  186. $(INSTALL_DIR) $(1)/usr/sbin
  187. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
  188. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
  189. endef
  190. define Package/bind-dnssec/install
  191. $(INSTALL_DIR) $(1)/usr/sbin
  192. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
  193. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
  194. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
  195. endef
  196. define Package/bind-host/install
  197. $(INSTALL_DIR) $(1)/usr/bin
  198. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
  199. endef
  200. define Package/bind-dig/install
  201. $(INSTALL_DIR) $(1)/usr/bin
  202. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
  203. endef
  204. define Package/bind-nslookup/install
  205. $(INSTALL_DIR) $(1)/usr/libexec
  206. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nslookup $(1)/usr/libexec/nslookup-bind
  207. endef
  208. $(eval $(call BuildPackage,bind-libs))
  209. $(eval $(call BuildPackage,bind-server))
  210. $(eval $(call BuildPackage,bind-server-filter-aaaa))
  211. $(eval $(call BuildPackage,bind-client))
  212. $(eval $(call BuildPackage,bind-tools))
  213. $(eval $(call BuildPackage,bind-rndc))
  214. $(eval $(call BuildPackage,bind-check))
  215. $(eval $(call BuildPackage,bind-dnssec))
  216. $(eval $(call BuildPackage,bind-host))
  217. $(eval $(call BuildPackage,bind-dig))
  218. $(eval $(call BuildPackage,bind-nslookup))