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.

263 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.9
  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:=075de055d1c3d8fede6a93cc890203670948e0f13310a21d4980cb5e378f7306
  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. sed -e '1s/ broadcast / empty rfc1918 /' \
  156. < ./files/bind/db.0 \
  157. > $(1)/etc/bind/db.empty
  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/bind
  173. $(CP) $(PKG_INSTALL_DIR)/usr/lib/bind/filter-aaaa.so $(1)/usr/lib/bind
  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/bin
  190. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/named-checkconf $(1)/usr/bin/
  191. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/named-checkzone $(1)/usr/bin/
  192. endef
  193. define Package/bind-dnssec/install
  194. $(INSTALL_DIR) $(1)/usr/bin
  195. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-keygen $(1)/usr/bin/
  196. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-settime $(1)/usr/bin/
  197. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dnssec-signzone $(1)/usr/bin/
  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. define Package/bind-nslookup/install
  208. $(INSTALL_DIR) $(1)/usr/libexec
  209. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nslookup $(1)/usr/libexec/nslookup-bind
  210. endef
  211. $(eval $(call BuildPackage,bind-libs))
  212. $(eval $(call BuildPackage,bind-server))
  213. $(eval $(call BuildPackage,bind-server-filter-aaaa))
  214. $(eval $(call BuildPackage,bind-client))
  215. $(eval $(call BuildPackage,bind-tools))
  216. $(eval $(call BuildPackage,bind-rndc))
  217. $(eval $(call BuildPackage,bind-check))
  218. $(eval $(call BuildPackage,bind-dnssec))
  219. $(eval $(call BuildPackage,bind-host))
  220. $(eval $(call BuildPackage,bind-dig))
  221. $(eval $(call BuildPackage,bind-nslookup))