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.

403 lines
12 KiB

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