cleanup
[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.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                 ./configure \
93                         --target=$(GNU_TARGET_NAME) \
94                         --host=$(GNU_TARGET_NAME) \
95                         --build=$(GNU_HOST_NAME) \
96                         --program-prefix="" \
97                         --program-suffix="" \
98                         --prefix=/usr \
99                         --exec-prefix=/usr \
100                         --bindir=/usr/bin \
101                         --datadir=/usr/share \
102                         --includedir=/usr/include \
103                         --infodir=/usr/share/info \
104                         --libdir=/usr/lib \
105                         --libexecdir=/usr/lib \
106                         --localstatedir=/var \
107                         --mandir=/usr/share/man \
108                         --sbindir=/usr/sbin \
109                         --sysconfdir=/etc \
110                         $(DISABLE_LARGEFILE) \
111                         $(DISABLE_NLS) \
112                         --enable-shared \
113                         --enable-static \
114                         --disable-rpath \
115                         --with-gnu-ld \
116                         --disable-glib \
117                         --disable-qt3 \
118                         --disable-qt4 \
119                         --disable-gtk \
120                         --disable-dbus \
121                         --enable-expat \
122                         --enable-libdaemon \
123                         --disable-python \
124                         --disable-pygtk \
125                         --disable-python-dbus \
126                         --disable-mono \
127                         --disable-monodoc \
128                         --disable-doxygen-doc \
129                         --disable-doxygen-dot \
130                         --disable-doxygen-man \
131                         --disable-doxygen-rtf \
132                         --disable-doxygen-xml \
133                         --disable-doxygen-chm \
134                         --disable-doxygen-chi \
135                         --disable-doxygen-html \
136                         --disable-doxygen-ps \
137                         --disable-doxygen-pdf \
138                         --disable-xmltoman \
139                         --with-distro=none \
140                         --with-avahi-user=nobody \
141                         --with-avahi-group=nogroup \
142         );
143 endef
144
145 define Build/Compile
146         rm -rf $(PKG_INSTALL_DIR)
147         mkdir -p $(PKG_INSTALL_DIR)
148         $(MAKE) -C $(PKG_BUILD_DIR) \
149                 DESTDIR="$(PKG_INSTALL_DIR)" \
150                 all install
151 endef
152
153 define Package/avahi-daemon/install
154         install -d -m0755 $(1)/etc/avahi
155         install -m0644 ./files/avahi-daemon.conf $(1)/etc/avahi/
156         install -d -m0755 $(1)/etc/avahi/services
157         install -m0644 ./files/service-http $(1)/etc/avahi/services/http.service
158         install -m0644 ./files/service-ssh $(1)/etc/avahi/services/ssh.service
159         install -d -m0755 $(1)/etc/init.d
160         install -m0755 ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
161         install -d -m0755 $(1)/usr/sbin
162         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
163 endef
164
165 define Package/avahi-dnsconfd/install
166         install -d -m0755 $(1)/etc/avahi
167         $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
168         install -d -m0755 $(1)/usr/sbin
169         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
170 endef
171
172 define Package/libavahi/install
173         install -d -m0755 $(1)/usr/lib
174         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
175 endef
176
177 define Build/InstallDev
178         mkdir -p $(STAGING_DIR)/usr/include
179         $(CP) $(PKG_INSTALL_DIR)/usr/include/avahi-{common,core} $(STAGING_DIR)/usr/include/
180         mkdir -p $(STAGING_DIR)/usr/lib
181         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.{a,so*} $(STAGING_DIR)/usr/lib/
182         mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
183         $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/avahi-core.pc $(STAGING_DIR)/usr/lib/pkgconfig/
184         $(SED) 's,-I$$$${includedir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/avahi-core.pc
185         $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/avahi-core.pc
186 endef
187
188 define Build/UninstallDev
189         rm -rf \
190                 $(STAGING_DIR)/usr/include/avahi-{common,core} \
191                 $(STAGING_DIR)/usr/lib/libavahi-{common,core}.{a,so*} \
192                 $(STAGING_DIR)/usr/lib/pkgconfig/avahi-core.pc
193 endef
194
195 $(eval $(call BuildPackage,libavahi))
196 $(eval $(call BuildPackage,avahi-daemon))
197 $(eval $(call BuildPackage,avahi-dnsconfd))
198
199 $(eval $(call RequireCommand,pkg-config, \
200         $(PKG_NAME) requires pkg-config. \
201 ))
202