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:=4
  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-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))