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.

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