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.

411 lines
12 KiB

  1. #
  2. # Copyright (C) 2007-2016 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.8
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://github.com/lathiat/avahi/releases/download/v$(PKG_VERSION) \
  13. https://avahi.org/download
  14. PKG_HASH:=060309d7a333d38d951bc27598c677af1796934dbd98e1024e7ad8de798fedda
  15. PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
  16. PKG_LICENSE:=LGPL-2.1-or-later
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_CPE_ID:=cpe:/a:avahi:avahi
  19. PKG_INSTALL:=1
  20. PKG_BUILD_PARALLEL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/avahi/Default
  23. SECTION:=net
  24. CATEGORY:=Network
  25. TITLE:=An mDNS/DNS-SD implementation
  26. URL:=http://www.avahi.org/
  27. endef
  28. define Package/avahi/Default/description
  29. Avahi is an mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf)
  30. implementation (library). It facilitates
  31. service discovery on a local network -- this means that
  32. you can plug your laptop or computer into a network and
  33. instantly be able to view other people who you can chat with,
  34. find printers to print to or find files being shared.
  35. This kind of technology is already found in MacOS X
  36. (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf')
  37. and is very convenient.
  38. endef
  39. define Package/libavahi/Default
  40. $(call Package/avahi/Default)
  41. SECTION:=libs
  42. CATEGORY:=Libraries
  43. PROVIDES:=libavahi
  44. DEPENDS:=+libpthread
  45. endef
  46. define Package/libavahi/description
  47. $(call Package/avahi/Default/description)
  48. .
  49. The libavahi package contains the mDNS/DNS-SD shared libraries,
  50. used by other programs. Specifically, it provides
  51. libavahi-core and libavahi-common libraries.
  52. endef
  53. define Package/avahi-autoipd
  54. $(call Package/avahi/Default)
  55. SUBMENU:=IP Addresses and Names
  56. DEPENDS:=+libdaemon
  57. TITLE:=IPv4LL network address configuration daemon
  58. endef
  59. define Package/avahi-autoipd/description
  60. $(call Package/avahi/Default/description)
  61. .
  62. This package implements IPv4LL, "Dynamic Configuration of IPv4 Link-Local
  63. Addresses" (IETF RFC3927), a protocol for automatic IP address configuration
  64. from the link-local 169.254.0.0/16 range without the need for a central
  65. server. It is primarily intended to be used in ad-hoc networks which lack a
  66. DHCP server.
  67. endef
  68. define Package/avahi-dbus-daemon
  69. $(call Package/avahi/Default)
  70. PROVIDES:=avahi-daemon
  71. VARIANT:=dbus
  72. SUBMENU:=IP Addresses and Names
  73. DEPENDS:=+libavahi-dbus-support +libexpat +librt +libdaemon
  74. TITLE+= (daemon)
  75. endef
  76. define Package/avahi-nodbus-daemon
  77. $(call Package/avahi/Default)
  78. PROVIDES:=avahi-daemon
  79. VARIANT:=nodbus
  80. SUBMENU:=IP Addresses and Names
  81. DEPENDS:=+libavahi-nodbus-support +libexpat +librt +libdaemon
  82. TITLE+= (daemon)
  83. USERID:=avahi=105:avahi=105
  84. endef
  85. define Package/avahi-daemon/description
  86. $(call Package/avahi/Default/description)
  87. .
  88. This package contains an mDNS/DNS-SD daemon.
  89. endef
  90. Package/avahi-dbus-daemon/description=$(Package/avahi-daemon/description)
  91. Package/avahi-nodbus-daemon/description=$(Package/avahi-daemon/description)
  92. define Package/avahi-daemon/conffiles
  93. /etc/avahi/avahi-daemon.conf
  94. endef
  95. Package/avahi-dbus-daemon/conffiles=$(Package/avahi-daemon/conffiles)
  96. Package/avahi-nodbus-daemon/conffiles=$(Package/avahi-daemon/conffiles)
  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 +libpthread
  129. TITLE:=A Unicast DNS server using avahi-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/libavahi/Default)
  140. VARIANT:=dbus
  141. DEPENDS:=+dbus
  142. TITLE+= (D-Bus support)
  143. endef
  144. define Package/libavahi-nodbus-support
  145. $(call Package/libavahi/Default)
  146. VARIANT:=nodbus
  147. TITLE+= (No D-Bus)
  148. endef
  149. define Package/libavahi-dbus-support/description
  150. $(call Package/libavahi/description)
  151. .
  152. The libavahi-dbus-support package enables
  153. D-Bus support in avahi, needed to support
  154. the libavahi-client library and avahi-utils.
  155. .
  156. Selecting this package modifies the build configuration
  157. so that avahi packages are built with support for D-BUS enabled;
  158. it does not generate a separate binary of its own.
  159. It also automatically adds the D-Bus package to the build.
  160. libavahi-dbus-support is selected automatically if you select
  161. libavahi-client or avahi-utils.
  162. endef
  163. define Package/libavahi-nodbus-support/description
  164. $(call Package/libavahi/description)
  165. .
  166. Selecting this package modifies the build configuration
  167. so that avahi packages are built without support for D-BUS enabled;
  168. it does not generate a separate binary of its own.
  169. endef
  170. define Package/libavahi-client
  171. $(call Package/avahi/Default)
  172. SECTION:=libs
  173. CATEGORY:=Libraries
  174. VARIANT:=dbus
  175. DEPENDS:=+avahi-dbus-daemon
  176. TITLE+= (libavahi-client library)
  177. endef
  178. define Package/libavahi-client/description
  179. $(call Package/avahi/Default/description)
  180. .
  181. This packages adds the libavahi-client library.
  182. It also automatically adds the required
  183. libavahi-dbus-support and the avahi-dbus-daemon packages.
  184. For more information please see the avahi documentation.
  185. endef
  186. define Package/libavahi-compat-libdnssd
  187. $(call Package/avahi/Default)
  188. SECTION:=libs
  189. CATEGORY:=Libraries
  190. VARIANT:=dbus
  191. DEPENDS:=+libavahi-client
  192. TITLE+= (libdnssd)
  193. endef
  194. define Package/libavahi-compat-libdnssd/description
  195. $(call Package/avahi/Default/description)
  196. .
  197. This packages adds the libavahi-compat-libdnssd library.
  198. It also automatically adds the required libavahi-client package.
  199. For more information please see the avahi documentation.
  200. endef
  201. define Package/avahi-utils
  202. $(call Package/avahi/Default)
  203. SUBMENU:=IP Addresses and Names
  204. VARIANT:=dbus
  205. DEPENDS:=+libavahi-client +libgdbm
  206. TITLE+= (utilities)
  207. endef
  208. define Package/avahi-utils/description
  209. $(call Package/avahi/Default/description)
  210. .
  211. This packages installs the following avahi utility programs:
  212. avahi-browse, avahi-publish, avahi-resolve, avahi-set-host-name.
  213. It also automatically adds the required libavahi-client package.
  214. For more information please see the avahi documentation.
  215. endef
  216. TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE
  217. TARGET_LDFLAGS += $(if $(CONFIG_SSP_SUPPORT),-lssp_nonshared)
  218. CONFIGURE_ARGS += \
  219. --enable-shared \
  220. --enable-static \
  221. --disable-glib \
  222. --disable-gobject \
  223. --disable-introspection \
  224. --disable-qt3 \
  225. --disable-qt4 \
  226. --disable-qt5 \
  227. --disable-gtk \
  228. --disable-gtk3 \
  229. --disable-dbm \
  230. --enable-gdbm \
  231. --enable-libdaemon \
  232. --disable-libevent \
  233. --disable-python \
  234. --disable-python-dbus \
  235. --disable-mono \
  236. --disable-monodoc \
  237. --disable-doxygen-doc \
  238. --disable-doxygen-dot \
  239. --disable-doxygen-man \
  240. --disable-doxygen-rtf \
  241. --disable-doxygen-xml \
  242. --disable-doxygen-chm \
  243. --disable-doxygen-chi \
  244. --disable-doxygen-html \
  245. --disable-doxygen-ps \
  246. --disable-doxygen-pdf \
  247. --disable-manpages \
  248. --disable-xmltoman \
  249. --disable-tests \
  250. --with-xml=expat \
  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. ifeq ($(BUILD_VARIANT),dbus)
  257. ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
  258. CONFIGURE_ARGS += \
  259. --enable-compat-libdns_sd
  260. endif
  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. ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
  276. ifeq ($(BUILD_VARIANT),dbus)
  277. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd* $(1)/usr/lib/
  278. endif
  279. endif
  280. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  281. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
  282. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/avahi-core.pc
  283. ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
  284. ifeq ($(BUILD_VARIANT),dbus)
  285. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/avahi-client.pc
  286. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/avahi-compat-libdns_sd.pc
  287. endif
  288. endif
  289. endef
  290. define Package/libavahi/install
  291. $(INSTALL_DIR) $(1)/usr/lib
  292. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
  293. endef
  294. define Package/libavahi-dbus-support/install
  295. $(call Package/libavahi/install,$(1))
  296. $(INSTALL_DIR) $(1)/etc/dbus-1/system.d
  297. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d
  298. endef
  299. Package/libavahi-nodbus-support/install=$(Package/libavahi/install)
  300. define Package/libavahi-client/install
  301. $(INSTALL_DIR) $(1)/usr/lib
  302. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/
  303. endef
  304. define Package/libavahi-compat-libdnssd/install
  305. $(INSTALL_DIR) $(1)/usr/lib
  306. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so* $(1)/usr/lib/
  307. endef
  308. define Package/avahi-utils/install
  309. $(INSTALL_DIR) $(1)/usr/bin
  310. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  311. endef
  312. define Package/avahi-autoipd/install
  313. $(INSTALL_DIR) $(1)/etc/avahi
  314. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
  315. $(INSTALL_DIR) $(1)/usr/sbin
  316. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
  317. $(INSTALL_DIR) $(1)/lib/netifd/proto
  318. $(INSTALL_BIN) ./files/netifd-autoip.sh $(1)/lib/netifd/proto/autoip.sh
  319. endef
  320. define Package/avahi-daemon/install
  321. $(INSTALL_DIR) $(1)/usr/sbin
  322. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
  323. $(INSTALL_DIR) $(1)/etc/avahi
  324. $(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/
  325. # install empty service directory so that user knows where
  326. # to place custom service files
  327. $(INSTALL_DIR) $(1)/etc/avahi/services
  328. $(INSTALL_DIR) $(1)/etc/init.d
  329. $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
  330. endef
  331. Package/avahi-dbus-daemon/install=$(Package/avahi-daemon/install)
  332. Package/avahi-nodbus-daemon/install=$(Package/avahi-daemon/install)
  333. define Package/avahi-daemon-service-http/install
  334. $(INSTALL_DIR) $(1)/etc/avahi/services
  335. $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
  336. endef
  337. define Package/avahi-daemon-service-ssh/install
  338. $(INSTALL_DIR) $(1)/etc/avahi/services
  339. $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
  340. endef
  341. define Package/avahi-dnsconfd/install
  342. $(INSTALL_DIR) $(1)/etc/avahi
  343. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
  344. $(INSTALL_DIR) $(1)/usr/sbin
  345. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
  346. endef
  347. $(eval $(call BuildPackage,libavahi-client))
  348. $(eval $(call BuildPackage,libavahi-compat-libdnssd))
  349. $(eval $(call BuildPackage,avahi-utils))
  350. $(eval $(call BuildPackage,libavahi-dbus-support))
  351. $(eval $(call BuildPackage,libavahi-nodbus-support))
  352. $(eval $(call BuildPackage,avahi-autoipd))
  353. $(eval $(call BuildPackage,avahi-dbus-daemon))
  354. $(eval $(call BuildPackage,avahi-nodbus-daemon))
  355. $(eval $(call BuildPackage,avahi-daemon-service-http))
  356. $(eval $(call BuildPackage,avahi-daemon-service-ssh))
  357. $(eval $(call BuildPackage,avahi-dnsconfd))