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.

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