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.

404 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_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. CONFIGURE_ARGS += \
  218. --enable-shared \
  219. --enable-static \
  220. --disable-glib \
  221. --disable-gobject \
  222. --disable-introspection \
  223. --disable-qt3 \
  224. --disable-qt4 \
  225. --disable-qt5 \
  226. --disable-gtk \
  227. --disable-gtk3 \
  228. --disable-dbm \
  229. --enable-gdbm \
  230. --enable-libdaemon \
  231. --disable-libevent \
  232. --disable-python \
  233. --disable-python-dbus \
  234. --disable-mono \
  235. --disable-monodoc \
  236. --disable-doxygen-doc \
  237. --disable-doxygen-dot \
  238. --disable-doxygen-man \
  239. --disable-doxygen-rtf \
  240. --disable-doxygen-xml \
  241. --disable-doxygen-chm \
  242. --disable-doxygen-chi \
  243. --disable-doxygen-html \
  244. --disable-doxygen-ps \
  245. --disable-doxygen-pdf \
  246. --disable-manpages \
  247. --disable-xmltoman \
  248. --disable-tests \
  249. --with-xml=expat \
  250. --with-distro=none \
  251. --with-avahi-user=nobody \
  252. --with-avahi-group=nogroup \
  253. --with-avahi-priv-access-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. endef
  283. define Package/libavahi/install
  284. $(INSTALL_DIR) $(1)/usr/lib
  285. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
  286. endef
  287. define Package/libavahi-dbus-support/install
  288. $(call Package/libavahi/install,$(1))
  289. $(INSTALL_DIR) $(1)/etc/dbus-1/system.d
  290. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d
  291. endef
  292. Package/libavahi-nodbus-support/install=$(Package/libavahi/install)
  293. define Package/libavahi-client/install
  294. $(INSTALL_DIR) $(1)/usr/lib
  295. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/
  296. endef
  297. define Package/libavahi-compat-libdnssd/install
  298. $(INSTALL_DIR) $(1)/usr/lib
  299. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so* $(1)/usr/lib/
  300. endef
  301. define Package/avahi-utils/install
  302. $(INSTALL_DIR) $(1)/usr/bin
  303. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  304. endef
  305. define Package/avahi-autoipd/install
  306. $(INSTALL_DIR) $(1)/etc/avahi
  307. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
  308. $(INSTALL_DIR) $(1)/usr/sbin
  309. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
  310. $(INSTALL_DIR) $(1)/lib/netifd/proto
  311. $(INSTALL_BIN) ./files/netifd-autoip.sh $(1)/lib/netifd/proto/autoip.sh
  312. endef
  313. define Package/avahi-daemon/install
  314. $(INSTALL_DIR) $(1)/usr/sbin
  315. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
  316. $(INSTALL_DIR) $(1)/etc/avahi
  317. $(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/
  318. # install empty service directory so that user knows where
  319. # to place custom service files
  320. $(INSTALL_DIR) $(1)/etc/avahi/services
  321. $(INSTALL_DIR) $(1)/etc/init.d
  322. $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
  323. endef
  324. Package/avahi-dbus-daemon/install=$(Package/avahi-daemon/install)
  325. Package/avahi-nodbus-daemon/install=$(Package/avahi-daemon/install)
  326. define Package/avahi-daemon-service-http/install
  327. $(INSTALL_DIR) $(1)/etc/avahi/services
  328. $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
  329. endef
  330. define Package/avahi-daemon-service-ssh/install
  331. $(INSTALL_DIR) $(1)/etc/avahi/services
  332. $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
  333. endef
  334. define Package/avahi-dnsconfd/install
  335. $(INSTALL_DIR) $(1)/etc/avahi
  336. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
  337. $(INSTALL_DIR) $(1)/usr/sbin
  338. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
  339. endef
  340. $(eval $(call BuildPackage,libavahi-client))
  341. $(eval $(call BuildPackage,libavahi-compat-libdnssd))
  342. $(eval $(call BuildPackage,avahi-utils))
  343. $(eval $(call BuildPackage,libavahi-dbus-support))
  344. $(eval $(call BuildPackage,libavahi-nodbus-support))
  345. $(eval $(call BuildPackage,avahi-autoipd))
  346. $(eval $(call BuildPackage,avahi-dbus-daemon))
  347. $(eval $(call BuildPackage,avahi-nodbus-daemon))
  348. $(eval $(call BuildPackage,avahi-daemon-service-http))
  349. $(eval $(call BuildPackage,avahi-daemon-service-ssh))
  350. $(eval $(call BuildPackage,avahi-dnsconfd))