You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

339 lines
9.9 KiB

  1. #
  2. # Copyright (C) 2007-2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. ifeq ($(BUILD_VARIANT),dbus)
  9. PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/dbus/$(PKG_NAME)-$(PKG_VERSION)
  10. PKG_ALT_DIR=$(BUILD_DIR)/$(PKG_NAME)/nodbus/$(PKG_NAME)-$(PKG_VERSION)
  11. else
  12. PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/nodbus/$(PKG_NAME)-$(PKG_VERSION)
  13. PKG_ALT_DIR=$(BUILD_DIR)/$(PKG_NAME)/dbus/$(PKG_NAME)-$(PKG_VERSION)
  14. endif
  15. PKG_NAME:=avahi
  16. PKG_VERSION:=0.6.31
  17. PKG_RELEASE:=7
  18. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  19. PKG_SOURCE_URL:=http://avahi.org/download/
  20. PKG_MD5SUM:=2f22745b8f7368ad5a0a3fddac343f2d
  21. PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
  22. PKG_BUILD_DEPENDS:=libexpat libdaemon libgdbm intltool/host libpthread dbus
  23. PKG_FIXUP:=autoreconf
  24. PKG_REMOVE_FILES:=autogen.sh
  25. PKG_INSTALL:=1
  26. PKG_BUILD_PARALLEL:=1
  27. include $(INCLUDE_DIR)/package.mk
  28. define Package/avahi/Default
  29. SECTION:=net
  30. CATEGORY:=Network
  31. TITLE:=An mDNS/DNS-SD implementation
  32. URL:=http://www.avahi.org/
  33. endef
  34. define Package/avahi/Default/description
  35. Avahi is an mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf)
  36. implementation (library). It facilitates
  37. service discovery on a local network -- this means that
  38. you can plug your laptop or computer into a network and
  39. instantly be able to view other people who you can chat with,
  40. find printers to print to or find files being shared.
  41. This kind of technology is already found in MacOS X
  42. (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf')
  43. and is very convenient.
  44. endef
  45. define Package/libavahi
  46. $(call Package/avahi/Default)
  47. SECTION:=libs
  48. CATEGORY:=Libraries
  49. DEPENDS:=+libpthread +SSP_SUPPORT:libssp
  50. TITLE+= (library)
  51. endef
  52. define Package/libavahi/description
  53. $(call Package/avahi/Default/description)
  54. .
  55. The libavahi package contains the mDNS/DNS-SD shared libraries,
  56. used by other programs. Specifically, it provides
  57. libavahi-core and libavahi-common libraries.
  58. By default, it is built without D-Bus support,
  59. i.e. the --disable-dbus configuration flag is set.
  60. To enable D-Bus support, select the package
  61. libavahi-dbus-support.
  62. endef
  63. define Package/avahi-autoipd
  64. $(call Package/avahi/Default)
  65. SUBMENU:=IP Addresses and Names
  66. DEPENDS:=+libdaemon
  67. TITLE:=IPv4LL network address configuration daemon
  68. endef
  69. define Package/avahi-autoipd/description
  70. $(call Package/avahi/Default/description)
  71. .
  72. This package implements IPv4LL, "Dynamic Configuration of IPv4 Link-Local
  73. Addresses" (IETF RFC3927), a protocol for automatic IP address configuration
  74. from the link-local 169.254.0.0/16 range without the need for a central
  75. server. It is primarily intended to be used in ad-hoc networks which lack a
  76. DHCP server.
  77. endef
  78. define Package/avahi-daemon
  79. $(call Package/avahi/Default)
  80. SUBMENU:=IP Addresses and Names
  81. ifeq ($(BUILD_VARIANT),dbus)
  82. DEPENDS:=+libavahi +libexpat +librt +libdaemon +libdbus
  83. else
  84. DEPENDS:=+libavahi +libexpat +librt +libdaemon
  85. endif
  86. TITLE+= (daemon)
  87. endef
  88. define Package/avahi-daemon/description
  89. $(call Package/avahi/Default/description)
  90. .
  91. This package contains an mDNS/DNS-SD daemon.
  92. endef
  93. define Package/avahi-daemon/conffiles
  94. /etc/avahi/avahi-daemon.conf
  95. /etc/avahi/services/http.service
  96. /etc/avahi/services/ssh.service
  97. endef
  98. define Package/avahi-dnsconfd
  99. $(call Package/avahi/Default)
  100. SUBMENU:=IP Addresses and Names
  101. DEPENDS:=+libavahi +libdaemon
  102. TITLE:=A Unicast DNS server from mDNS/DNS-SD configuration daemon
  103. endef
  104. define Package/avahi-dnsconfd/description
  105. $(call Package/avahi/Default/description)
  106. .
  107. This package contains a Unicast DNS server from mDNS/DNS-SD configuration
  108. daemon, which may be used to configure conventional DNS servers using mDNS
  109. in a DHCP-like fashion. Especially useful on IPv6.
  110. endef
  111. define Package/libavahi-dbus-support
  112. $(call Package/avahi/Default)
  113. SECTION:=libs
  114. CATEGORY:=Libraries
  115. VARIANT:=dbus
  116. DEPENDS:=+dbus +libavahi
  117. TITLE+= (D-Bus support)
  118. endef
  119. define Package/libavahi-dbus-support/description
  120. $(call Package/libavahi/description)
  121. .
  122. The libavahi-dbus-support package enables
  123. D-Bus support in avahi, needed to support
  124. the libavahi-client library and avahi-utils.
  125. Selecting this package modifies the build configuration
  126. so that avahi packages are built with support for D-BUS enabled;
  127. it does not generate a separate binary of its own.
  128. It also automatically adds the D-Bus package to the build.
  129. libavahi-dbus-support is selected automatically if you select
  130. libavahi-client or avahi-utils.
  131. endef
  132. define Package/libavahi-client
  133. $(call Package/avahi/Default)
  134. SECTION:=libs
  135. CATEGORY:=Libraries
  136. DEPENDS:=+libavahi-dbus-support +avahi-daemon
  137. TITLE+= (libavahi-client library)
  138. endef
  139. define Package/libavahi-client/description
  140. $(call Package/avahi/Default/description)
  141. .
  142. This packages adds the libavahi-client library.
  143. It also automatically adds the required
  144. libavahi-dbus-support and the avahi-daemon packages.
  145. For more information please see the avahi documentation.
  146. endef
  147. define Package/libavahi-compat-libdnssd
  148. $(call Package/avahi/Default)
  149. SECTION:=libs
  150. CATEGORY:=Libraries
  151. DEPENDS:=+libavahi-client
  152. TITLE+= (libdnssd)
  153. endef
  154. define Package/libavahi-compat-libdnssd/description
  155. $(call Package/avahi/Default/description)
  156. .
  157. This packages adds the libavahi-compat-libdnssd library.
  158. It also automatically adds the required libavahi-client package.
  159. For more information please see the avahi documentation.
  160. endef
  161. define Package/avahi-utils
  162. $(call Package/avahi/Default)
  163. SUBMENU:=IP Addresses and Names
  164. DEPENDS:=+libavahi-client +libgdbm
  165. TITLE+= (utilities)
  166. endef
  167. define Package/avahi-utils/description
  168. $(call Package/avahi/Default/description)
  169. .
  170. This packages installs the following avahi utility programs:
  171. avahi-browse, avahi-publish, avahi-resolve, avahi-set-host-name.
  172. It also automatically adds the required libavahi-client package.
  173. For more information please see the avahi documentation.
  174. endef
  175. TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE
  176. CONFIGURE_ARGS+= \
  177. --enable-shared \
  178. --enable-static \
  179. --disable-glib \
  180. --disable-gobject \
  181. --disable-qt3 \
  182. --disable-qt4 \
  183. --disable-gtk \
  184. --disable-gtk3 \
  185. --with-xml=expat \
  186. --disable-dbm \
  187. --enable-gdbm \
  188. --enable-libdaemon \
  189. $(if $(CONFIG_PACKAGE_libavahi-compat-libdnssd),--enable-compat-libdns_sd) \
  190. --disable-python \
  191. --disable-pygtk \
  192. --disable-python-dbus \
  193. --disable-mono \
  194. --disable-monodoc \
  195. --disable-doxygen-doc \
  196. --disable-doxygen-dot \
  197. --disable-doxygen-man \
  198. --disable-doxygen-rtf \
  199. --disable-doxygen-xml \
  200. --disable-doxygen-chm \
  201. --disable-doxygen-chi \
  202. --disable-doxygen-html \
  203. --disable-doxygen-ps \
  204. --disable-doxygen-pdf \
  205. --disable-xmltoman \
  206. --with-distro=none \
  207. --with-avahi-user=nobody \
  208. --with-avahi-group=nogroup \
  209. --with-autoipd-user=nobody \
  210. --with-autoipd-group=nogroup
  211. ifneq ($(CONFIG_SSP_SUPPORT),y)
  212. CONFIGURE_ARGS+= \
  213. --disable-stack-protector
  214. endif
  215. ifeq ($(BUILD_VARIANT),dbus)
  216. CONFIGURE_ARGS += \
  217. --enable-dbus
  218. else
  219. CONFIGURE_ARGS += \
  220. --disable-dbus
  221. endif
  222. CONFIGURE_VARS+= \
  223. CFLAGS="$$$$CFLAGS -DNDEBUG -DDISABLE_SYSTEMD" \
  224. ac_cv_header_sys_capability_h=no \
  225. define Build/InstallDev
  226. $(INSTALL_DIR) $(1)/usr/include
  227. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  228. $(INSTALL_DIR) $(1)/usr/lib
  229. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-* $(1)/usr/lib/
  230. ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
  231. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd* $(1)/usr/lib/
  232. endif
  233. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  234. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
  235. endef
  236. define Package/libavahi-dbus-support/install
  237. $(INSTALL_DIR) $(1)/etc/dbus-1/system.d
  238. $(CP) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d
  239. endef
  240. define Package/libavahi/install
  241. # The next line removes the ".build" file from the "other" build.
  242. # The effect is that, if the other build is re-selected in the future,
  243. # the build system will be forced to replace all the code in the
  244. # installer packages, removing anything from the current build.
  245. # "Other" means this: if the current build is "dbus", the other is "nodebus",
  246. # and if the current build is "nodbus", the other is "dbus".
  247. $(RM) -f $(PKG_ALT_DIR)/.built
  248. $(INSTALL_DIR) $(1)/usr/lib
  249. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
  250. endef
  251. define Package/libavahi-client/install
  252. $(INSTALL_DIR) $(1)/usr/lib
  253. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/
  254. endef
  255. define Package/libavahi-compat-libdnssd/install
  256. $(INSTALL_DIR) $(1)/usr/lib
  257. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so.* $(1)/usr/lib/
  258. endef
  259. define Package/avahi-utils/install
  260. $(INSTALL_DIR) $(1)/usr/bin
  261. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  262. endef
  263. define Package/avahi-autoipd/install
  264. $(INSTALL_DIR) $(1)/etc/avahi
  265. $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
  266. $(INSTALL_DIR) $(1)/usr/sbin
  267. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
  268. endef
  269. define Package/avahi-daemon/install
  270. $(INSTALL_DIR) $(1)/usr/sbin
  271. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
  272. $(INSTALL_DIR) $(1)/etc/avahi
  273. $(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/
  274. $(INSTALL_DIR) $(1)/etc/avahi/services
  275. $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
  276. $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
  277. $(INSTALL_DIR) $(1)/etc/init.d
  278. $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
  279. endef
  280. define Package/avahi-dnsconfd/install
  281. $(INSTALL_DIR) $(1)/etc/avahi
  282. $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
  283. $(INSTALL_DIR) $(1)/usr/sbin
  284. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
  285. endef
  286. $(eval $(call BuildPackage,libavahi-client))
  287. $(eval $(call BuildPackage,libavahi-compat-libdnssd))
  288. $(eval $(call BuildPackage,avahi-utils))
  289. $(eval $(call BuildPackage,libavahi-dbus-support))
  290. $(eval $(call BuildPackage,libavahi))
  291. $(eval $(call BuildPackage,avahi-autoipd))
  292. $(eval $(call BuildPackage,avahi-daemon))
  293. $(eval $(call BuildPackage,avahi-dnsconfd))