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.

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