port lots of init scripts over to rc.common (more to come)
[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.10
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://avahi.org/download/
18 PKG_MD5SUM:=cfb9e05c138dff4c430a35eee6229e8a
19 PKG_CAT:=zcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22 PKG_BUILDDEP:=libexpat libdaemon libgdbm
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/libavahi
27 SECTION:=libs
28 CATEGORY:=Libraries
29 DEPENDS:=+libdaemon
30 TITLE:=An mDNS/DNS-SD implementation (library)
31 DESCRIPTION:=An mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf) implementation (library).\\\
32 Avahi is a system which facilitates service discovery on a local network -- \\\
33 this means that you can plug your laptop or computer into a network and \\\
34 instantly be able to view other people who you can chat with, find printers \\\
35 to print to or find files being shared. This kind of technology is already \\\
36 found in MacOS X (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf') \\\
37 and is very convenient.\\\
38 \\\
39 This package contains the mDNS/DNS-SD shared libraries, used by other programs.
40 URL:=http://www.avahi.org/
41 endef
42
43 define Package/avahi-daemon
44 SECTION:=net
45 CATEGORY:=Network
46 DEPENDS:=+libavahi
47 TITLE:=An mDNS/DNS-SD implementation (daemon)
48 DESCRIPTION:=An mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf) implementation (daemon).\\\
49 Avahi is a system which facilitates service discovery on a local network -- \\\
50 this means that you can plug your laptop or computer into a network and \\\
51 instantly be able to view other people who you can chat with, find printers \\\
52 to print to or find files being shared. This kind of technology is already \\\
53 found in MacOS X (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf') \\\
54 and is very convenient.\\\
55 \\\
56 This package contains an mDNS/DNS-SD daemon.
57 URL:=http://www.avahi.org/
58 endef
59
60 define Package/avahi-daemon/conffiles
61 /etc/avahi/avahi-daemon.conf
62 /etc/avahi/services/http.service
63 /etc/avahi/services/ssh.service
64 endef
65
66 define Package/avahi-dnsconfd
67 SECTION:=net
68 CATEGORY:=Network
69 DEPENDS:=+libavahi
70 TITLE:=An Unicast DNS server from mDNS/DNS-SD configuration daemon
71 DESCRIPTION:=An Unicast DNS server from mDNS/DNS-SD configuration daemon.\\\
72 Avahi is a system which facilitates service discovery on a local network -- \\\
73 this means that you can plug your laptop or computer into a network and \\\
74 instantly be able to view other people who you can chat with, find printers \\\
75 to print to or find files being shared. This kind of technology is already \\\
76 found in MacOS X (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf') \\\
77 and is very convenient.\\\
78 \\\
79 This package contains an Unicast DNS server from mDNS/DNS-SD configuration \\\
80 daemon, which may be used to configure conventional DNS servers using mDNS \\\
81 in a DHCP-like fashion. Especially useful on IPv6.
82 URL:=http://www.avahi.org/
83 endef
84
85 define Build/Configure
86 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
87 $(TARGET_CONFIGURE_OPTS) \
88 CFLAGS="$(TARGET_CFLAGS) -DNDEBUG" \
89 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
90 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
91 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
92 ac_cv_func_malloc_0_nonnull=yes \
93 ac_cv_func_realloc_0_nonnull=yes \
94 ac_cv_func_memcmp_working=yes \
95 ./configure \
96 --target=$(GNU_TARGET_NAME) \
97 --host=$(GNU_TARGET_NAME) \
98 --build=$(GNU_HOST_NAME) \
99 --program-prefix="" \
100 --program-suffix="" \
101 --prefix=/usr \
102 --exec-prefix=/usr \
103 --bindir=/usr/bin \
104 --datadir=/usr/share \
105 --includedir=/usr/include \
106 --infodir=/usr/share/info \
107 --libdir=/usr/lib \
108 --libexecdir=/usr/lib \
109 --localstatedir=/var \
110 --mandir=/usr/share/man \
111 --sbindir=/usr/sbin \
112 --sysconfdir=/etc \
113 $(DISABLE_LARGEFILE) \
114 $(DISABLE_NLS) \
115 --enable-shared \
116 --enable-static \
117 --disable-rpath \
118 --with-gnu-ld \
119 --disable-glib \
120 --disable-qt3 \
121 --disable-qt4 \
122 --disable-gtk \
123 --disable-dbus \
124 --enable-expat \
125 --enable-libdaemon \
126 --disable-python \
127 --disable-pygtk \
128 --disable-python-dbus \
129 --disable-mono \
130 --disable-monodoc \
131 --disable-doxygen-doc \
132 --disable-doxygen-dot \
133 --disable-doxygen-man \
134 --disable-doxygen-rtf \
135 --disable-doxygen-xml \
136 --disable-doxygen-chm \
137 --disable-doxygen-chi \
138 --disable-doxygen-html \
139 --disable-doxygen-ps \
140 --disable-doxygen-pdf \
141 --disable-xmltoman \
142 --with-distro=none \
143 --with-avahi-user=nobody \
144 --with-avahi-group=nogroup \
145 );
146 endef
147
148 define Build/Compile
149 rm -rf $(PKG_INSTALL_DIR)
150 mkdir -p $(PKG_INSTALL_DIR)
151 $(MAKE) -C $(PKG_BUILD_DIR) \
152 DESTDIR="$(PKG_INSTALL_DIR)" \
153 all install
154 endef
155
156 define Package/avahi-daemon/install
157 install -d -m0755 $(1)/etc/avahi
158 install -m0644 ./files/avahi-daemon.conf $(1)/etc/avahi/
159 install -d -m0755 $(1)/etc/avahi/services
160 install -m0644 ./files/service-http $(1)/etc/avahi/services/http.service
161 install -m0644 ./files/service-ssh $(1)/etc/avahi/services/ssh.service
162 install -d -m0755 $(1)/etc/init.d
163 install -m0755 ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
164 install -d -m0755 $(1)/usr/sbin
165 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
166 endef
167
168 define Package/avahi-dnsconfd/install
169 install -d -m0755 $(1)/etc/avahi
170 $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
171 install -d -m0755 $(1)/usr/sbin
172 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
173 endef
174
175 define Package/libavahi/install
176 install -d -m0755 $(1)/usr/lib
177 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
178 endef
179
180 define Build/InstallDev
181 mkdir -p $(STAGING_DIR)/usr/include
182 $(CP) $(PKG_INSTALL_DIR)/usr/include/avahi-{common,core} $(STAGING_DIR)/usr/include/
183 mkdir -p $(STAGING_DIR)/usr/lib
184 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.{a,so*} $(STAGING_DIR)/usr/lib/
185 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
186 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/avahi-core.pc $(STAGING_DIR)/usr/lib/pkgconfig/
187 $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/avahi-core.pc
188 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/avahi-core.pc
189 endef
190
191 define Build/UninstallDev
192 rm -rf \
193 $(STAGING_DIR)/usr/include/avahi-{common,core} \
194 $(STAGING_DIR)/usr/lib/libavahi-{common,core}.{a,so*} \
195 $(STAGING_DIR)/usr/lib/pkgconfig/avahi-core.pc
196 endef
197
198 $(eval $(call BuildPackage,libavahi))
199 $(eval $(call BuildPackage,avahi-daemon))
200 $(eval $(call BuildPackage,avahi-dnsconfd))
201
202 $(eval $(call RequireCommand,pkg-config, \
203 $(PKG_NAME) requires pkg-config. \
204 ))
205