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.

384 lines
11 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:=8
  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. MENU:=1
  88. endef
  89. define Package/avahi-daemon/description
  90. $(call Package/avahi/Default/description)
  91. .
  92. This package contains an mDNS/DNS-SD daemon.
  93. endef
  94. define Package/avahi-daemon/conffiles
  95. /etc/avahi/avahi-daemon.conf
  96. endef
  97. define Package/avahi-daemon-service-http
  98. $(call Package/avahi/Default)
  99. SUBMENU:=IP Addresses and Names
  100. DEPENDS:=avahi-daemon
  101. TITLE:=Announce HTTP service
  102. endef
  103. define Package/avahi-daemon-service-http/description
  104. $(call Package/avahi/Default/description)
  105. .
  106. This package contains the service definition for announcing HTTP service.
  107. endef
  108. define Package/avahi-daemon-service-http/conffiles
  109. /etc/avahi/services/http.service
  110. endef
  111. define Package/avahi-daemon-service-ssh
  112. $(call Package/avahi/Default)
  113. SUBMENU:=IP Addresses and Names
  114. DEPENDS:=avahi-daemon
  115. TITLE:=Announce SSH service
  116. endef
  117. define Package/avahi-daemon-service-ssh/description
  118. $(call Package/avahi/Default/description)
  119. .
  120. This package contains the service definition for announcing SSH service.
  121. endef
  122. define Package/avahi-daemon-service-ssh/conffiles
  123. /etc/avahi/services/ssh.service
  124. endef
  125. define Package/avahi-dnsconfd
  126. $(call Package/avahi/Default)
  127. SUBMENU:=IP Addresses and Names
  128. DEPENDS:=+libavahi +libdaemon
  129. TITLE:=A Unicast DNS server from mDNS/DNS-SD configuration daemon
  130. endef
  131. define Package/avahi-dnsconfd/description
  132. $(call Package/avahi/Default/description)
  133. .
  134. This package contains a Unicast DNS server from mDNS/DNS-SD configuration
  135. daemon, which may be used to configure conventional DNS servers using mDNS
  136. in a DHCP-like fashion. Especially useful on IPv6.
  137. endef
  138. define Package/libavahi-dbus-support
  139. $(call Package/avahi/Default)
  140. SECTION:=libs
  141. CATEGORY:=Libraries
  142. VARIANT:=dbus
  143. DEPENDS:=+dbus +libavahi
  144. TITLE+= (D-Bus support)
  145. endef
  146. define Package/libavahi-dbus-support/description
  147. $(call Package/libavahi/description)
  148. .
  149. The libavahi-dbus-support package enables
  150. D-Bus support in avahi, needed to support
  151. the libavahi-client library and avahi-utils.
  152. Selecting this package modifies the build configuration
  153. so that avahi packages are built with support for D-BUS enabled;
  154. it does not generate a separate binary of its own.
  155. It also automatically adds the D-Bus package to the build.
  156. libavahi-dbus-support is selected automatically if you select
  157. libavahi-client or avahi-utils.
  158. endef
  159. define Package/libavahi-client
  160. $(call Package/avahi/Default)
  161. SECTION:=libs
  162. CATEGORY:=Libraries
  163. DEPENDS:=+libavahi-dbus-support +avahi-daemon
  164. TITLE+= (libavahi-client library)
  165. endef
  166. define Package/libavahi-client/description
  167. $(call Package/avahi/Default/description)
  168. .
  169. This packages adds the libavahi-client library.
  170. It also automatically adds the required
  171. libavahi-dbus-support and the avahi-daemon packages.
  172. For more information please see the avahi documentation.
  173. endef
  174. define Package/libavahi-compat-libdnssd
  175. $(call Package/avahi/Default)
  176. SECTION:=libs
  177. CATEGORY:=Libraries
  178. DEPENDS:=+libavahi-client
  179. TITLE+= (libdnssd)
  180. endef
  181. define Package/libavahi-compat-libdnssd/description
  182. $(call Package/avahi/Default/description)
  183. .
  184. This packages adds the libavahi-compat-libdnssd library.
  185. It also automatically adds the required libavahi-client package.
  186. For more information please see the avahi documentation.
  187. endef
  188. define Package/avahi-utils
  189. $(call Package/avahi/Default)
  190. SUBMENU:=IP Addresses and Names
  191. DEPENDS:=+libavahi-client +libgdbm
  192. TITLE+= (utilities)
  193. endef
  194. define Package/avahi-utils/description
  195. $(call Package/avahi/Default/description)
  196. .
  197. This packages installs the following avahi utility programs:
  198. avahi-browse, avahi-publish, avahi-resolve, avahi-set-host-name.
  199. It also automatically adds the required libavahi-client package.
  200. For more information please see the avahi documentation.
  201. endef
  202. TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE
  203. CONFIGURE_ARGS+= \
  204. --enable-shared \
  205. --enable-static \
  206. --disable-glib \
  207. --disable-gobject \
  208. --disable-qt3 \
  209. --disable-qt4 \
  210. --disable-gtk \
  211. --disable-gtk3 \
  212. --with-xml=expat \
  213. --disable-dbm \
  214. --enable-gdbm \
  215. --enable-libdaemon \
  216. $(if $(CONFIG_PACKAGE_libavahi-compat-libdnssd),--enable-compat-libdns_sd) \
  217. --disable-python \
  218. --disable-pygtk \
  219. --disable-python-dbus \
  220. --disable-mono \
  221. --disable-monodoc \
  222. --disable-doxygen-doc \
  223. --disable-doxygen-dot \
  224. --disable-doxygen-man \
  225. --disable-doxygen-rtf \
  226. --disable-doxygen-xml \
  227. --disable-doxygen-chm \
  228. --disable-doxygen-chi \
  229. --disable-doxygen-html \
  230. --disable-doxygen-ps \
  231. --disable-doxygen-pdf \
  232. --disable-xmltoman \
  233. --with-distro=none \
  234. --with-avahi-user=nobody \
  235. --with-avahi-group=nogroup \
  236. --with-autoipd-user=nobody \
  237. --with-autoipd-group=nogroup
  238. ifneq ($(CONFIG_SSP_SUPPORT),y)
  239. CONFIGURE_ARGS+= \
  240. --disable-stack-protector
  241. endif
  242. ifeq ($(BUILD_VARIANT),dbus)
  243. CONFIGURE_ARGS += \
  244. --enable-dbus
  245. else
  246. CONFIGURE_ARGS += \
  247. --disable-dbus
  248. endif
  249. CONFIGURE_VARS+= \
  250. CFLAGS="$$$$CFLAGS -DNDEBUG -DDISABLE_SYSTEMD" \
  251. ac_cv_header_sys_capability_h=no \
  252. define Build/InstallDev
  253. $(INSTALL_DIR) $(1)/usr/include
  254. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  255. $(INSTALL_DIR) $(1)/usr/lib
  256. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-* $(1)/usr/lib/
  257. ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
  258. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd* $(1)/usr/lib/
  259. endif
  260. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  261. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
  262. endef
  263. define Package/libavahi-dbus-support/install
  264. $(INSTALL_DIR) $(1)/etc/dbus-1/system.d
  265. $(CP) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d
  266. endef
  267. define Package/libavahi/install
  268. # The next line removes the ".build" file from the "other" build.
  269. # The effect is that, if the other build is re-selected in the future,
  270. # the build system will be forced to replace all the code in the
  271. # installer packages, removing anything from the current build.
  272. # "Other" means this: if the current build is "dbus", the other is "nodebus",
  273. # and if the current build is "nodbus", the other is "dbus".
  274. $(RM) -f $(PKG_ALT_DIR)/.built
  275. $(INSTALL_DIR) $(1)/usr/lib
  276. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
  277. endef
  278. define Package/libavahi-client/install
  279. $(INSTALL_DIR) $(1)/usr/lib
  280. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/
  281. endef
  282. define Package/libavahi-compat-libdnssd/install
  283. $(INSTALL_DIR) $(1)/usr/lib
  284. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so.* $(1)/usr/lib/
  285. endef
  286. define Package/avahi-utils/install
  287. $(INSTALL_DIR) $(1)/usr/bin
  288. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  289. endef
  290. define Package/avahi-autoipd/install
  291. $(INSTALL_DIR) $(1)/etc/avahi
  292. $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
  293. $(INSTALL_DIR) $(1)/usr/sbin
  294. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
  295. endef
  296. define Package/avahi-daemon/install
  297. $(INSTALL_DIR) $(1)/usr/sbin
  298. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
  299. $(INSTALL_DIR) $(1)/etc/avahi
  300. $(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/
  301. $(INSTALL_DIR) $(1)/etc/avahi/services
  302. $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
  303. $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
  304. $(INSTALL_DIR) $(1)/etc/init.d
  305. $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
  306. endef
  307. define Package/avahi-daemon-service-http/install
  308. $(INSTALL_DIR) $(1)/etc/avahi/services
  309. $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
  310. endef
  311. define Package/avahi-daemon-service-ssh/install
  312. $(INSTALL_DIR) $(1)/etc/avahi/services
  313. $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
  314. endef
  315. define Package/avahi-dnsconfd/install
  316. $(INSTALL_DIR) $(1)/etc/avahi
  317. $(CP) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
  318. $(INSTALL_DIR) $(1)/usr/sbin
  319. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
  320. endef
  321. $(eval $(call BuildPackage,libavahi-client))
  322. $(eval $(call BuildPackage,libavahi-compat-libdnssd))
  323. $(eval $(call BuildPackage,avahi-utils))
  324. $(eval $(call BuildPackage,libavahi-dbus-support))
  325. $(eval $(call BuildPackage,libavahi))
  326. $(eval $(call BuildPackage,avahi-autoipd))
  327. $(eval $(call BuildPackage,avahi-daemon))
  328. $(eval $(call BuildPackage,avahi-daemon-service-http))
  329. $(eval $(call BuildPackage,avahi-daemon-service-ssh))
  330. $(eval $(call BuildPackage,avahi-dnsconfd))