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