From baf60c9f7ad3739a6ecef34b0adb40421f14bf3a Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 5 Feb 2012 15:25:25 +0000 Subject: [PATCH] [packages_10.03.2] mdnsresponder: merge r28970, r29051, r29199 SVN-Revision: 30218 --- net/mdnsresponder/Makefile | 107 ++++++++++++++++----- net/mdnsresponder/files/mDNSResponder.conf | 4 + net/mdnsresponder/files/mDNSResponder.init | 12 +-- net/mdnsresponder/files/mdnsd.init | 14 +++ 4 files changed, 109 insertions(+), 28 deletions(-) create mode 100644 net/mdnsresponder/files/mDNSResponder.conf create mode 100755 net/mdnsresponder/files/mdnsd.init diff --git a/net/mdnsresponder/Makefile b/net/mdnsresponder/Makefile index 3f6c9265d4..462c6bb50a 100644 --- a/net/mdnsresponder/Makefile +++ b/net/mdnsresponder/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2009 OpenWrt.org +# Copyright (C) 2009-2011 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mDNSResponder PKG_VERSION:=214.3.2 -PKG_RELEASE:=1 -PKG_INSTALL:=1 +PKG_RELEASE:=4 + PKG_SOURCE:=mDNSResponder-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://opensource.apple.com/tarballs/mDNSResponder/ PKG_MD5SUM:=05d39f40767ccece4b740c5afad14a23 @@ -18,30 +18,68 @@ PKG_MD5SUM:=05d39f40767ccece4b740c5afad14a23 PKG_BUILD_DIR:=$(BUILD_DIR)/mDNSResponder-$(PKG_VERSION) PKG_BUILD_PARALLEL:=0 +PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk -define Package/mdnsresponder +define Package/mDNSResponder/Default SECTION:=net CATEGORY:=Network SUBMENU:=IP Addresses and Names - TITLE:=mDNSResponder + TITLE:=mDNS URL:=http://developer.apple.com/networking/bonjour/ endef -define Package/mdnsresponder/decription +define Package/mDNSResponder/Default/description Bonjour, also known as zero-configuration networking, enables automatic discovery of computers, devices, and services on IP networks. endef -define Build/Configure - $(call Build/Configure/Default) +define Package/mdns-utils +$(call Package/mDNSResponder/Default) + TITLE+= client utilities +endef + +define Package/mdns-utils/description +$(call Package/mDNSResponder/Default/description) + . + This package contains mDNS client utilities: + - dns-sd + - mDNSClient + - mDNSIdentify + - mDNSNetMonitor + - mDNSProxyResponder + - mDNSResponder +endef + +define Package/mdnsd +$(call Package/mDNSResponder/Default) + TITLE+= server daemon +endef + +define Package/mdnsd/description +$(call Package/mDNSResponder/Default/description) + . + This package contains the mDNS server daemon. +endef + +define Package/mdnsresponder +$(call Package/mDNSResponder/Default) + TITLE+= suite (meta) + DEPENDS+= +mdns-utils +mdnsd +endef + +define Package/mdnsresponder/description +$(call Package/mDNSResponder/Default/description) + . + This meta package contains only dependencies on other packages. endef # I have no idea why -lc is required, but without it, C library symbols are # not found: MAKE_FLAGS += \ + CFLAGS_DEBUG="$(TARGET_CFLAGS)" \ LINKOPTS=-lc \ LDCONFIG= \ ETCBASE="$(PKG_INSTALL_DIR)/etc" \ @@ -55,7 +93,7 @@ MAKE_PATH = mDNSPosix define Build/Compile $(call Build/Compile/Default) - # mDNSResponder's "make install" does not seem to create: + # XXX: mDNSResponder's "make install" does not seem to create: mkdir -p $(PKG_INSTALL_DIR)/lib/ mkdir -p $(PKG_INSTALL_DIR)/usr/bin/ mkdir -p $(PKG_INSTALL_DIR)/usr/sbin/ @@ -72,28 +110,53 @@ define Build/Compile mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc5.d/ mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc0.d/ mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc6.d/ + # XXX: mDNSResponder's makefile creates absolute link + rm -f $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so + ln -fs libdns_sd.so.1 $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so endef define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_BUILD_DIR)/mDNSShared/dns_sd.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/*.so* $(1)/usr/lib/ +endef + +define Package/mdns-utils/conffile + /etc/init.d/mDNSResponder +endef + +define Package/mdns-utils/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/dns-sd $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSClientPosix $(1)/usr/bin/mDNSClient + $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSIdentify $(1)/usr/bin/mDNSIdentify + $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSNetMonitor $(1)/usr/bin/mDNSNetMonitor + $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSProxyResponderPosix $(1)/usr/bin/mDNSProxyResponder + $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSResponderPosix $(1)/usr/bin/mDNSResponder $(INSTALL_DIR) $(1)/usr/lib/ - $(CP) \ - $(PKG_BUILD_DIR)/mDNSPosix/build/prod/*.so* \ - $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/mDNSResponder.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mDNSResponder.init $(1)/etc/init.d/mDNSResponder +endef + +define Package/mdns-utils/conffiles +/etc/mDNSResponder.conf +endef + +define Package/mdnsd/install $(INSTALL_DIR) $(1)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/mdnsd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mdnsd.init $(1)/etc/init.d/mdnsd endef define Package/mdnsresponder/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/mDNSResponder.init $(1)/etc/init.d/mDNSResponder - $(INSTALL_DIR) $(1)/usr/lib/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so.1 $(1)/usr/lib/ - # Note: mDNSResponder's makefile creates the following link incorrectly: - ln -s libdns_sd.so.1 $(1)/usr/lib/libdns_sd.so - $(INSTALL_DIR) $(1)/usr/sbin/ - $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mdnsd $(1)/usr/sbin/ - $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSResponderPosix $(1)/usr/sbin/ + : endef +$(eval $(call BuildPackage,mdns-utils)) +$(eval $(call BuildPackage,mdnsd)) $(eval $(call BuildPackage,mdnsresponder)) diff --git a/net/mdnsresponder/files/mDNSResponder.conf b/net/mdnsresponder/files/mDNSResponder.conf new file mode 100644 index 0000000000..23aab169aa --- /dev/null +++ b/net/mdnsresponder/files/mDNSResponder.conf @@ -0,0 +1,4 @@ +"OpenWrt SSH" +_ssh._tcp. local +22 +OpenWrt SSH server diff --git a/net/mdnsresponder/files/mDNSResponder.init b/net/mdnsresponder/files/mDNSResponder.init index 97020617a5..87f9e90082 100644 --- a/net/mdnsresponder/files/mDNSResponder.init +++ b/net/mdnsresponder/files/mDNSResponder.init @@ -1,14 +1,14 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2009 OpenWrt.org +# Copyright (C) 2009-2011 OpenWrt.org -START=60 +START=61 + +SERVICE_USE_PID=1 start() { - /usr/sbin/mDNSResponderPosix -b -f /etc/mdns.conf - /usr/sbin/mdnsd + service_start /usr/bin/mDNSResponder -b -f /etc/mDNSResponder.conf } stop() { - killall mDNSResponderPosix 2> /dev/null - killall mdnsd 2> /dev/null + service_stop /usr/bin/mDNSResponder } diff --git a/net/mdnsresponder/files/mdnsd.init b/net/mdnsresponder/files/mdnsd.init new file mode 100755 index 0000000000..6d77f0a2d3 --- /dev/null +++ b/net/mdnsresponder/files/mdnsd.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2011 OpenWrt.org + +START=60 + +SERVICE_USE_PID=1 + +start() { + service_start /usr/sbin/mdnsd +} + +stop() { + service_stop /usr/sbin/mdnsd +} -- 2.30.2