update avahi to v0.6.14, add avahi-autoipd package, use Build/Configure/Default macro
[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.14
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:=6abad76bbc2ac0f51a8869b3a2e5c238
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_BUILDDEP:=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
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
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 --with-gnu-ld \
98 --disable-glib \
99 --disable-qt3 \
100 --disable-qt4 \
101 --disable-gtk \
102 --disable-dbus \
103 --enable-expat \
104 --disable-dbm \
105 --enable-gdbm \
106 --enable-libdaemon \
107 --disable-python \
108 --disable-pygtk \
109 --disable-python-dbus \
110 --disable-mono \
111 --disable-monodoc \
112 --disable-doxygen-doc \
113 --disable-doxygen-dot \
114 --disable-doxygen-man \
115 --disable-doxygen-rtf \
116 --disable-doxygen-xml \
117 --disable-doxygen-chm \
118 --disable-doxygen-chi \
119 --disable-doxygen-html \
120 --disable-doxygen-ps \
121 --disable-doxygen-pdf \
122 --disable-xmltoman \
123 --with-distro=none \
124 --with-avahi-user=nobody \
125 --with-avahi-group=nogroup \
126 , \
127 CFLAGS="$$$$CFLAGS -DNDEBUG" \
128 )
129 endef
130
131 define Build/Compile
132 $(MAKE) -C $(PKG_BUILD_DIR) \
133 DESTDIR="$(PKG_INSTALL_DIR)" \
134 all install
135 endef
136
137 define Build/InstallDev
138 mkdir -p $(STAGING_DIR)/usr/include
139 $(CP) $(PKG_INSTALL_DIR)/usr/include/avahi-{common,core} $(STAGING_DIR)/usr/include/
140 mkdir -p $(STAGING_DIR)/usr/lib
141 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.{a,so*} $(STAGING_DIR)/usr/lib/
142 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
143 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/avahi-core.pc $(STAGING_DIR)/usr/lib/pkgconfig/
144 $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/avahi-core.pc
145 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/avahi-core.pc
146 endef
147
148 define Build/UninstallDev
149 rm -rf $(STAGING_DIR)/usr/include/avahi-{common,core} \
150 $(STAGING_DIR)/usr/lib/libavahi-{common,core}.{a,so*} \
151 $(STAGING_DIR)/usr/lib/pkgconfig/avahi-core.pc
152 endef
153
154 define Package/libavahi/install
155 install -d -m0755 $(1)/usr/lib
156 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
157 endef
158
159 define Package/avahi-autoipd/install
160 install -d -m0755 $(1)/etc/avahi
161 $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
162 install -d -m0755 $(1)/usr/sbin
163 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
164 endef
165
166 define Package/avahi-daemon/install
167 install -d -m0755 $(1)/usr/sbin
168 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
169 install -d -m0755 $(1)/etc/avahi
170 install -m0644 ./files/avahi-daemon.conf $(1)/etc/avahi/
171 install -d -m0755 $(1)/etc/avahi/services
172 install -m0644 ./files/service-http $(1)/etc/avahi/services/http.service
173 install -m0644 ./files/service-ssh $(1)/etc/avahi/services/ssh.service
174 install -d -m0755 $(1)/etc/init.d
175 install -m0755 ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
176 endef
177
178 define Package/avahi-dnsconfd/install
179 install -d -m0755 $(1)/etc/avahi
180 $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
181 install -d -m0755 $(1)/usr/sbin
182 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
183 endef
184
185 $(eval $(call BuildPackage,libavahi))
186 $(eval $(call BuildPackage,avahi-autoipd))
187 $(eval $(call BuildPackage,avahi-daemon))
188 $(eval $(call BuildPackage,avahi-dnsconfd))
189
190 $(eval $(call RequireCommand,pkg-config, \
191 $(PKG_NAME) requires pkg-config. \
192 ))