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.

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