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