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.

166 lines
4.8 KiB

  1. #
  2. # Copyright (C) 2009-2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=mDNSResponder
  9. PKG_VERSION:=IETF104
  10. PKG_RELEASE:=5
  11. PKG_SOURCE:=mDNSResponder-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://opensource.apple.com/tarballs/mDNSResponder/IETF/
  13. PKG_HASH:=b3a76fd35cf2d561546c2fbeaea1e5998b7e04b8330afb918ea5fbdeb202162c
  14. PKG_MAINTAINER:=
  15. PKG_LICENSE:=Apache-2.0
  16. PKG_CPE_ID:=cpe:/a:apple:mdnsresponder
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/mDNSResponder-$(PKG_VERSION)
  18. PKG_BUILD_PARALLEL:=0
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. # sys/capability.h is not part of *libc*
  22. PKG_BUILD_DEPENDS:=libcap
  23. define Package/mDNSResponder/Default
  24. SECTION:=net
  25. CATEGORY:=Network
  26. SUBMENU:=IP Addresses and Names
  27. TITLE:=mDNS
  28. URL:=http://developer.apple.com/networking/bonjour/
  29. endef
  30. define Package/mDNSResponder/Default/description
  31. Bonjour, also known as zero-configuration networking, enables
  32. automatic discovery of computers, devices, and services on
  33. IP networks.
  34. endef
  35. define Package/mdns-utils
  36. $(call Package/mDNSResponder/Default)
  37. TITLE+= client utilities
  38. DEPENDS+= +mdnsd
  39. endef
  40. define Package/mdns-utils/description
  41. $(call Package/mDNSResponder/Default/description)
  42. .
  43. This package contains mDNS client utilities:
  44. - dns-sd
  45. - mDNSClient
  46. - mDNSIdentify
  47. - mDNSNetMonitor
  48. - mDNSProxyResponder
  49. - mDNSResponder
  50. endef
  51. define Package/mdnsd
  52. $(call Package/mDNSResponder/Default)
  53. TITLE+= server daemon
  54. endef
  55. define Package/mdnsd/description
  56. $(call Package/mDNSResponder/Default/description)
  57. .
  58. This package contains the mDNS server daemon.
  59. endef
  60. define Package/mdnsresponder
  61. $(call Package/mDNSResponder/Default)
  62. TITLE+= suite (meta)
  63. DEPENDS+= +mdns-utils +mdnsd
  64. endef
  65. define Package/mdnsresponder/description
  66. $(call Package/mDNSResponder/Default/description)
  67. .
  68. This meta package contains only dependencies on other packages.
  69. endef
  70. # I have no idea why -lc is required, but without it, C library symbols are
  71. # not found:
  72. MAKE_FLAGS += \
  73. LD="$(TARGET_CC)" \
  74. CFLAGS_DEBUG="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  75. LINKOPTS=-lc \
  76. LDCONFIG= \
  77. ETCBASE="$(PKG_INSTALL_DIR)/etc" \
  78. INSTBASE="$(PKG_INSTALL_DIR)/usr" \
  79. NSSINSTPATH="$(PKG_INSTALL_DIR)/lib" \
  80. MANPATH="$(PKG_INSTALL_DIR)/usr/man" \
  81. STARTUPSCRIPTDIR="$(PKG_INSTALL_DIR)/etc/init.d" \
  82. RUNLEVELSCRIPTSDIR="$(PKG_INSTALL_DIR)/etc/rc.d" \
  83. os=linux-uclibc
  84. MAKE_PATH = mDNSPosix
  85. define Build/Compile
  86. $(call Build/Compile/Default)
  87. # XXX: mDNSResponder's "make install" does not seem to create:
  88. mkdir -p $(PKG_INSTALL_DIR)/lib/
  89. mkdir -p $(PKG_INSTALL_DIR)/usr/bin/
  90. mkdir -p $(PKG_INSTALL_DIR)/usr/sbin/
  91. mkdir -p $(PKG_INSTALL_DIR)/usr/lib/
  92. mkdir -p $(PKG_INSTALL_DIR)/usr/man/man5/
  93. mkdir -p $(PKG_INSTALL_DIR)/usr/man/man8/
  94. mkdir -p $(PKG_INSTALL_DIR)/usr/include/
  95. mkdir -p $(PKG_INSTALL_DIR)/etc/
  96. mkdir -p $(PKG_INSTALL_DIR)/etc/init.d/
  97. mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/
  98. mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc2.d/
  99. mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc3.d/
  100. mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc4.d/
  101. mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc5.d/
  102. mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc0.d/
  103. mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc6.d/
  104. endef
  105. define Build/InstallDev
  106. $(INSTALL_DIR) $(1)/usr/include
  107. $(CP) $(PKG_INSTALL_DIR)/usr/include/dns_sd.h $(1)/usr/include/
  108. $(INSTALL_DIR) $(1)/usr/lib
  109. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so.1 $(1)/usr/lib/
  110. $(LN) -s libdns_sd.so.1 $(1)/usr/lib/libdns_sd.so
  111. endef
  112. define Package/mdns-utils/install
  113. $(INSTALL_DIR) $(1)/usr/bin/
  114. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dns-sd $(1)/usr/bin/
  115. $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSClientPosix $(1)/usr/bin/mDNSClient
  116. $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSIdentify $(1)/usr/bin/mDNSIdentify
  117. $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSNetMonitor $(1)/usr/bin/mDNSNetMonitor
  118. $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSProxyResponderPosix $(1)/usr/bin/mDNSProxyResponder
  119. $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSResponderPosix $(1)/usr/bin/mDNSResponder
  120. $(INSTALL_DIR) $(1)/etc
  121. $(INSTALL_DATA) ./files/mDNSResponder.conf $(1)/etc/
  122. $(INSTALL_DIR) $(1)/etc/init.d
  123. $(INSTALL_BIN) ./files/mDNSResponder.init $(1)/etc/init.d/mDNSResponder
  124. endef
  125. define Package/mdns-utils/conffiles
  126. /etc/mDNSResponder.conf
  127. endef
  128. define Package/mdnsd/install
  129. $(INSTALL_DIR) $(1)/usr/sbin/
  130. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/mdnsd $(1)/usr/sbin/
  131. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  132. $(INSTALL_DIR) $(1)/etc/init.d
  133. $(INSTALL_BIN) ./files/mdnsd.init $(1)/etc/init.d/mdnsd
  134. $(INSTALL_DIR) $(1)/usr/lib/
  135. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so.1 $(1)/usr/lib/
  136. $(LN) -s libdns_sd.so.1 $(1)/usr/lib/libdns_sd.so
  137. endef
  138. define Package/mdnsresponder/install
  139. :
  140. endef
  141. $(eval $(call BuildPackage,mdns-utils))
  142. $(eval $(call BuildPackage,mdnsd))
  143. $(eval $(call BuildPackage,mdnsresponder))