1
0

Makefile 6.0 KB

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