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