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