bd200c83dd95aeb343c68a1a61f83ff93fca8081
[openwrt/svn-archive/archive.git] / libs / avahi / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=avahi
12 PKG_VERSION:=0.6.17
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://avahi.org/download/
17 PKG_MD5SUM:=29ebb2181958d5721ee5fc45f035a77c
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 PKG_BUILD_DEPENDS:=libexpat libdaemon libgdbm
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/avahi/Default
28 SECTION:=net
29 CATEGORY:=Network
30 TITLE:=An mDNS/DNS-SD implementation
31 DESCRIPTION:=\
32 An mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf) implementation (library).\\\
33 Avahi is a system which facilitates service discovery on a local network -- \\\
34 this means that you can plug your laptop or computer into a network and \\\
35 instantly be able to view other people who you can chat with, find printers \\\
36 to print to or find files being shared. This kind of technology is already \\\
37 found in MacOS X (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf') \\\
38 and is very convenient.
39 URL:=http://www.avahi.org/
40 endef
41
42 define Package/libavahi
43 $(call Package/avahi/Default)
44 SECTION:=libs
45 CATEGORY:=Libraries
46 DEPENDS:=+libdaemon +libpthread
47 TITLE+= (library)
48 DESCRIPTION+=\\\
49 \\\
50 This package contains the mDNS/DNS-SD shared libraries, used by other programs.
51 endef
52
53 define Package/avahi-autoipd
54 $(call Package/avahi/Default)
55 DEPENDS:=+libdaemon
56 TITLE:=IPv4LL network address configuration daemon
57 DESCRIPTION+=\\\
58 \\\
59 This package implements IPv4LL, "Dynamic Configuration of \\\
60 IPv4 Link-Local Addresses" (IETF RFC3927), a protocol for \\\
61 automatic IP address configuration from the link-local \\\
62 169.254.0.0/16 range without the need for a central server. It \\\
63 is primarily intended to be used in ad-hoc networks which lack a \\\
64 DHCP server.
65 endef
66
67 define Package/avahi-daemon
68 $(call Package/avahi/Default)
69 DEPENDS:=+libavahi +libexpat
70 TITLE+= (daemon)
71 DESCRIPTION+=\\\
72 \\\
73 This package contains an mDNS/DNS-SD daemon.
74 endef
75
76 define Package/avahi-daemon/conffiles
77 /etc/avahi/avahi-daemon.conf
78 /etc/avahi/services/http.service
79 /etc/avahi/services/ssh.service
80 endef
81
82 define Package/avahi-dnsconfd
83 $(call Package/avahi/Default)
84 DEPENDS:=+libavahi
85 TITLE:=An Unicast DNS server from mDNS/DNS-SD configuration daemon
86 DESCRIPTION+=\\\
87 \\\
88 This package contains an Unicast DNS server from mDNS/DNS-SD configuration \\\
89 daemon, which may be used to configure conventional DNS servers using mDNS \\\
90 in a DHCP-like fashion. Especially useful on IPv6.
91 endef
92
93 define Build/Configure
94 $(call Build/Configure/Default, \
95 --enable-shared \
96 --enable-static \
97 --disable-glib \
98 --disable-qt3 \
99 --disable-qt4 \
100 --disable-gtk \
101 --disable-dbus \
102 --enable-expat \
103 --disable-dbm \
104 --enable-gdbm \
105 --enable-libdaemon \
106 --disable-python \
107 --disable-pygtk \
108 --disable-python-dbus \
109 --disable-mono \
110 --disable-monodoc \
111 --disable-doxygen-doc \
112 --disable-doxygen-dot \
113 --disable-doxygen-man \
114 --disable-doxygen-rtf \
115 --disable-doxygen-xml \
116 --disable-doxygen-chm \
117 --disable-doxygen-chi \
118 --disable-doxygen-html \
119 --disable-doxygen-ps \
120 --disable-doxygen-pdf \
121 --disable-xmltoman \
122 --with-distro=none \
123 --with-avahi-user=nobody \
124 --with-avahi-group=nogroup \
125 , \
126 CFLAGS="$$$$CFLAGS -DNDEBUG" \
127 )
128 endef
129
130 define Build/Compile
131 $(MAKE) -C $(PKG_BUILD_DIR) \
132 DESTDIR="$(PKG_INSTALL_DIR)" \
133 all install
134 endef
135
136 define Build/InstallDev
137 mkdir -p $(1)/usr/include
138 $(CP) $(PKG_INSTALL_DIR)/usr/include/avahi-{common,core} $(1)/usr/include/
139 mkdir -p $(1)/usr/lib
140 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.{a,so*} $(1)/usr/lib/
141 mkdir -p $(1)/usr/lib/pkgconfig
142 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/avahi-core.pc $(1)/usr/lib/pkgconfig/
143 endef
144
145 define Build/UninstallDev
146 rm -rf $(STAGING_DIR)/usr/include/avahi-{common,core} \
147 $(STAGING_DIR)/usr/lib/libavahi-{common,core}.{a,so*} \
148 $(STAGING_DIR)/usr/lib/pkgconfig/avahi-core.pc
149 endef
150
151 define Package/libavahi/install
152 $(INSTALL_DIR) $(1)/usr/lib
153 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
154 endef
155
156 define Package/avahi-autoipd/install
157 $(INSTALL_DIR) $(1)/etc/avahi
158 $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
159 $(INSTALL_DIR) $(1)/usr/sbin
160 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
161 endef
162
163 define Package/avahi-daemon/install
164 $(INSTALL_DIR) $(1)/usr/sbin
165 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
166 $(INSTALL_DIR) $(1)/etc/avahi
167 $(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/
168 $(INSTALL_DIR) $(1)/etc/avahi/services
169 $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
170 $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
171 $(INSTALL_DIR) $(1)/etc/init.d
172 $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
173 endef
174
175 define Package/avahi-dnsconfd/install
176 $(INSTALL_DIR) $(1)/etc/avahi
177 $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
178 $(INSTALL_DIR) $(1)/usr/sbin
179 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
180 endef
181
182 $(eval $(call BuildPackage,libavahi))
183 $(eval $(call BuildPackage,avahi-autoipd))
184 $(eval $(call BuildPackage,avahi-daemon))
185 $(eval $(call BuildPackage,avahi-dnsconfd))
186
187 $(eval $(call RequireCommand,pkg-config, \
188 $(PKG_NAME) requires pkg-config. \
189 ))