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.

415 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.7
  10. PKG_RELEASE:=5
  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:=57a99b5dfe7fdae794e3d1ee7a62973a368e91e414bd0dfa5d84434de5b14804
  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_BUILD_DEPENDS:=intltool/host
  20. PKG_FIXUP:=autoreconf
  21. PKG_REMOVE_FILES:=autogen.sh
  22. PKG_INSTALL:=1
  23. PKG_BUILD_PARALLEL:=1
  24. include $(INCLUDE_DIR)/package.mk
  25. define Package/avahi/Default
  26. SECTION:=net
  27. CATEGORY:=Network
  28. TITLE:=An mDNS/DNS-SD implementation
  29. URL:=http://www.avahi.org/
  30. endef
  31. define Package/avahi/Default/description
  32. Avahi is an mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf)
  33. implementation (library). It facilitates
  34. service discovery on a local network -- this means that
  35. you can plug your laptop or computer into a network and
  36. instantly be able to view other people who you can chat with,
  37. find printers to print to or find files being shared.
  38. This kind of technology is already found in MacOS X
  39. (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf')
  40. and is very convenient.
  41. endef
  42. define Package/libavahi/Default
  43. $(call Package/avahi/Default)
  44. SECTION:=libs
  45. CATEGORY:=Libraries
  46. PROVIDES:=libavahi
  47. DEPENDS:=+libpthread
  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. USERID:=avahi=105:avahi=105
  87. endef
  88. define Package/avahi-daemon/description
  89. $(call Package/avahi/Default/description)
  90. .
  91. This package contains an mDNS/DNS-SD daemon.
  92. endef
  93. Package/avahi-dbus-daemon/description=$(Package/avahi-daemon/description)
  94. Package/avahi-nodbus-daemon/description=$(Package/avahi-daemon/description)
  95. define Package/avahi-daemon/conffiles
  96. /etc/avahi/avahi-daemon.conf
  97. endef
  98. Package/avahi-dbus-daemon/conffiles=$(Package/avahi-daemon/conffiles)
  99. Package/avahi-nodbus-daemon/conffiles=$(Package/avahi-daemon/conffiles)
  100. define Package/avahi-daemon-service-http
  101. $(call Package/avahi/Default)
  102. SUBMENU:=IP Addresses and Names
  103. DEPENDS:=+avahi-daemon
  104. TITLE:=Announce HTTP service
  105. endef
  106. define Package/avahi-daemon-service-http/description
  107. $(call Package/avahi/Default/description)
  108. .
  109. This package contains the service definition for announcing HTTP service.
  110. endef
  111. define Package/avahi-daemon-service-http/conffiles
  112. /etc/avahi/services/http.service
  113. endef
  114. define Package/avahi-daemon-service-ssh
  115. $(call Package/avahi/Default)
  116. SUBMENU:=IP Addresses and Names
  117. DEPENDS:=+avahi-daemon
  118. TITLE:=Announce SSH service
  119. endef
  120. define Package/avahi-daemon-service-ssh/description
  121. $(call Package/avahi/Default/description)
  122. .
  123. This package contains the service definition for announcing SSH service.
  124. endef
  125. define Package/avahi-daemon-service-ssh/conffiles
  126. /etc/avahi/services/ssh.service
  127. endef
  128. define Package/avahi-dnsconfd
  129. $(call Package/avahi/Default)
  130. SUBMENU:=IP Addresses and Names
  131. DEPENDS:=+libavahi +libdaemon +libpthread
  132. TITLE:=A Unicast DNS server using avahi-daemon
  133. endef
  134. define Package/avahi-dnsconfd/description
  135. $(call Package/avahi/Default/description)
  136. .
  137. This package contains a Unicast DNS server from mDNS/DNS-SD configuration
  138. daemon, which may be used to configure conventional DNS servers using mDNS
  139. in a DHCP-like fashion. Especially useful on IPv6.
  140. endef
  141. define Package/libavahi-dbus-support
  142. $(call Package/libavahi/Default)
  143. VARIANT:=dbus
  144. DEPENDS:=+dbus
  145. TITLE+= (D-Bus support)
  146. endef
  147. define Package/libavahi-nodbus-support
  148. $(call Package/libavahi/Default)
  149. VARIANT:=nodbus
  150. TITLE+= (No D-Bus)
  151. endef
  152. define Package/libavahi-dbus-support/description
  153. $(call Package/libavahi/description)
  154. .
  155. The libavahi-dbus-support package enables
  156. D-Bus support in avahi, needed to support
  157. the libavahi-client library and avahi-utils.
  158. .
  159. Selecting this package modifies the build configuration
  160. so that avahi packages are built with support for D-BUS enabled;
  161. it does not generate a separate binary of its own.
  162. It also automatically adds the D-Bus package to the build.
  163. libavahi-dbus-support is selected automatically if you select
  164. libavahi-client or avahi-utils.
  165. endef
  166. define Package/libavahi-nodbus-support/description
  167. $(call Package/libavahi/description)
  168. .
  169. Selecting this package modifies the build configuration
  170. so that avahi packages are built without support for D-BUS enabled;
  171. it does not generate a separate binary of its own.
  172. endef
  173. define Package/libavahi-client
  174. $(call Package/avahi/Default)
  175. SECTION:=libs
  176. CATEGORY:=Libraries
  177. VARIANT:=dbus
  178. DEPENDS:=+avahi-dbus-daemon
  179. TITLE+= (libavahi-client library)
  180. endef
  181. define Package/libavahi-client/description
  182. $(call Package/avahi/Default/description)
  183. .
  184. This packages adds the libavahi-client library.
  185. It also automatically adds the required
  186. libavahi-dbus-support and the avahi-dbus-daemon packages.
  187. For more information please see the avahi documentation.
  188. endef
  189. define Package/libavahi-compat-libdnssd
  190. $(call Package/avahi/Default)
  191. SECTION:=libs
  192. CATEGORY:=Libraries
  193. VARIANT:=dbus
  194. DEPENDS:=+libavahi-client
  195. TITLE+= (libdnssd)
  196. endef
  197. define Package/libavahi-compat-libdnssd/description
  198. $(call Package/avahi/Default/description)
  199. .
  200. This packages adds the libavahi-compat-libdnssd library.
  201. It also automatically adds the required libavahi-client package.
  202. For more information please see the avahi documentation.
  203. endef
  204. define Package/avahi-utils
  205. $(call Package/avahi/Default)
  206. SUBMENU:=IP Addresses and Names
  207. VARIANT:=dbus
  208. DEPENDS:=+libavahi-client +libgdbm
  209. TITLE+= (utilities)
  210. endef
  211. define Package/avahi-utils/description
  212. $(call Package/avahi/Default/description)
  213. .
  214. This packages installs the following avahi utility programs:
  215. avahi-browse, avahi-publish, avahi-resolve, avahi-set-host-name.
  216. It also automatically adds the required libavahi-client package.
  217. For more information please see the avahi documentation.
  218. endef
  219. TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE
  220. CONFIGURE_ARGS+= \
  221. --enable-shared \
  222. --enable-static \
  223. --disable-glib \
  224. --disable-gobject \
  225. --disable-qt3 \
  226. --disable-qt4 \
  227. --disable-gtk \
  228. --disable-gtk3 \
  229. --with-xml=expat \
  230. --disable-dbm \
  231. --enable-gdbm \
  232. --enable-libdaemon \
  233. --disable-python \
  234. --disable-pygtk \
  235. --disable-python-dbus \
  236. --disable-mono \
  237. --disable-monodoc \
  238. --disable-doxygen-doc \
  239. --disable-doxygen-dot \
  240. --disable-doxygen-man \
  241. --disable-doxygen-rtf \
  242. --disable-doxygen-xml \
  243. --disable-doxygen-chm \
  244. --disable-doxygen-chi \
  245. --disable-doxygen-html \
  246. --disable-doxygen-ps \
  247. --disable-doxygen-pdf \
  248. --disable-xmltoman \
  249. --with-distro=none \
  250. --with-avahi-user=nobody \
  251. --with-avahi-group=nogroup \
  252. --with-autoipd-user=nobody \
  253. --with-autoipd-group=nogroup
  254. ifneq ($(CONFIG_SSP_SUPPORT),y)
  255. CONFIGURE_ARGS+= \
  256. --disable-stack-protector
  257. endif
  258. ifeq ($(BUILD_VARIANT),dbus)
  259. ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
  260. CONFIGURE_ARGS += \
  261. --enable-compat-libdns_sd
  262. endif
  263. CONFIGURE_ARGS += \
  264. --enable-dbus
  265. else
  266. CONFIGURE_ARGS += \
  267. --disable-dbus
  268. endif
  269. CONFIGURE_VARS+= \
  270. CFLAGS="$$$$CFLAGS -DNDEBUG -DDISABLE_SYSTEMD" \
  271. ac_cv_header_sys_capability_h=no \
  272. define Build/InstallDev
  273. $(INSTALL_DIR) $(1)/usr/include
  274. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  275. $(INSTALL_DIR) $(1)/usr/lib
  276. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-* $(1)/usr/lib/
  277. ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
  278. ifeq ($(BUILD_VARIANT),dbus)
  279. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd* $(1)/usr/lib/
  280. endif
  281. endif
  282. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  283. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
  284. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/avahi-core.pc
  285. ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
  286. ifeq ($(BUILD_VARIANT),dbus)
  287. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/avahi-client.pc
  288. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/avahi-compat-libdns_sd.pc
  289. endif
  290. endif
  291. endef
  292. define Package/libavahi/install
  293. $(INSTALL_DIR) $(1)/usr/lib
  294. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
  295. endef
  296. define Package/libavahi-dbus-support/install
  297. $(call Package/libavahi/install,$(1))
  298. $(INSTALL_DIR) $(1)/etc/dbus-1/system.d
  299. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d
  300. endef
  301. Package/libavahi-nodbus-support/install=$(Package/libavahi/install)
  302. define Package/libavahi-client/install
  303. $(INSTALL_DIR) $(1)/usr/lib
  304. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/
  305. endef
  306. define Package/libavahi-compat-libdnssd/install
  307. $(INSTALL_DIR) $(1)/usr/lib
  308. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so* $(1)/usr/lib/
  309. endef
  310. define Package/avahi-utils/install
  311. $(INSTALL_DIR) $(1)/usr/bin
  312. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  313. endef
  314. define Package/avahi-autoipd/install
  315. $(INSTALL_DIR) $(1)/etc/avahi
  316. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
  317. $(INSTALL_DIR) $(1)/usr/sbin
  318. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
  319. $(INSTALL_DIR) $(1)/lib/netifd/proto
  320. $(INSTALL_BIN) ./files/netifd-autoip.sh $(1)/lib/netifd/proto/autoip.sh
  321. endef
  322. define Package/avahi-daemon/install
  323. $(INSTALL_DIR) $(1)/usr/sbin
  324. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
  325. $(INSTALL_DIR) $(1)/etc/avahi
  326. $(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/
  327. # install empty service directory so that user knows where
  328. # to place custom service files
  329. $(INSTALL_DIR) $(1)/etc/avahi/services
  330. $(INSTALL_DIR) $(1)/etc/init.d
  331. $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
  332. endef
  333. Package/avahi-dbus-daemon/install=$(Package/avahi-daemon/install)
  334. Package/avahi-nodbus-daemon/install=$(Package/avahi-daemon/install)
  335. define Package/avahi-daemon-service-http/install
  336. $(INSTALL_DIR) $(1)/etc/avahi/services
  337. $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
  338. endef
  339. define Package/avahi-daemon-service-ssh/install
  340. $(INSTALL_DIR) $(1)/etc/avahi/services
  341. $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
  342. endef
  343. define Package/avahi-dnsconfd/install
  344. $(INSTALL_DIR) $(1)/etc/avahi
  345. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
  346. $(INSTALL_DIR) $(1)/usr/sbin
  347. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
  348. endef
  349. $(eval $(call BuildPackage,libavahi-client))
  350. $(eval $(call BuildPackage,libavahi-compat-libdnssd))
  351. $(eval $(call BuildPackage,avahi-utils))
  352. $(eval $(call BuildPackage,libavahi-dbus-support))
  353. $(eval $(call BuildPackage,libavahi-nodbus-support))
  354. $(eval $(call BuildPackage,avahi-autoipd))
  355. $(eval $(call BuildPackage,avahi-dbus-daemon))
  356. $(eval $(call BuildPackage,avahi-nodbus-daemon))
  357. $(eval $(call BuildPackage,avahi-daemon-service-http))
  358. $(eval $(call BuildPackage,avahi-daemon-service-ssh))
  359. $(eval $(call BuildPackage,avahi-dnsconfd))