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