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.

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