[package] add mDNSReponder (#6102)
[openwrt/svn-archive/archive.git] / net / mdnsresponder / Makefile
1 #
2 # Copyright (C) 2009 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:=107.6
12 PKG_RELEASE:=1
13 PKG_INSTALL:=1
14 PKG_SOURCE:=mDNSResponder-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://www.opensource.apple.com/darwinsource/tarballs/other/
16 PKG_MD5SUM:=aa4e0e5c57f94489463ea6576591ce9d
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/mDNSResponder-$(PKG_VERSION)
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/mdnsresponder
23 SECTION:=net
24 CATEGORY:=Network
25 TITLE:=mDNSResponder
26 URL:=http://developer.apple.com/networking/bonjour/
27 endef
28
29 define Package/mdnsresponder/decription
30 Bonjour, also known as zero-configuration networking, enables
31 automatic discovery of computers, devices, and services on
32 IP networks.
33 endef
34
35 define Build/Configure
36 $(call Build/Configure/Default)
37 endef
38
39 # I have no idea why -lc is required, but without it, C library symbols are
40 # not found:
41 MAKE_FLAGS += \
42 LINKOPTS=-lc \
43 LDCONFIG= \
44 ETCBASE="$(PKG_INSTALL_DIR)/etc" \
45 INSTBASE="$(PKG_INSTALL_DIR)/usr" \
46 NSSINSTPATH="$(PKG_INSTALL_DIR)/lib" \
47 MANPATH="$(PKG_INSTALL_DIR)/usr/man" \
48 STARTUPSCRIPTDIR="$(PKG_INSTALL_DIR)/etc/init.d" \
49 RUNLEVELSCRIPTSDIR="$(PKG_INSTALL_DIR)/etc/rc.d" \
50 os=linux-uclibc
51 MAKE_PATH = mDNSPosix
52
53 define Build/Compile
54 $(call Build/Compile/Default)
55 # mDNSResponder's "make install" does not seem to create:
56 mkdir -p $(PKG_INSTALL_DIR)/lib/
57 mkdir -p $(PKG_INSTALL_DIR)/usr/bin/
58 mkdir -p $(PKG_INSTALL_DIR)/usr/sbin/
59 mkdir -p $(PKG_INSTALL_DIR)/usr/lib/
60 mkdir -p $(PKG_INSTALL_DIR)/usr/man/man5/
61 mkdir -p $(PKG_INSTALL_DIR)/usr/man/man8/
62 mkdir -p $(PKG_INSTALL_DIR)/usr/include/
63 mkdir -p $(PKG_INSTALL_DIR)/etc/
64 mkdir -p $(PKG_INSTALL_DIR)/etc/init.d/
65 mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/
66 mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc2.d/
67 mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc3.d/
68 mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc4.d/
69 mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc5.d/
70 mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc0.d/
71 mkdir -p $(PKG_INSTALL_DIR)/etc/rc.d/rc6.d/
72 endef
73
74 define Build/InstallDev
75 $(INSTALL_DIR) $(1)/usr/include/
76 $(CP) $(PKG_BUILD_DIR)/mDNSShared/dns_sd.h $(1)/usr/include/
77 $(INSTALL_DIR) $(1)/usr/lib/
78 $(CP) \
79 $(PKG_BUILD_DIR)/mDNSPosix/build/prod/*.so* \
80 $(1)/usr/lib/
81 $(INSTALL_DIR) $(1)/usr/sbin/
82 endef
83
84 define Package/mdnsresponder/install
85 $(INSTALL_DIR) $(1)/etc/init.d
86 $(INSTALL_BIN) ./files/mDNSResponder.init $(1)/etc/init.d/mDNSResponder
87 $(INSTALL_DIR) $(1)/usr/lib/
88 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so.1 $(1)/usr/lib/
89 # Note: mDNSResponder's makefile creates the following link incorrectly:
90 ln -s libdns_sd.so.1 $(1)/usr/lib/libdns_sd.so
91 $(INSTALL_DIR) $(1)/usr/sbin/
92 $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mdnsd $(1)/usr/sbin/
93 $(CP) $(PKG_BUILD_DIR)/mDNSPosix/build/prod/mDNSResponderPosix $(1)/usr/sbin/
94 endef
95
96 $(eval $(call BuildPackage,mdnsresponder))