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.

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