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.

419 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:=4
  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. --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. ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
  263. CONFIGURE_ARGS += \
  264. --enable-compat-libdns_sd
  265. endif
  266. CONFIGURE_ARGS += \
  267. --enable-dbus
  268. else
  269. CONFIGURE_ARGS += \
  270. --disable-dbus
  271. endif
  272. CONFIGURE_VARS+= \
  273. CFLAGS="$$$$CFLAGS -DNDEBUG -DDISABLE_SYSTEMD" \
  274. ac_cv_header_sys_capability_h=no \
  275. define Build/InstallDev
  276. $(INSTALL_DIR) $(1)/usr/include
  277. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  278. $(INSTALL_DIR) $(1)/usr/lib
  279. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-* $(1)/usr/lib/
  280. ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
  281. ifeq ($(BUILD_VARIANT),dbus)
  282. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd* $(1)/usr/lib/
  283. endif
  284. endif
  285. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  286. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
  287. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/avahi-core.pc
  288. ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),)
  289. ifeq ($(BUILD_VARIANT),dbus)
  290. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/avahi-client.pc
  291. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/avahi-compat-libdns_sd.pc
  292. endif
  293. endif
  294. endef
  295. define Package/libavahi/install
  296. $(INSTALL_DIR) $(1)/usr/lib
  297. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/
  298. endef
  299. define Package/libavahi-dbus-support/install
  300. $(call Package/libavahi/install,$(1))
  301. $(INSTALL_DIR) $(1)/etc/dbus-1/system.d
  302. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d
  303. endef
  304. Package/libavahi-nodbus-support/install=$(Package/libavahi/install)
  305. define Package/libavahi-client/install
  306. $(INSTALL_DIR) $(1)/usr/lib
  307. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/
  308. endef
  309. define Package/libavahi-compat-libdnssd/install
  310. $(INSTALL_DIR) $(1)/usr/lib
  311. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so* $(1)/usr/lib/
  312. endef
  313. define Package/avahi-utils/install
  314. $(INSTALL_DIR) $(1)/usr/bin
  315. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  316. endef
  317. define Package/avahi-autoipd/install
  318. $(INSTALL_DIR) $(1)/etc/avahi
  319. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
  320. $(INSTALL_DIR) $(1)/usr/sbin
  321. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
  322. $(INSTALL_DIR) $(1)/lib/netifd/proto
  323. $(INSTALL_BIN) ./files/netifd-autoip.sh $(1)/lib/netifd/proto/autoip.sh
  324. endef
  325. define Package/avahi-daemon/install
  326. $(INSTALL_DIR) $(1)/usr/sbin
  327. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/
  328. $(INSTALL_DIR) $(1)/etc/avahi
  329. $(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/
  330. # install empty service directory so that user knows where
  331. # to place custom service files
  332. $(INSTALL_DIR) $(1)/etc/avahi/services
  333. $(INSTALL_DIR) $(1)/etc/init.d
  334. $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon
  335. endef
  336. Package/avahi-dbus-daemon/install=$(Package/avahi-daemon/install)
  337. Package/avahi-nodbus-daemon/install=$(Package/avahi-daemon/install)
  338. define Package/avahi-daemon-service-http/install
  339. $(INSTALL_DIR) $(1)/etc/avahi/services
  340. $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service
  341. endef
  342. define Package/avahi-daemon-service-ssh/install
  343. $(INSTALL_DIR) $(1)/etc/avahi/services
  344. $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service
  345. endef
  346. define Package/avahi-dnsconfd/install
  347. $(INSTALL_DIR) $(1)/etc/avahi
  348. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/
  349. $(INSTALL_DIR) $(1)/usr/sbin
  350. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/
  351. endef
  352. $(eval $(call BuildPackage,libavahi-client))
  353. $(eval $(call BuildPackage,libavahi-compat-libdnssd))
  354. $(eval $(call BuildPackage,avahi-utils))
  355. $(eval $(call BuildPackage,libavahi-dbus-support))
  356. $(eval $(call BuildPackage,libavahi-nodbus-support))
  357. $(eval $(call BuildPackage,avahi-autoipd))
  358. $(eval $(call BuildPackage,avahi-dbus-daemon))
  359. $(eval $(call BuildPackage,avahi-nodbus-daemon))
  360. $(eval $(call BuildPackage,avahi-daemon-service-http))
  361. $(eval $(call BuildPackage,avahi-daemon-service-ssh))
  362. $(eval $(call BuildPackage,avahi-dnsconfd))