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.

408 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.6.32
  10. PKG_RELEASE:=3
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://github.com/lathiat/avahi/releases/download/v$(PKG_VERSION)
  13. PKG_HASH:=d54991185d514a0aba54ebeb408d7575b60f5818a772e28fa0e18b98bc1db454
  14. PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
  15. PKG_BUILD_DEPENDS:=intltool/host
  16. PKG_FIXUP:=autoreconf
  17. PKG_REMOVE_FILES:=autogen.sh
  18. PKG_INSTALL:=1
  19. PKG_BUILD_PARALLEL:=1
  20. ifeq ($(BUILD_VARIANT),dbus)
  21. PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/dbus/$(PKG_NAME)-$(PKG_VERSION)
  22. else
  23. PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/nodbus/$(PKG_NAME)-$(PKG_VERSION)
  24. endif
  25. include $(INCLUDE_DIR)/package.mk
  26. define Package/avahi/Default
  27. SECTION:=net
  28. CATEGORY:=Network
  29. TITLE:=An mDNS/DNS-SD implementation
  30. URL:=http://www.avahi.org/
  31. endef
  32. define Package/avahi/Default/description
  33. Avahi is an mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf)
  34. implementation (library). It facilitates
  35. service discovery on a local network -- this means that
  36. you can plug your laptop or computer into a network and
  37. instantly be able to view other people who you can chat with,
  38. find printers to print to or find files being shared.
  39. This kind of technology is already found in MacOS X
  40. (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf')
  41. and is very convenient.
  42. endef
  43. define Package/libavahi/Default
  44. $(call Package/avahi/Default)
  45. SECTION:=libs
  46. CATEGORY:=Libraries
  47. PROVIDES:=libavahi
  48. DEPENDS:=+libpthread
  49. endef
  50. define Package/libavahi/description
  51. $(call Package/avahi/Default/description)
  52. .
  53. The libavahi package contains the mDNS/DNS-SD shared libraries,
  54. used by other programs. Specifically, it provides
  55. libavahi-core and libavahi-common libraries.
  56. endef
  57. define Package/avahi-autoipd
  58. $(call Package/avahi/Default)
  59. SUBMENU:=IP Addresses and Names
  60. DEPENDS:=+libdaemon
  61. TITLE:=IPv4LL network address configuration daemon
  62. endef
  63. define Package/avahi-autoipd/description
  64. $(call Package/avahi/Default/description)
  65. .
  66. This package implements IPv4LL, "Dynamic Configuration of IPv4 Link-Local
  67. Addresses" (IETF RFC3927), a protocol for automatic IP address configuration
  68. from the link-local 169.254.0.0/16 range without the need for a central
  69. server. It is primarily intended to be used in ad-hoc networks which lack a
  70. DHCP server.
  71. endef
  72. define Package/avahi-dbus-daemon
  73. $(call Package/avahi/Default)
  74. PROVIDES:=avahi-daemon
  75. VARIANT:=dbus
  76. SUBMENU:=IP Addresses and Names
  77. DEPENDS:=+libavahi-dbus-support +libexpat +librt +libdaemon
  78. TITLE+= (daemon)
  79. endef
  80. define Package/avahi-nodbus-daemon
  81. $(call Package/avahi/Default)
  82. PROVIDES:=avahi-daemon
  83. VARIANT:=nodbus
  84. SUBMENU:=IP Addresses and Names
  85. DEPENDS:=+libavahi-nodbus-support +libexpat +librt +libdaemon
  86. TITLE+= (daemon)
  87. USERID:=avahi=105:avahi=105
  88. endef
  89. define Package/avahi-daemon/description
  90. $(call Package/avahi/Default/description)
  91. .
  92. This package contains an mDNS/DNS-SD daemon.
  93. endef
  94. Package/avahi-dbus-daemon/description=$(Package/avahi-daemon/description)
  95. Package/avahi-nodbus-daemon/description=$(Package/avahi-daemon/description)
  96. define Package/avahi-daemon/conffiles
  97. /etc/avahi/avahi-daemon.conf
  98. endef
  99. Package/avahi-dbus-daemon/conffiles=$(Package/avahi-daemon/conffiles)
  100. Package/avahi-nodbus-daemon/conffiles=$(Package/avahi-daemon/conffiles)
  101. define Package/avahi-daemon-service-http
  102. $(call Package/avahi/Default)
  103. SUBMENU:=IP Addresses and Names
  104. DEPENDS:=+avahi-daemon
  105. TITLE:=Announce HTTP service
  106. endef
  107. define Package/avahi-daemon-service-http/description
  108. $(call Package/avahi/Default/description)
  109. .
  110. This package contains the service definition for announcing HTTP service.
  111. endef
  112. define Package/avahi-daemon-service-http/conffiles
  113. /etc/avahi/services/http.service
  114. endef
  115. define Package/avahi-daemon-service-ssh
  116. $(call Package/avahi/Default)
  117. SUBMENU:=IP Addresses and Names
  118. DEPENDS:=+avahi-daemon
  119. TITLE:=Announce SSH service
  120. endef
  121. define Package/avahi-daemon-service-ssh/description
  122. $(call Package/avahi/Default/description)
  123. .
  124. This package contains the service definition for announcing SSH service.
  125. endef
  126. define Package/avahi-daemon-service-ssh/conffiles
  127. /etc/avahi/services/ssh.service
  128. endef
  129. define Package/avahi-dnsconfd
  130. $(call Package/avahi/Default)
  131. SUBMENU:=IP Addresses and Names
  132. DEPENDS:=+libavahi +libdaemon +libpthread
  133. TITLE:=A Unicast DNS server using avahi-daemon
  134. endef
  135. define Package/avahi-dnsconfd/description
  136. $(call Package/avahi/Default/description)
  137. .
  138. This package contains a Unicast DNS server from mDNS/DNS-SD configuration
  139. daemon, which may be used to configure conventional DNS servers using mDNS
  140. in a DHCP-like fashion. Especially useful on IPv6.
  141. endef
  142. define Package/libavahi-dbus-support
  143. $(call Package/libavahi/Default)
  144. VARIANT:=dbus
  145. DEPENDS:=+dbus
  146. TITLE+= (D-Bus support)
  147. endef
  148. define Package/libavahi-nodbus-support
  149. $(call Package/libavahi/Default)
  150. VARIANT:=nodbus
  151. TITLE+= (No D-Bus)
  152. endef
  153. define Package/libavahi-dbus-support/description
  154. $(call Package/libavahi/description)
  155. .
  156. The libavahi-dbus-support package enables
  157. D-Bus support in avahi, needed to support
  158. the libavahi-client library and avahi-utils.
  159. .
  160. Selecting this package modifies the build configuration
  161. so that avahi packages are built with support for D-BUS enabled;
  162. it does not generate a separate binary of its own.
  163. It also automatically adds the D-Bus package to the build.
  164. libavahi-dbus-support is selected automatically if you select
  165. libavahi-client or avahi-utils.
  166. endef
  167. define Package/libavahi-nodbus-support/description
  168. $(call Package/libavahi/description)
  169. .
  170. Selecting this package modifies the build configuration
  171. so that avahi packages are built without support for D-BUS enabled;
  172. it does not generate a separate binary of its own.
  173. endef
  174. define Package/libavahi-client
  175. $(call Package/avahi/Default)
  176. SECTION:=libs
  177. CATEGORY:=Libraries
  178. VARIANT:=dbus
  179. DEPENDS:=+avahi-dbus-daemon
  180. TITLE+= (libavahi-client library)
  181. endef
  182. define Package/libavahi-client/description
  183. $(call Package/avahi/Default/description)
  184. .
  185. This packages adds the libavahi-client library.
  186. It also automatically adds the required
  187. libavahi-dbus-support and the avahi-dbus-daemon packages.
  188. For more information please see the avahi documentation.
  189. endef
  190. define Package/libavahi-compat-libdnssd
  191. $(call Package/avahi/Default)
  192. SECTION:=libs
  193. CATEGORY:=Libraries
  194. VARIANT:=dbus
  195. DEPENDS:=+libavahi-client
  196. TITLE+= (libdnssd)
  197. endef
  198. define Package/libavahi-compat-libdnssd/description
  199. $(call Package/avahi/Default/description)
  200. .
  201. This packages adds the libavahi-compat-libdnssd library.
  202. It also automatically adds the required libavahi-client package.
  203. For more information please see the avahi documentation.
  204. endef
  205. define Package/avahi-utils
  206. $(call Package/avahi/Default)
  207. SUBMENU:=IP Addresses and Names
  208. VARIANT:=dbus
  209. DEPENDS:=+libavahi-client +libgdbm
  210. TITLE+= (utilities)
  211. endef
  212. define Package/avahi-utils/description
  213. $(call Package/avahi/Default/description)
  214. .
  215. This packages installs the following avahi utility programs:
  216. avahi-browse, avahi-publish, avahi-resolve, avahi-set-host-name.
  217. It also automatically adds the required libavahi-client package.
  218. For more information please see the avahi documentation.
  219. endef
  220. TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE
  221. CONFIGURE_ARGS+= \
  222. --enable-shared \
  223. --enable-static \
  224. --disable-glib \
  225. --disable-gobject \
  226. --disable-qt3 \
  227. --disable-qt4 \
  228. --disable-gtk \
  229. --disable-gtk3 \
  230. --with-xml=expat \
  231. --disable-dbm \
  232. --enable-gdbm \
  233. --enable-libdaemon \
  234. $(and $(CONFIG_PACKAGE_libavahi-compat-libdnssd),ifeq ($(BUILD_VARIANT),dbus),\
  235. --enable-compat-libdns_sd) \
  236. --disable-python \
  237. --disable-pygtk \
  238. --disable-python-dbus \
  239. --disable-mono \
  240. --disable-monodoc \
  241. --disable-doxygen-doc \
  242. --disable-doxygen-dot \
  243. --disable-doxygen-man \
  244. --disable-doxygen-rtf \
  245. --disable-doxygen-xml \
  246. --disable-doxygen-chm \
  247. --disable-doxygen-chi \
  248. --disable-doxygen-html \
  249. --disable-doxygen-ps \
  250. --disable-doxygen-pdf \
  251. --disable-xmltoman \
  252. --with-distro=none \
  253. --with-avahi-user=nobody \
  254. --with-avahi-group=nogroup \
  255. --with-autoipd-user=nobody \
  256. --with-autoipd-group=nogroup
  257. ifneq ($(CONFIG_SSP_SUPPORT),y)
  258. CONFIGURE_ARGS+= \
  259. --disable-stack-protector
  260. endif
  261. ifeq ($(BUILD_VARIANT),dbus)
  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. $(CP) $(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))