1
0

Makefile 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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.10.4-P5
  11. PKG_RELEASE:=1
  12. USERID:=bind=57:bind=57
  13. PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>
  14. PKG_LICENSE := BSD-3-Clause
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  16. PKG_SOURCE_URL:= \
  17. ftp://ftp.isc.org/isc/bind9/$(PKG_VERSION) \
  18. http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION)
  19. PKG_MD5SUM:=c53a3e34e7aabb16820b036ae9afd3c9
  20. PKG_FIXUP:=autoreconf
  21. PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
  22. PKG_INSTALL:=1
  23. PKG_USE_MIPS16:=0
  24. PKG_CONFIG_DEPENDS := \
  25. CONFIG_OPENSSL_WITH_EC \
  26. CONFIG_BIND_ENABLE_FILTER_AAAA
  27. include $(INCLUDE_DIR)/package.mk
  28. define Package/bind/Default
  29. SECTION:=net
  30. CATEGORY:=Network
  31. DEPENDS:=+bind-libs
  32. TITLE:=bind
  33. URL:=https://www.isc.org/software/bind
  34. SUBMENU:=IP Addresses and Names
  35. endef
  36. define Package/bind-libs
  37. SECTION:=libs
  38. CATEGORY:=Libraries
  39. DEPENDS:=+libopenssl
  40. TITLE:=bind shared libraries
  41. URL:=https://www.isc.org/software/bind
  42. endef
  43. define Package/bind-server
  44. $(call Package/bind/Default)
  45. TITLE+= DNS server
  46. endef
  47. define Package/bind-server/config
  48. source "$(SOURCE)/Config.in"
  49. endef
  50. define Package/bind-client
  51. $(call Package/bind/Default)
  52. TITLE+= dynamic DNS client
  53. endef
  54. define Package/bind-tools
  55. $(call Package/bind/Default)
  56. TITLE+= administration tools (all)
  57. endef
  58. define Package/bind-rndc
  59. $(call Package/bind/Default)
  60. TITLE+= administration tools (rndc and rndc-confgen only)
  61. endef
  62. define Package/bind-check
  63. $(call Package/bind/Default)
  64. TITLE+= administration tools (named-checkconf and named-checkzone only)
  65. endef
  66. define Package/bind-dnssec
  67. $(call Package/bind/Default)
  68. TITLE+= administration tools (dnssec-keygen and dnssec-signzone only)
  69. endef
  70. define Package/bind-host
  71. $(call Package/bind/Default)
  72. TITLE+= simple DNS client
  73. endef
  74. define Package/bind-dig
  75. $(call Package/bind/Default)
  76. TITLE+= DNS excavation tool
  77. endef
  78. export BUILD_CC="$(TARGET_CC)"
  79. CONFIGURE_ARGS += \
  80. --enable-shared \
  81. --enable-static \
  82. --with-randomdev="/dev/urandom" \
  83. --disable-threads \
  84. --disable-linux-caps \
  85. --with-openssl="$(STAGING_DIR)/usr" \
  86. --with-libjson=no \
  87. --with-libtool \
  88. --with-libxml2=no \
  89. --enable-epoll=yes \
  90. --with-gost=no \
  91. --with-gssapi=no \
  92. --with-ecdsa=$(if $(CONFIG_OPENSSL_WITH_EC),yes,no) \
  93. --with-readline=no \
  94. --sysconfdir=/etc/bind
  95. ifdef CONFIG_BIND_ENABLE_FILTER_AAAA
  96. CONFIGURE_ARGS += \
  97. --enable-filter-aaaa
  98. endif
  99. CONFIGURE_VARS += \
  100. BUILD_CC="$(TARGET_CC)" \
  101. define Build/Compile
  102. $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
  103. BUILD_CC="$(HOSTCC)" \
  104. CC="$(HOSTCC)" \
  105. CFLAGS="-O2" \
  106. LIBS="" \
  107. gen
  108. $(call Build/Compile/Default)
  109. endef
  110. define Package/bind-libs/install
  111. $(INSTALL_DIR) $(1)/usr/lib
  112. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
  113. endef
  114. define Package/bind-server/install
  115. $(INSTALL_DIR) $(1)/usr/sbin
  116. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
  117. $(INSTALL_DIR) $(1)/etc/bind
  118. $(CP) \
  119. ./files/bind/db.0 \
  120. ./files/bind/db.127 \
  121. ./files/bind/db.255 \
  122. ./files/bind/db.local \
  123. ./files/bind/db.root \
  124. $(1)/etc/bind/
  125. $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
  126. $(INSTALL_DIR) $(1)/etc/init.d
  127. $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
  128. find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
  129. endef
  130. define Package/bind-server/conffiles
  131. /etc/bind/db.0
  132. /etc/bind/db.127
  133. /etc/bind/db.255
  134. /etc/bind/db.local
  135. /etc/bind/db.root
  136. /etc/bind/named.conf
  137. endef
  138. define Package/bind-client/install
  139. $(INSTALL_DIR) $(1)/usr/bin
  140. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
  141. endef
  142. define Package/bind-tools/install
  143. $(INSTALL_DIR) $(1)/usr/bin
  144. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
  145. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
  146. $(INSTALL_DIR) $(1)/usr/sbin
  147. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
  148. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
  149. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
  150. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
  151. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  152. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  153. endef
  154. define Package/bind-rndc/install
  155. $(INSTALL_DIR) $(1)/usr/sbin
  156. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
  157. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
  158. endef
  159. define Package/bind-check/install
  160. $(INSTALL_DIR) $(1)/usr/sbin
  161. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
  162. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
  163. endef
  164. define Package/bind-dnssec/install
  165. $(INSTALL_DIR) $(1)/usr/sbin
  166. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
  167. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
  168. endef
  169. define Package/bind-host/install
  170. $(INSTALL_DIR) $(1)/usr/bin
  171. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
  172. endef
  173. define Package/bind-dig/install
  174. $(INSTALL_DIR) $(1)/usr/bin
  175. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
  176. endef
  177. $(eval $(call BuildPackage,bind-libs))
  178. $(eval $(call BuildPackage,bind-server))
  179. $(eval $(call BuildPackage,bind-client))
  180. $(eval $(call BuildPackage,bind-tools))
  181. $(eval $(call BuildPackage,bind-rndc))
  182. $(eval $(call BuildPackage,bind-check))
  183. $(eval $(call BuildPackage,bind-dnssec))
  184. $(eval $(call BuildPackage,bind-host))
  185. $(eval $(call BuildPackage,bind-dig))