22071322 Build of pkg:/system/network/avahi has to be moved from Desktop to Userland.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/Makefile Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,122 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+include ../../make-rules/shared-macros.mk
+# Override PATH set in shared-macros.mk by setting the GNU PATH as default.
+PATH=/usr/gnu/bin:/usr/bin
+
+COMPONENT_NAME= avahi
+COMPONENT_VERSION= 0.6.30
+COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
+COMPONENT_PROJECT_URL= http://www.avahi.org/
+COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
+COMPONENT_ARCHIVE_HASH= \
+ sha256:f9e4316c2339d0020726edd846d01bee0c39980906db0c247479e5807457ff1f
+COMPONENT_ARCHIVE_URL= http://www.avahi.org/download/$(COMPONENT_ARCHIVE)
+COMPONENT_BUGDB= library/avahi
+
+TPNO= 7879
+
+include $(WS_MAKE_RULES)/prep.mk
+include $(WS_MAKE_RULES)/configure.mk
+include $(WS_MAKE_RULES)/ips.mk
+
+# Set the pkg... path to search files in ./files/ dir (mainly the SMF manifests are there)
+PKG_PROTO_DIRS += $(COMPONENT_DIR)
+
+CONFIGURE_BINDIR.64 = $(CONFIGURE_PREFIX)/bin
+CONFIGURE_SBINDIR.64 = $(CONFIGURE_PREFIX)/bin
+CONFIGURE_OPTIONS += --enable-shared
+CONFIGURE_OPTIONS += --disable-static
+CONFIGURE_OPTIONS += --sysconfdir=/etc
+CONFIGURE_OPTIONS += --with-avahi-user=daemon
+CONFIGURE_OPTIONS += --with-avahi-group=other
+CONFIGURE_OPTIONS += --localstatedir=/var/avahi
+CONFIGURE_OPTIONS += --with-distro=none
+CONFIGURE_OPTIONS += --disable-gtk3
+CONFIGURE_OPTIONS += --disable-qt3
+CONFIGURE_OPTIONS += --disable-qt4
+CONFIGURE_OPTIONS += --disable-mono
+CONFIGURE_OPTIONS += --disable-monodoc
+CONFIGURE_OPTIONS += --enable-tests
+CONFIGURE_OPTIONS += --enable-expat
+CONFIGURE_OPTIONS += --disable-autoipd
+CONFIGURE_OPTIONS += --disable-gdbm
+CONFIGURE_OPTIONS += --enable-dbm
+# xmltoman is not available
+CONFIGURE_OPTIONS += --disable-manpages
+CONFIGURE_OPTIONS.64 += --enable-doxygen-man
+CONFIGURE_OPTIONS.32 += --disable-doxygen-man
+CONFIGURE_OPTIONS += CPP="$(CC) -E"
+CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
+LDFLAGS += -ldns_sd
+CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)"
+CONFIGURE_OPTIONS += PYTHON=$(PYTHON.$(PYTHON_VERSION))
+CONFIGURE_OPTIONS += am_cv_python_pythondir="$(PYTHON_VENDOR_PACKAGES)"
+CONFIGURE_OPTIONS += am_cv_python_pyexecdir="$(PYTHON_VENDOR_PACKAGES)"
+
+# NOCONFIGURE=yes -> do not execute "configure" directly from "autogen.sh" (/wo CONFIGURE_OPTIONS...)
+# running of configure /wo CONFIGURE_OPTIONS + ENV -> configure will fail (on --with-distro=none is missing)
+# because "sunos" is not among the distros known to avahi.
+COMPONENT_PREP_ACTION += \
+ ( cd $(@D) ; set NOCONFIGURE=yes $(CONFIG_SHELL) autogen.sh )
+# g-i-r-scanner also need to have PATH to cc
+COMPONENT_BUILD_ENV += CC="$(CC)"
+COMPONENT_BUILD_ENV += CFLAGS="$(CFLAGS)"
+COMPONENT_BUILD_ENV += LDFLAGS="$(LDFLAGS)"
+$(BUILD_32_and_64): PATH = $(SPRO_VROOT)/bin:/usr/gnu/bin:/usr/bin
+COMPONENT_POST_INSTALL_ACTION += \
+ ( $(PYTHON.$(PYTHON_VERSION)) -m compileall $(PROTO_DIR)/$(PYTHON_VENDOR_PACKAGES) )
+
+# Enable ASLR for this component
+ASLR_MODE = $(ASLR_ENABLE)
+
+# build standalone sub-components only
+SUBDIRS = avahi-common avahi-core avahi-client avahi-glib avahi-gobject avahi-ui
+$(BUILD_32): COMPONENT_BUILD_TARGETS += SUBDIRS="$(SUBDIRS)"
+$(INSTALL_32): COMPONENT_INSTALL_TARGETS += SUBDIRS="$(SUBDIRS)"
+
+# common targets
+configure: $(CONFIGURE_32_and_64)
+
+build: $(BUILD_32_and_64)
+
+install: $(INSTALL_32_and_64)
+
+test: $(NO_TESTS)
+
+system-test: $(NO_TESTS)
+
+REQUIRED_PACKAGES += library/desktop/gtk2
+REQUIRED_PACKAGES += library/expat
+REQUIRED_PACKAGES += library/glib2
+REQUIRED_PACKAGES += library/libdaemon
+REQUIRED_PACKAGES += runtime/python-27
+REQUIRED_PACKAGES += service/network/dns/mdns
+REQUIRED_PACKAGES += shell/ksh93
+REQUIRED_PACKAGES += system/core-os
+REQUIRED_PACKAGES += system/library
+REQUIRED_PACKAGES += system/library/dbus
+REQUIRED_PACKAGES += system/library/libdbus
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/avahi.license Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,517 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations
+below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it
+becomes a de-facto standard. To achieve this, non-free programs must
+be allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control
+compilation and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at least
+ three years, to give the same user the materials specified in
+ Subsection 6a, above, for a charge no more than the cost of
+ performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply, and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License
+may add an explicit geographical distribution limitation excluding those
+countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms
+of the ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library.
+It is safest to attach them to the start of each source file to most
+effectively convey the exclusion of warranty; and each file should
+have at least the "copyright" line and a pointer to where the full
+notice is found.
+
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or
+your school, if any, to sign a "copyright disclaimer" for the library,
+if necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James
+ Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/avahi.p5m Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,278 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+# man pages stability
+<transform file path=usr.*/man/.+ -> default mangler.man.stability volatile>
+
+# config files transforms
+# avahi is distributed from desktop with /etc/avahi empty yet
+#<transform file path=etc/.+ -> default preserve true>
+#<transform file path=etc/avahi/(?!.+/).+ -> default mode 644>
+
+# pkglint has a problem to find the appropriate modules when python executable has no .py
+<transform file path=usr/bin/avahi-bookmarks -> default pkg.depend.bypass-generate .*>
+<transform file path=usr/bin/avahi-bookmarks -> default pkg.linted.userland.action001.3 true>
+<transform file path=usr/bin/avahi-discover -> default pkg.depend.bypass-generate .*>
+<transform file path=usr/bin/avahi-discover -> default pkg.linted.userland.action001.3 true>
+
+# package attribs
+set name=pkg.fmri \
+ value=pkg:/system/network/avahi@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.summary value="Avahi client and bridge to mdns"
+set name=com.oracle.info.description \
+ value="System which facilitates service discovery on a local network."
+set name=com.oracle.info.tpno value=$(TPNO)
+set name=info.classification \
+ value=org.opensolaris.category.2008:Applications/Internet
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
+set name=org.opensolaris.arc-caseid value=LSARC/2007/464
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+
+# Desktop do not deliver any avahi config. files but it would rather to be changed
+dir path=etc/avahi
+#file path=etc/avahi/avahi-daemon.conf
+#file path=etc/avahi/avahi-dnsconfd.action
+#file path=etc/avahi/hosts
+# "as above" but without knowing where to put the service defs it is hard to configure anything
+dir path=etc/avahi/services
+#file path=etc/avahi/services/sftp-ssh.service
+#file path=etc/avahi/services/ssh.service
+#
+file path=etc/dbus-1/system.d/avahi-dbus.conf
+#
+
+# SMF service: svc:/system/avahi-bridge-dsd:default
+file files/avahi-bridge-dsd.xml \
+ path=lib/svc/manifest/system/avahi-bridge-dsd.xml
+# service method
+file files/svc-avahi-bridge-dsd path=lib/svc/method/svc-avahi-bridge-dsd
+#
+
+# not delivered by Desktop
+#file path=usr/bin/avahi-bookmarks
+file path=usr/bin/avahi-browse
+link path=usr/bin/avahi-browse-domains target=avahi-browse
+# LSARC/2007/464/ -> rename avahi-daemon to avahi-daemon-bridge-dsd
+#file path=usr/bin/avahi-daemon
+file path=usr/bin/avahi-discover
+# not delivered by Desktop
+#file path=usr/bin/avahi-discover-standalone
+# not delivered by Desktop
+#file path=usr/bin/avahi-dnsconfd
+file path=usr/bin/avahi-publish
+link path=usr/bin/avahi-publish-address target=avahi-publish
+link path=usr/bin/avahi-publish-service target=avahi-publish
+file path=usr/bin/avahi-resolve
+link path=usr/bin/avahi-resolve-address target=avahi-resolve
+link path=usr/bin/avahi-resolve-host-name target=avahi-resolve
+file path=usr/bin/avahi-set-host-name
+link path=usr/bin/bshell target=bssh
+file path=usr/bin/bssh
+link path=usr/bin/bvnc target=bssh
+#
+file path=usr/include/avahi-client/client.h
+file path=usr/include/avahi-client/lookup.h
+file path=usr/include/avahi-client/publish.h
+file path=usr/include/avahi-common/address.h
+file path=usr/include/avahi-common/alternative.h
+file path=usr/include/avahi-common/cdecl.h
+file path=usr/include/avahi-common/defs.h
+file path=usr/include/avahi-common/domain.h
+file path=usr/include/avahi-common/error.h
+file path=usr/include/avahi-common/gccmacro.h
+file path=usr/include/avahi-common/llist.h
+file path=usr/include/avahi-common/malloc.h
+file path=usr/include/avahi-common/rlist.h
+file path=usr/include/avahi-common/simple-watch.h
+file path=usr/include/avahi-common/strlst.h
+file path=usr/include/avahi-common/thread-watch.h
+file path=usr/include/avahi-common/timeval.h
+file path=usr/include/avahi-common/watch.h
+file path=usr/include/avahi-core/core.h
+file path=usr/include/avahi-core/log.h
+file path=usr/include/avahi-core/lookup.h
+file path=usr/include/avahi-core/publish.h
+file path=usr/include/avahi-core/rr.h
+file path=usr/include/avahi-glib/glib-malloc.h
+file path=usr/include/avahi-glib/glib-watch.h
+file path=usr/include/avahi-gobject/ga-client.h
+file path=usr/include/avahi-gobject/ga-entry-group.h
+file path=usr/include/avahi-gobject/ga-enums.h
+file path=usr/include/avahi-gobject/ga-error.h
+file path=usr/include/avahi-gobject/ga-record-browser.h
+file path=usr/include/avahi-gobject/ga-service-browser.h
+file path=usr/include/avahi-gobject/ga-service-resolver.h
+file path=usr/include/avahi-ui/avahi-ui.h
+#
+file path=usr/lib/$(MACH64)/girepository-1.0/Avahi-0.6.typelib
+file path=usr/lib/$(MACH64)/girepository-1.0/AvahiCore-0.6.typelib
+link path=usr/lib/$(MACH64)/libavahi-client.so target=libavahi-client.so.3.2.9
+link path=usr/lib/$(MACH64)/libavahi-client.so.3 target=libavahi-client.so.3.2.9
+file path=usr/lib/$(MACH64)/libavahi-client.so.3.2.9
+link path=usr/lib/$(MACH64)/libavahi-common.so target=libavahi-common.so.3.5.3
+link path=usr/lib/$(MACH64)/libavahi-common.so.3 target=libavahi-common.so.3.5.3
+file path=usr/lib/$(MACH64)/libavahi-common.so.3.5.3
+link path=usr/lib/$(MACH64)/libavahi-core.so target=libavahi-core.so.7.0.2
+link path=usr/lib/$(MACH64)/libavahi-core.so.7 target=libavahi-core.so.7.0.2
+file path=usr/lib/$(MACH64)/libavahi-core.so.7.0.2
+link path=usr/lib/$(MACH64)/libavahi-glib.so target=libavahi-glib.so.1.0.2
+link path=usr/lib/$(MACH64)/libavahi-glib.so.1 target=libavahi-glib.so.1.0.2
+file path=usr/lib/$(MACH64)/libavahi-glib.so.1.0.2
+link path=usr/lib/$(MACH64)/libavahi-gobject.so target=libavahi-gobject.so.0.0.4
+link path=usr/lib/$(MACH64)/libavahi-gobject.so.0 \
+ target=libavahi-gobject.so.0.0.4
+file path=usr/lib/$(MACH64)/libavahi-gobject.so.0.0.4
+link path=usr/lib/$(MACH64)/libavahi-ui.so target=libavahi-ui.so.0.1.4
+link path=usr/lib/$(MACH64)/libavahi-ui.so.0 target=libavahi-ui.so.0.1.4
+file path=usr/lib/$(MACH64)/libavahi-ui.so.0.1.4
+file path=usr/lib/$(MACH64)/pkgconfig/avahi-client.pc
+file path=usr/lib/$(MACH64)/pkgconfig/avahi-core.pc
+file path=usr/lib/$(MACH64)/pkgconfig/avahi-glib.pc
+file path=usr/lib/$(MACH64)/pkgconfig/avahi-gobject.pc
+file path=usr/lib/$(MACH64)/pkgconfig/avahi-ui.pc
+#
+file path=usr/lib/avahi/service-types.db.dir
+file path=usr/lib/avahi/service-types.db.pag
+#
+file path=usr/lib/girepository-1.0/Avahi-0.6.typelib
+file path=usr/lib/girepository-1.0/AvahiCore-0.6.typelib
+#
+link path=usr/lib/libavahi-client.so target=libavahi-client.so.3.2.9
+link path=usr/lib/libavahi-client.so.3 target=libavahi-client.so.3.2.9
+file path=usr/lib/libavahi-client.so.3.2.9
+link path=usr/lib/libavahi-common.so target=libavahi-common.so.3.5.3
+link path=usr/lib/libavahi-common.so.3 target=libavahi-common.so.3.5.3
+file path=usr/lib/libavahi-common.so.3.5.3
+link path=usr/lib/libavahi-core.so target=libavahi-core.so.7.0.2
+link path=usr/lib/libavahi-core.so.7 target=libavahi-core.so.7.0.2
+file path=usr/lib/libavahi-core.so.7.0.2
+link path=usr/lib/libavahi-glib.so target=libavahi-glib.so.1.0.2
+link path=usr/lib/libavahi-glib.so.1 target=libavahi-glib.so.1.0.2
+file path=usr/lib/libavahi-glib.so.1.0.2
+link path=usr/lib/libavahi-gobject.so target=libavahi-gobject.so.0.0.4
+link path=usr/lib/libavahi-gobject.so.0 target=libavahi-gobject.so.0.0.4
+file path=usr/lib/libavahi-gobject.so.0.0.4
+link path=usr/lib/libavahi-ui.so target=libavahi-ui.so.0.1.4
+link path=usr/lib/libavahi-ui.so.0 target=libavahi-ui.so.0.1.4
+file path=usr/lib/libavahi-ui.so.0.1.4
+file path=usr/lib/pkgconfig/avahi-client.pc
+file path=usr/lib/pkgconfig/avahi-core.pc
+file path=usr/lib/pkgconfig/avahi-glib.pc
+file path=usr/lib/pkgconfig/avahi-gobject.pc
+file path=usr/lib/pkgconfig/avahi-ui.pc
+#
+file path=usr/lib/python2.7/vendor-packages/64/avahi/ServiceTypeDatabase.py
+file path=usr/lib/python2.7/vendor-packages/64/avahi/ServiceTypeDatabase.pyc
+file path=usr/lib/python2.7/vendor-packages/64/avahi/__init__.py
+file path=usr/lib/python2.7/vendor-packages/64/avahi/__init__.pyc
+file path=usr/lib/python2.7/vendor-packages/64/avahi_discover/__init__.py
+file path=usr/lib/python2.7/vendor-packages/64/avahi_discover/__init__.pyc
+#
+
+# LSARC/2007/464/ -> rename avahi-daemon to avahi-daemon-bridge-dsd
+file usr/bin/avahi-daemon path=usr/sbin/avahi-daemon-bridge-dsd
+#
+
+#
+file path=usr/share/applications/avahi-discover.desktop
+file path=usr/share/applications/bssh.desktop
+file path=usr/share/applications/bvnc.desktop
+#
+file path=usr/share/avahi/avahi-service.dtd
+file path=usr/share/avahi/interfaces/avahi-discover.ui
+file path=usr/share/avahi/service-types
+#
+file path=usr/share/dbus-1/interfaces/org.freedesktop.Avahi.AddressResolver.xml
+file path=usr/share/dbus-1/interfaces/org.freedesktop.Avahi.DomainBrowser.xml
+file path=usr/share/dbus-1/interfaces/org.freedesktop.Avahi.EntryGroup.xml
+file path=usr/share/dbus-1/interfaces/org.freedesktop.Avahi.HostNameResolver.xml
+file path=usr/share/dbus-1/interfaces/org.freedesktop.Avahi.RecordBrowser.xml
+file path=usr/share/dbus-1/interfaces/org.freedesktop.Avahi.Server.xml
+file path=usr/share/dbus-1/interfaces/org.freedesktop.Avahi.ServiceBrowser.xml
+file path=usr/share/dbus-1/interfaces/org.freedesktop.Avahi.ServiceResolver.xml
+file path=usr/share/dbus-1/interfaces/org.freedesktop.Avahi.ServiceTypeBrowser.xml
+#
+file path=usr/share/gir-1.0/Avahi-0.6.gir
+file path=usr/share/gir-1.0/AvahiCore-0.6.gir
+#
+file path=usr/share/locale/bg/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/ca/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/cs/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/da/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/de/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/el/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/en_AU/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/en_CA/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/en_GB/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/en_NZ/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/es/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/fi/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/fo/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/fr/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/gl/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/he/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/hu/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/id/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/it/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/ja/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/ms/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/nl/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/pl/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/pt_BR/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/ro/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/ru/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/sl/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/sr/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/sr@latin/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/sv/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/uk/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/zh_CN/LC_MESSAGES/avahi.mo
+file path=usr/share/locale/zh_TW/LC_MESSAGES/avahi.mo
+link path=usr/share/man/man1/avahi-browse-domains.1 target=avahi-browse.1
+#
+
+# Man pages can not be rebuilt because the xmltoman is missing on Solaris
+# ...current man pages are patched instead.
+file man/avahi-browse.1 path=usr/share/man/man1/avahi-browse.1
+file man/avahi-daemon-bridge-dsd.1 \
+ path=usr/share/man/man1/avahi-daemon-bridge-dsd.1
+file man/avahi-discover.1 path=usr/share/man/man1/avahi-discover.1
+link path=usr/share/man/man1/avahi-publish-address.1 target=avahi-publish.1
+link path=usr/share/man/man1/avahi-publish-service.1 target=avahi-publish.1
+file man/avahi-publish.1 path=usr/share/man/man1/avahi-publish.1
+link path=usr/share/man/man1/avahi-resolve-address.1 target=avahi-resolve.1
+link path=usr/share/man/man1/avahi-resolve-host-name.1 target=avahi-resolve.1
+file man/avahi-resolve.1 path=usr/share/man/man1/avahi-resolve.1
+file man/avahi-set-host-name.1 path=usr/share/man/man1/avahi-set-host-name.1
+file man/bssh.1 path=usr/share/man/man1/bssh.1
+link path=usr/share/man/man1/bvnc.1 target=bssh.1
+#
+dir path=var/avahi
+dir path=var/avahi/run
+#
+
+# license file
+license avahi.license license=$(COPYRIGHTS)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/files/avahi-bridge-dsd.xml Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,103 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<!--
+ Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ Use is subject to license terms.
+
+ CDDL HEADER START
+
+ The contents of this file are subject to the terms of the
+ Common Development and Distribution License, Version 1.0 only
+ (the "License"). You may not use this file except in compliance
+ with the License.
+
+ You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ or http://www.opensolaris.org/os/licensing.
+ See the License for the specific language governing permissions
+ and limitations under the License.
+
+ When distributing Covered Code, include this CDDL HEADER in each
+ file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ If applicable, add the following below this CDDL HEADER, with the
+ fields enclosed by brackets "[]" replaced with your own identifying
+ information: Portions Copyright [yyyy] [name of copyright owner]
+
+ CDDL HEADER END
+
+ ident "@(#)avahi-bridge-dsd.xml 1.1 06/04/24 SMI"
+
+ NOTE: This service manifest is not editable; its contents will
+ be overwritten by package or patch operations, including
+ operating system upgrade. Make customizations in a different
+ file.
+
+ Service manifest for avahi.
+-->
+
+<service_bundle type='manifest' name='SUNWavahi-bridge-dsd:avahi-bridge-dsd'>
+
+<service
+ name='system/avahi-bridge-dsd'
+ type='service'
+ version='1'>
+
+ <create_default_instance enabled='false' />
+
+ <single_instance />
+
+ <dependency name='usr'
+ type='service'
+ grouping='require_all'
+ restart_on='none'>
+ <service_fmri value='svc:/system/filesystem/local' />
+ </dependency>
+
+ <dependency name='dbus'
+ type='service'
+ grouping='require_all'
+ restart_on='none'>
+ <service_fmri value='svc:/system/dbus' />
+ </dependency>
+
+ <dependency name='multicast'
+ type='service'
+ grouping='require_all'
+ restart_on='none'>
+ <service_fmri value='svc:/network/dns/multicast' />
+ </dependency>
+
+ <exec_method
+ type='method'
+ name='start'
+ exec='/lib/svc/method/svc-avahi-bridge-dsd start'
+ timeout_seconds='30'>
+ </exec_method>
+
+ <exec_method
+ type='method'
+ name='stop'
+ exec='/lib/svc/method/svc-avahi-bridge-dsd stop'
+ timeout_seconds='30' />
+
+ <property_group name='startd' type='framework'>
+ <!-- sub-process core dumps shouldn't restart session -->
+ <propval name='ignore_error' type='astring'
+ value='core,signal' />
+ </property_group>
+
+ <stability value='Unstable' />
+
+ <template>
+ <common_name>
+ <loctext xml:lang='C'>
+ Avahi Daemon Bridge to Bonjour
+ </loctext>
+ </common_name>
+ <documentation>
+ <manpage title='avahi-daemon-bridge-dsd' section='1' manpath='/usr/man' />
+ </documentation>
+ </template>
+
+</service>
+
+</service_bundle>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/files/svc-avahi-bridge-dsd Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,61 @@
+#!/sbin/sh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# ident "@(#)svc-avahi-bridge-dsd 1.1 06/04/24 SMI"
+
+FMRI=svc:/system/avahi-bridge-dsd:default
+
+. /lib/svc/share/smf_include.sh
+
+if [ ! -x /usr/sbin/avahi-daemon-bridge-dsd ]; then
+ echo "/usr/sbin/avahi-daemon-bridge-dsd not found or not executable"
+ exit $SMF_EXIT_ERR_FATAL
+fi
+
+if smf_is_nonglobalzone; then
+ /usr/sbin/svcadm disable -t svc:/system/avahi-bridge-dsd
+ echo "avahi-bridge-dsd cannot be run in non-global zones"
+ sleep 5 &
+ exit $SMF_EXIT_OK
+fi
+
+case "$1" in
+'start')
+ /usr/sbin/avahi-daemon-bridge-dsd -D
+ err=$?
+ if [ $err -ne 0 ]; then
+ echo "avahi-daemon-bridge-dsd failed to start: error $err"
+ exit $SMF_EXIT_ERR_FATAL
+ fi
+ ;;
+'stop')
+ /usr/sbin/avahi-daemon-bridge-dsd -k
+ ;;
+*)
+ echo "Usage: $0 { start }"
+ exit $SMF_EXIT_ERR_FATAL
+ ;;
+esac
+
+exit $SMF_EXIT_OK
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/01-config-bonjour.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,46 @@
+Source: Desktop consolidation
+Comment of upstream submission:
+Currently the Desktop consolidation patches are re-taken without the change. When the
+component will update patches need to be checked and all unneeded contents i.e. concerning
+the version of auto tools need to be checked if it can be taken out.
+
+Test of dns_sd.h should rather to be promoted to community.
+
+--- /usr/tmp/clean/avahi-0.6.28/configure.ac 2010-10-05 00:33:15.689579806 +0100
++++ avahi-0.6.28/configure.ac 2011-01-21 09:13:07.100772101 +0000
+@@ -23,7 +23,7 @@
+ AC_CONFIG_SRCDIR([avahi-core/server.c])
+ AC_CONFIG_MACRO_DIR([common])
+ AC_CONFIG_HEADERS([config.h])
+-AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax])
++AM_INIT_AUTOMAKE([foreign 1.10 -Wall -Wno-portability tar-pax])
+
+ AC_SUBST(PACKAGE_URL, [http://avahi.org/])
+
+@@ -43,7 +43,7 @@
+
+ AC_CANONICAL_HOST
+
+-AM_SILENT_RULES([yes])
++#AM_SILENT_RULES([yes])
+
+ AC_CHECK_PROG([STOW], [stow], [yes], [no])
+
+@@ -153,6 +153,17 @@
+ ACX_PTHREAD(,AC_MSG_ERROR([Missing POSIX Threads support]))
+
+ #
++# Check for dns_sd.h
++#
++AC_CHECK_HEADER(dns_sd.h,
++HAVE_BONJOUR=yes
++AC_DEFINE([HAVE_BONJOUR],[],[Support for Bonjour])
++, [], [
++])
++
++AM_CONDITIONAL(HAVE_BONJOUR, [ test x"$HAVE_BONJOUR" = xyes ])
++
++#
+ # Check for netlink.h
+ #
+ AC_CHECK_HEADER(linux/netlink.h,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/02-browse-service.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,211 @@
+Source: Desktop consolidation
+Upstream promotion status: unknown
+
+--- avahi-0.6.28/avahi-core/browse-service.c.orig 2010-08-26 01:51:38.983153000 +0100
++++ avahi-0.6.28/avahi-core/browse-service.c 2011-01-20 09:22:41.808471289 +0000
+@@ -21,10 +21,14 @@
+ #include <config.h>
+ #endif
+
++#include <stdio.h>
+ #include <string.h>
+
+ #include <avahi-common/domain.h>
+ #include <avahi-common/malloc.h>
++#ifdef HAVE_BONJOUR
++#include <avahi-common/timeval.h>
++#endif
+ #include <avahi-common/error.h>
+
+ #include "browse.h"
+@@ -40,9 +44,131 @@
+ AvahiSServiceBrowserCallback callback;
+ void* userdata;
+
++#ifdef HAVE_BONJOUR
++ AvahiProtocol protocol;
++ AvahiIfIndex interface;
++ AvahiTimeEvent *browse_error_event;
++ AvahiTimeEvent *all_for_now_event;
++ AvahiLookupFlags flags;
++ AvahiWatch *watch;
++ DNSServiceRef client;
++#endif
++
+ AVAHI_LLIST_FIELDS(AvahiSServiceBrowser, browser);
+ };
+
++#ifdef HAVE_BONJOUR
++static void browse_reply(DNSServiceRef client, const DNSServiceFlags flags, uint32_t IfIndex, DNSServiceErrorType errorCode,
++ const char *name, const char *type, const char *domain, void *context) {
++ AvahiSServiceBrowser *b = context;
++ char *op = (flags &kDNSServiceFlagsAdd) ? "Add" : "Rmv";
++ AvahiBrowserEvent event;
++ AvahiIfIndex interface;
++
++ interface = (IfIndex == kDNSServiceInterfaceIndexAny) ? AVAHI_IF_UNSPEC : IfIndex;
++
++ event = (flags &kDNSServiceFlagsAdd) ? AVAHI_BROWSER_NEW : AVAHI_BROWSER_REMOVE;
++
++ b->callback(b, interface, AVAHI_PROTO_UNSPEC, event, name, type, domain, 0, b->userdata);
++
++}
++
++static void browse_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent events, void *userdata) {
++ AvahiSServiceBrowser *b = userdata;
++ DNSServiceErrorType ret;
++
++ assert(w);
++ assert(fd >= 0);
++ assert(events & AVAHI_WATCH_IN);
++
++ assert (fd == DNSServiceRefSockFD(b->client));
++ ret = DNSServiceProcessResult(b->client);
++ if (ret != kDNSServiceErr_NoError) {
++ if (b->watch) {
++ b->server->poll_api->watch_free(b->watch);
++ b->watch = NULL;
++ }
++ DNSServiceRefDeallocate(b->client);
++ b->client = NULL;
++ avahi_server_set_errno(b->server, AVAHI_ERR_DISCONNECTED);
++ b->callback(b,
++ b->interface,
++ b->protocol,
++ AVAHI_BROWSER_FAILURE,
++ NULL,
++ b->service_type,
++ b->domain_name,
++ 0,
++ b->userdata);
++ }
++}
++
++static void all_for_now_callback(AvahiTimeEvent *e, void* userdata) {
++ AvahiSServiceBrowser *b = userdata;
++
++ assert(e);
++ assert(b);
++
++ avahi_time_event_free(b->all_for_now_event);
++ b->all_for_now_event = NULL;
++
++ b->callback(b,
++ b->interface,
++ b->protocol,
++ AVAHI_BROWSER_ALL_FOR_NOW,
++ NULL,
++ b->service_type,
++ NULL,
++ 0,
++ b->userdata);
++}
++
++static void browse_error_callback(AvahiTimeEvent *e, void *userdata) {
++ AvahiSServiceBrowser *b = userdata;
++
++ if (b->browse_error_event) {
++ avahi_time_event_free(b->browse_error_event);
++ b->browse_error_event = NULL;
++ }
++ avahi_server_set_errno(b->server, AVAHI_ERR_FAILURE);
++ b->callback(b,
++ b->interface,
++ b->protocol,
++ AVAHI_BROWSER_FAILURE,
++ NULL,
++ b->service_type,
++ b->domain_name,
++ 0,
++ b->userdata);
++}
++
++static void avahi_browse_service_start(AvahiSServiceBrowser *b) {
++ DNSServiceErrorType ret;
++ struct timeval tv;
++
++ ret = DNSServiceBrowse(&b->client,
++ 0,
++ b->interface == AVAHI_IF_UNSPEC ?
++ kDNSServiceInterfaceIndexAny :
++ b->interface,
++ b->service_type,
++ b->domain_name,
++ browse_reply,
++ b);
++ if (ret != kDNSServiceErr_NoError || !b->client) {
++ b->browse_error_event = avahi_time_event_new(b->server->time_event_queue,
++NULL, browse_error_callback, b);
++ } else {
++ b->watch = b->server->poll_api->watch_new(b->server->poll_api, DNSServiceRefSockFD(b->client), AVAHI_WATCH_IN, browse_socket_event, b);
++
++ /* Add a second */
++ gettimeofday(&tv, NULL);
++ avahi_timeval_add(&tv, 1000000);
++ b->all_for_now_event = avahi_time_event_new(b->server->time_event_queue, &tv, all_for_now_callback, b);
++ }
++}
++#endif
++
+ static void record_browser_callback(
+ AvahiSRecordBrowser*rr,
+ AvahiIfIndex interface,
+@@ -102,7 +228,11 @@
+ AVAHI_CHECK_VALIDITY_RETURN_NULL(server, AVAHI_IF_VALID(interface), AVAHI_ERR_INVALID_INTERFACE);
+ AVAHI_CHECK_VALIDITY_RETURN_NULL(server, AVAHI_PROTO_VALID(protocol), AVAHI_ERR_INVALID_PROTOCOL);
+ AVAHI_CHECK_VALIDITY_RETURN_NULL(server, !domain || avahi_is_valid_domain_name(domain), AVAHI_ERR_INVALID_DOMAIN_NAME);
++#ifdef HAVE_BONJOUR
++ AVAHI_CHECK_VALIDITY_RETURN_NULL(server, AVAHI_FLAGS_VALID(flags, AVAHI_LOOKUP_USE_MULTICAST), AVAHI_ERR_INVALID_FLAGS);
++#else
+ AVAHI_CHECK_VALIDITY_RETURN_NULL(server, AVAHI_FLAGS_VALID(flags, AVAHI_LOOKUP_USE_WIDE_AREA|AVAHI_LOOKUP_USE_MULTICAST), AVAHI_ERR_INVALID_FLAGS);
++#endif
+ AVAHI_CHECK_VALIDITY_RETURN_NULL(server, avahi_is_valid_service_type_generic(service_type), AVAHI_ERR_INVALID_SERVICE_TYPE);
+
+ if (!domain)
+@@ -132,6 +262,16 @@
+ goto fail;
+ }
+
++#ifdef HAVE_BONJOUR
++ b->protocol = protocol;
++ b->interface = interface;
++ b->flags = flags;
++ b->browse_error_event = NULL;
++ b->all_for_now_event = NULL;
++ b->client = NULL;
++ b->watch = NULL;
++ avahi_browse_service_start(b);
++#else
+ if (!(k = avahi_key_new(n, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_PTR))) {
+ avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
+ goto fail;
+@@ -141,6 +281,7 @@
+ goto fail;
+
+ avahi_key_unref(k);
++#endif
+
+ return b;
+
+@@ -163,5 +304,21 @@
+
+ avahi_free(b->domain_name);
+ avahi_free(b->service_type);
++#ifdef HAVE_BONJOUR
++ if (b->browse_error_event) {
++ avahi_time_event_free(b->browse_error_event);
++ b->browse_error_event = NULL;
++ }
++ if (b->all_for_now_event) {
++ avahi_time_event_free(b->all_for_now_event);
++ b->all_for_now_event = NULL;
++ }
++
++ if (b->watch)
++ b->server->poll_api->watch_free(b->watch);
++
++ if (b->client)
++ DNSServiceRefDeallocate (b->client);
++#endif
+ avahi_free(b);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/03-entry.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,601 @@
+Source: Desktop consolidation
+Upstream promotion status: unknown
+
+--- /usr/tmp/clean/avahi-0.6.28/avahi-core/entry.c 2010-08-26 01:51:38.985153000 +0100
++++ avahi-0.6.28/avahi-core/entry.c 2011-01-20 12:01:24.322248863 +0000
+@@ -50,6 +50,33 @@
+ #include "rr-util.h"
+ #include "domain-util.h"
+
++#ifdef HAVE_BONJOUR
++
++struct AvahiService {
++ AvahiServer *server;
++ AvahiSEntryGroup *group;
++
++ int dead;
++
++ AvahiPublishFlags flags;
++ AvahiIfIndex interface;
++ AvahiProtocol protocol;
++
++ char *name;
++ char *type;
++ char *domain;
++ char *host;
++ uint16_t port;
++
++ AvahiWatch *watch;
++ DNSServiceRef client;
++ size_t txtlen;
++ uint8_t *txtrecord;
++
++ AVAHI_LLIST_FIELDS(AvahiService, services);
++};
++#endif
++
+ static void transport_flags_from_domain(AvahiServer *s, AvahiPublishFlags *flags, const char *domain) {
+ assert(flags);
+ assert(domain);
+@@ -69,13 +96,146 @@
+ *flags |= AVAHI_PUBLISH_USE_WIDE_AREA;
+ }
+
++#ifdef HAVE_BONJOUR
++static void register_service_reply(DNSServiceRef client, const DNSServiceFlags flags, DNSServiceErrorType errorCode,
++ const char *name, const char *regtype, const char *domain, void *context) {
++ AvahiService *as = context;
++
++ switch (errorCode) {
++ case kDNSServiceErr_NoError:
++ as->group->n_probing--;
++ if (as->group->n_probing == 0) {
++ avahi_s_entry_group_change_state(as->group, AVAHI_ENTRY_GROUP_ESTABLISHED);
++ }
++ break;
++ case kDNSServiceErr_NameConflict:
++ avahi_s_entry_group_change_state(as->group, AVAHI_ENTRY_GROUP_COLLISION);
++ break;
++ default:
++ avahi_s_entry_group_change_state(as->group, AVAHI_ENTRY_GROUP_FAILURE);
++ }
++}
++
++static void register_service_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent events, void *userdata) {
++ AvahiService *as = userdata;
++ DNSServiceErrorType ret;
++
++ assert(w);
++ assert(fd >= 0);
++ assert(events & AVAHI_WATCH_IN);
++
++ assert (fd == DNSServiceRefSockFD(as->client));
++ ret = DNSServiceProcessResult(as->client);
++ if (ret != kDNSServiceErr_NoError) {
++ if (as->watch) {
++ as->server->poll_api->watch_free(as->watch);
++ as->watch = NULL;
++ }
++ DNSServiceRefDeallocate(as->client);
++ as->client = NULL;
++ avahi_s_entry_group_change_state(as->group, AVAHI_ENTRY_GROUP_FAILURE);
++ }
++}
++
++static void avahi_service_free(AvahiServer*s, AvahiService *as) {
++ AvahiService *t;
++
++ assert(s);
++ assert(as);
++
++ /* Remove from linked list */
++ AVAHI_LLIST_REMOVE(AvahiService, services, s->services, as);
++
++ /* Remove from associated group */
++ if (as->group && (as->group->services != NULL))
++ AVAHI_LLIST_REMOVE(AvahiService, services, as->group->services, as);
++
++ if (as->name)
++ avahi_free(as->name);
++
++ if (as->type)
++ avahi_free(as->type);
++
++ if (as->domain)
++ avahi_free(as->domain);
++
++ if (as->host)
++ avahi_free(as->host);
++
++ if (as->watch)
++ s->poll_api->watch_free(as->watch);
++
++ if (as->client)
++ DNSServiceRefDeallocate (as->client);
++
++ if (as->txtrecord)
++ avahi_free(as->txtrecord);
++
++ avahi_free(as);
++}
++
++static void avahi_register_service(AvahiServer *s, AvahiService *as) {
++ DNSServiceErrorType ret;
++
++ ret = DNSServiceRegister(&as->client,
++ as->interface == AVAHI_IF_UNSPEC ?
++ kDNSServiceInterfaceIndexAny :
++ as->interface,
++ 0,
++ as->name,
++ as->type,
++ as->domain,
++ as->host,
++ htons(as->port),
++ as->txtlen,
++ as->txtrecord,
++ register_service_reply,
++ as);
++ if (ret == kDNSServiceErr_NoError) {
++ if (!as->client) {
++ avahi_s_entry_group_change_state(as->group, AVAHI_ENTRY_GROUP_FAILURE);
++ } else {
++ as->group->n_probing++;
++ as->watch = s->poll_api->watch_new(s->poll_api, DNSServiceRefSockFD(as->client), AVAHI_WATCH_IN, register_service_socket_event, as);
++ }
++ } else {
++ if (ret == kDNSServiceErr_NameConflict) {
++ avahi_s_entry_group_change_state(as->group, AVAHI_ENTRY_GROUP_COLLISION);
++ }
++ else {
++ avahi_s_entry_group_change_state(as->group, AVAHI_ENTRY_GROUP_FAILURE);
++ }
++ }
++}
++
++static void register_record_reply(DNSServiceRef client, DNSRecordRef recordref, const DNSServiceFlags flags, DNSServiceErrorType errorCode, void *context) {
++ AvahiEntry *e = context;
++ DNSServiceErrorType ret;
++
++ switch (errorCode) {
++ case kDNSServiceErr_NoError:
++ break;
++ case kDNSServiceErr_NameConflict:
++ e->recordref = NULL;
++ avahi_server_set_errno(e->server, AVAHI_ERR_COLLISION);
++ break;
++ default:
++ e->recordref = NULL;
++ avahi_server_set_errno(e->server, AVAHI_ERR_FAILURE);
++ break;
++ }
++}
++#endif
++
+ void avahi_entry_free(AvahiServer*s, AvahiEntry *e) {
+ AvahiEntry *t;
+
+ assert(s);
+ assert(e);
+
++#ifndef HAVE_BONJOUR
+ avahi_goodbye_entry(s, e, 1, 1);
++#endif
+
+ /* Remove from linked list */
+ AVAHI_LLIST_REMOVE(AvahiEntry, entries, s->entries, e);
+@@ -102,6 +262,15 @@
+
+ while (g->entries)
+ avahi_entry_free(s, g->entries);
++#ifdef HAVE_BONJOUR
++ while (g->services)
++ avahi_service_free(s, g->services);
++
++ if (g->record_connection) {
++ DNSServiceRefDeallocate(g->record_connection);
++ g->record_connection = NULL;
++ }
++#endif
+
+ if (g->register_time_event)
+ avahi_time_event_free(g->register_time_event);
+@@ -139,6 +308,21 @@
+ s->need_entry_cleanup = 0;
+ }
+
++#ifdef HAVE_BONJOUR
++ if (s->need_service_cleanup) {
++ AvahiService *as, *next;
++
++ for (as = s->services; as; as = next) {
++ next = as->services_next;
++
++ if (as->dead)
++ avahi_service_free(s, as);
++ }
++
++ s->need_service_cleanup = 0;
++ }
++#endif
++
+ if (s->need_browser_cleanup)
+ avahi_browser_cleanup(s);
+
+@@ -245,8 +429,54 @@
+
+ /* Hmm, nothing found? */
+ if (!e) {
++#ifdef HAVE_BONJOUR
++ /*
++ * Assume that we are updating a service's primary TXT record
++ * so find the service
++ */
++ DNSServiceErrorType ret;
++ uint16_t rlen;
++ uint8_t rdata[AVAHI_DNS_RDATA_MAX];
++ size_t l;
++ AvahiService *as;
++ int found_as = 0;
++
++ for (as = g->services; as; as = as->services_next) {
++ int a_ret = AVAHI_OK;
++ char svc_name[AVAHI_DOMAIN_NAME_MAX];
++
++ if ((a_ret = avahi_service_name_join(svc_name, sizeof(svc_name), as->name, as->type, as->domain ? as->domain : s->domain_name)) < 0) {
++ avahi_server_set_errno(s, a_ret);
++ return NULL;
++ }
++ if (!strcmp(svc_name, r->key->name)) {
++ found_as = 1;
++ break;
++ }
++ }
++
++ if (!found_as) {
++ avahi_server_set_errno(s, AVAHI_ERR_NOT_FOUND);
++ return NULL;
++ }
++ if ((l = avahi_rdata_serialize(r, rdata, sizeof(rdata))) == (size_t) -1) {
++ avahi_server_set_errno(s, AVAHI_ERR_FAILURE);
++ return NULL;
++ }
++ ret = DNSServiceUpdateRecord(as->client,
++ NULL,
++ 0,
++ l,
++ rdata,
++ r->ttl);
++ if (ret != kDNSServiceErr_NoError) {
++ avahi_server_set_errno(s, AVAHI_ERR_FAILURE);
++ }
++ return NULL;
++#else
+ avahi_server_set_errno(s, AVAHI_ERR_NOT_FOUND);
+ return NULL;
++#endif
+ }
+
+ /* Update the entry */
+@@ -256,6 +486,36 @@
+
+ /* Announce our changes when needed */
+ if (!avahi_record_equal_no_ttl(old_record, r) && (!g || g->state != AVAHI_ENTRY_GROUP_UNCOMMITED)) {
++#ifdef HAVE_BONJOUR
++ DNSServiceErrorType ret;
++ uint16_t rlen;
++ uint8_t rdata[AVAHI_DNS_RDATA_MAX];
++ size_t l;
++
++ if (!g->record_connection) {
++ if (DNSServiceCreateConnection(&g->record_connection) != kDNSServiceErr_NoError) {
++ avahi_entry_free(s, e);
++ avahi_server_set_errno(s, AVAHI_ERR_FAILURE);
++ return NULL;
++ }
++ }
++ if ((l = avahi_rdata_serialize(r, rdata, sizeof(rdata))) == (size_t) -1) {
++ avahi_entry_free(s, e);
++ avahi_server_set_errno(s, AVAHI_ERR_FAILURE);
++ return NULL;
++ }
++ ret = DNSServiceUpdateRecord(g->record_connection,
++ e->recordref,
++ 0,
++ l,
++ rdata,
++ r->ttl);
++ if (ret != kDNSServiceErr_NoError) {
++ avahi_entry_free(s, e);
++ avahi_server_set_errno(s, AVAHI_ERR_FAILURE);
++ return NULL;
++ }
++#else
+
+ /* Remove the old entry from all caches, if needed */
+ if (!(e->flags & AVAHI_PUBLISH_UNIQUE))
+@@ -263,6 +523,7 @@
+
+ /* Reannounce our updated entry */
+ avahi_reannounce_entry(s, e);
++#endif
+ }
+
+ /* If we were the first entry in the list, we need to update the key */
+@@ -273,6 +534,14 @@
+
+ } else {
+ AvahiEntry *t;
++#ifdef HAVE_BONJOUR
++ DNSServiceErrorType ret;
++ DNSServiceFlags bflags;
++ uint16_t rlen;
++ uint8_t rdata[AVAHI_DNS_RDATA_MAX];
++ size_t l;
++ char *record_name;
++#endif
+
+ /* Add a new record */
+
+@@ -307,7 +576,69 @@
+ if (g)
+ AVAHI_LLIST_PREPEND(AvahiEntry, by_group, g->entries, e);
+
++#ifdef HAVE_BONJOUR
++ e->recordref = NULL;
++ if (!g->record_connection) {
++ if (DNSServiceCreateConnection(&g->record_connection) != kDNSServiceErr_NoError) {
++ avahi_entry_free(s, e);
++ avahi_server_set_errno(s, AVAHI_ERR_FAILURE);
++ return NULL;
++ }
++ }
++ bflags = 0;
++ if (flags & AVAHI_PUBLISH_ALLOW_MULTIPLE)
++ bflags |= kDNSServiceFlagsShared;
++ else
++ bflags |= kDNSServiceFlagsUnique;
++
++ switch (r->key->type) {
++ case AVAHI_DNS_TYPE_A:
++ case AVAHI_DNS_TYPE_AAAA:
++ record_name = avahi_strdup(r->key->name);
++ break;
++ default:
++ record_name = avahi_malloc(strlen(r->key->name) + strlen(s->host_name_fqdn) + 2);
++ strcpy(record_name, r->key->name);
++ strcat(record_name, ".");
++ strcat(record_name, s->host_name_fqdn);
++ break;
++ }
++
++ if ((l = avahi_rdata_serialize(r, rdata, sizeof(rdata))) == (size_t) -1) {
++ avahi_entry_free(s, e);
++ avahi_server_set_errno(s, AVAHI_ERR_FAILURE);
++ return NULL;
++ }
++
++ ret = DNSServiceRegisterRecord(g->record_connection,
++ &e->recordref,
++ bflags,
++ interface == AVAHI_IF_UNSPEC ?
++ kDNSServiceInterfaceIndexAny :
++ interface,
++ record_name,
++ r->key->type,
++ r->key->clazz,
++ l,
++ rdata,
++ r->ttl,
++ register_record_reply,
++ e);
++ if (ret == kDNSServiceErr_NoError) {
++ ret = DNSServiceProcessResult(g->record_connection);
++ if (ret != kDNSServiceErr_NoError || e->recordref == NULL) {
++ avahi_entry_free(s, e);
++ return NULL;
++ }
++ } else {
++ avahi_entry_free(s, e);
++ avahi_server_set_errno(s, AVAHI_ERR_FAILURE);
++ return NULL;
++ }
++ avahi_free(record_name);
++#else
+ avahi_announce_entry(s, e);
++#endif
+ }
+
+ return e;
+@@ -583,6 +914,9 @@
+ AvahiRecord *r = NULL;
+ int ret = AVAHI_OK;
+ AvahiEntry *srv_entry = NULL, *txt_entry = NULL, *ptr_entry = NULL, *enum_entry = NULL;
++#ifdef HAVE_BONJOUR
++ AvahiService *as;
++#endif
+
+ assert(s);
+ assert(type);
+@@ -603,6 +937,36 @@
+ if (!domain)
+ domain = s->domain_name;
+
++#ifdef HAVE_BONJOUR
++ as = avahi_new (AvahiService, 1);
++ as->server = s;
++ as->group = g;
++ as->dead = 0;
++ as->flags = flags;
++ as->interface = interface;
++ as->protocol = protocol;
++ as->name = avahi_strdup(name);
++ as->type = avahi_strdup(type);
++ as->domain = avahi_strdup(domain);
++ as->host = avahi_strdup(host);
++ as->port = port;
++ as->watch = NULL;
++ as->client = NULL;
++ as->txtlen = avahi_string_list_serialize(strlst, NULL, 0);
++ if (as->txtlen > 0) {
++ as->txtrecord = avahi_new(uint8_t, as->txtlen);
++ if (as->txtrecord == NULL) {
++ as->txtlen = 0;
++ ret = avahi_server_set_errno(s, AVAHI_ERR_NO_MEMORY);
++ goto fail;
++ }
++ avahi_string_list_serialize(strlst, as->txtrecord, as->txtlen);
++ } else
++ as->txtrecord = NULL;
++
++ AVAHI_LLIST_PREPEND(AvahiService, services, s->services, as);
++ AVAHI_LLIST_PREPEND(AvahiService, services, g->services, as);
++#else
+ if (!host)
+ host = s->host_name_fqdn;
+
+@@ -667,6 +1031,7 @@
+ ret = avahi_server_errno(s);
+ goto fail;
+ }
++#endif
+
+ fail:
+ if (ret != AVAHI_OK && !(flags & AVAHI_PUBLISH_UPDATE)) {
+@@ -1013,7 +1378,11 @@
+ if (g->state == state)
+ return;
+
++#ifdef HAVE_BONJOUR
++ assert(state <= AVAHI_ENTRY_GROUP_FAILURE);
++#else
+ assert(state <= AVAHI_ENTRY_GROUP_COLLISION);
++#endif
+
+ if (g->state == AVAHI_ENTRY_GROUP_ESTABLISHED) {
+
+@@ -1063,6 +1432,10 @@
+ g->register_time.tv_sec = 0;
+ g->register_time.tv_usec = 0;
+ AVAHI_LLIST_HEAD_INIT(AvahiEntry, g->entries);
++#ifdef HAVE_BONJOUR
++ AVAHI_LLIST_HEAD_INIT(AvahiService, g->services);
++ g->record_connection = NULL;
++#endif
+
+ AVAHI_LLIST_PREPEND(AvahiSEntryGroup, groups, s->groups, g);
+ return g;
+@@ -1087,16 +1460,26 @@
+
+ void avahi_s_entry_group_free(AvahiSEntryGroup *g) {
+ AvahiEntry *e;
++#ifdef HAVE_BONJOUR
++ AvahiService *s;
++#endif
+
+ assert(g);
+ assert(g->server);
+
+ for (e = g->entries; e; e = e->by_group_next) {
+ if (!e->dead) {
++#ifndef HAVE_BONJOUR
+ avahi_goodbye_entry(g->server, e, 1, 1);
++#endif
+ e->dead = 1;
+ }
+ }
++#ifdef HAVE_BONJOUR
++ for (s = g->services; s; s = s->services_next) {
++ s->dead = 1;
++ }
++#endif
+
+ if (g->register_time_event) {
+ avahi_time_event_free(g->register_time_event);
+@@ -1107,11 +1490,17 @@
+
+ g->server->need_group_cleanup = 1;
+ g->server->need_entry_cleanup = 1;
++#ifdef HAVE_BONJOUR
++ g->server->need_service_cleanup = 1;
++#endif
+
+ schedule_cleanup(g->server);
+ }
+
+ static void entry_group_commit_real(AvahiSEntryGroup *g) {
++#ifdef HAVE_BONJOUR
++ AvahiService *s;
++#endif
+ assert(g);
+
+ gettimeofday(&g->register_time, NULL);
+@@ -1121,8 +1510,15 @@
+ if (g->dead)
+ return;
+
++#ifdef HAVE_BONJOUR
++ assert(g->server);
++ for (s = g->services; s; s = s->services_next)
++ if (!s->dead)
++ avahi_register_service(g->server, s);
++#else
+ avahi_announce_group(g->server, g);
+ avahi_s_entry_group_check_probed(g, 0);
++#endif
+ }
+
+ static void entry_group_register_time_event_callback(AVAHI_GCC_UNUSED AvahiTimeEvent *e, void* userdata) {
+@@ -1175,16 +1571,28 @@
+
+ void avahi_s_entry_group_reset(AvahiSEntryGroup *g) {
+ AvahiEntry *e;
++#ifdef HAVE_BONJOUR
++ AvahiService *s;
++#endif
+ assert(g);
+
+ for (e = g->entries; e; e = e->by_group_next) {
+ if (!e->dead) {
++#ifndef HAVE_BONJOUR
+ avahi_goodbye_entry(g->server, e, 1, 1);
++#endif
+ e->dead = 1;
+ }
+ }
+ g->server->need_entry_cleanup = 1;
+
++#ifdef HAVE_BONJOUR
++ for (s = g->services; s; s = s->services_next) {
++ s->dead = 1;
++ }
++ g->server->need_service_cleanup = 1;
++#endif
++
+ g->n_probing = 0;
+
+ avahi_s_entry_group_change_state(g, AVAHI_ENTRY_GROUP_UNCOMMITED);
+@@ -1222,12 +1630,23 @@
+
+ int avahi_s_entry_group_is_empty(AvahiSEntryGroup *g) {
+ AvahiEntry *e;
++#ifdef HAVE_BONJOUR
++ AvahiService *s;
++#endif
++
+ assert(g);
+
++#ifdef HAVE_BONJOUR
++ for (s = g->services; s; s = s->services_next)
++ if (!s->dead)
++ return 0;
++#else
+ /* Look for an entry that is not dead */
+ for (e = g->entries; e; e = e->by_group_next)
+ if (!e->dead)
+ return 0;
++#endif
+
+ return 1;
+ }
++
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/04-internal.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,60 @@
+Source: Desktop consolidation
+Upstream promotion status: unknown
+
+--- /usr/tmp/clean/avahi-0.6.28/avahi-core/internal.h 2010-08-26 01:51:38.988153000 +0100
++++ avahi-0.6.28/avahi-core/internal.h 2011-01-20 12:06:07.798532060 +0000
+@@ -22,6 +22,10 @@
+
+ /** A locally registered DNS resource record */
+ typedef struct AvahiEntry AvahiEntry;
++#ifdef HAVE_BONJOUR
++typedef struct AvahiService AvahiService;
++#include <dns_sd.h>
++#endif
+
+ #include <avahi-common/llist.h>
+ #include <avahi-common/watch.h>
+@@ -72,6 +76,10 @@
+ AvahiIfIndex interface;
+ AvahiProtocol protocol;
+
++#ifdef HAVE_BONJOUR
++ DNSRecordRef recordref;
++#endif
++
+ AVAHI_LLIST_FIELDS(AvahiEntry, entries);
+ AVAHI_LLIST_FIELDS(AvahiEntry, by_key);
+ AVAHI_LLIST_FIELDS(AvahiEntry, by_group);
+@@ -97,6 +105,11 @@
+
+ AVAHI_LLIST_FIELDS(AvahiSEntryGroup, groups);
+ AVAHI_LLIST_HEAD(AvahiEntry, entries);
++#ifdef HAVE_BONJOUR
++ AVAHI_LLIST_HEAD(AvahiService, services);
++
++ DNSServiceRef record_connection;
++#endif
+ };
+
+ struct AvahiServer {
+@@ -106,6 +119,10 @@
+ AvahiServerConfig config;
+
+ AVAHI_LLIST_HEAD(AvahiEntry, entries);
++#ifdef HAVE_BONJOUR
++ AVAHI_LLIST_HEAD(AvahiService, services);
++#endif
++
+ AvahiHashmap *entries_by_key;
+
+ AVAHI_LLIST_HEAD(AvahiSEntryGroup, groups);
+@@ -121,6 +138,9 @@
+ AVAHI_LLIST_HEAD(AvahiSDNSServerBrowser, dns_server_browsers);
+
+ int need_entry_cleanup, need_group_cleanup, need_browser_cleanup;
++#ifdef HAVE_BONJOUR
++ int need_service_cleanup;
++#endif
+
+ /* Used for scheduling RR cleanup */
+ AvahiTimeEvent *cleanup_time_event;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/05-resolve-service.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,400 @@
+Source: Desktop consolidation
+Upstream promotion status: unknown
+
+--- /usr/tmp/clean/avahi-0.6.28/avahi-core/resolve-service.c 2010-08-26 01:51:38.991153000 +0100
++++ avahi-0.6.28/avahi-core/resolve-service.c 2011-01-20 12:36:38.289095469 +0000
+@@ -25,6 +25,10 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+
++#ifdef HAVE_BONJOUR
++#include <netinet/in.h> /* for ntohs */
++#endif
++
+ #include <avahi-common/domain.h>
+ #include <avahi-common/timeval.h>
+ #include <avahi-common/malloc.h>
+@@ -59,9 +63,303 @@
+
+ AvahiTimeEvent *time_event;
+
++#ifdef HAVE_BONJOUR
++ uint16_t port;
++ AvahiTimeEvent *defer_time_event;
++ char *host;
++ AvahiWatch *watch;
++ AvahiWatch *watch_a;
++ AvahiWatch *watch_a6;
++ DNSServiceRef client;
++ DNSServiceRef client_a;
++ DNSServiceRef client_a6;
++#endif
++
+ AVAHI_LLIST_FIELDS(AvahiSServiceResolver, resolver);
+ };
+
++
++#ifdef HAVE_BONJOUR
++static void finish(AvahiSServiceResolver *r, AvahiResolverEvent event ) {
++ AvahiLookupResultFlags flags;
++
++ assert(r);
++
++ if (r->time_event) {
++ avahi_time_event_free(r->time_event);
++ r->time_event = NULL;
++ }
++
++ flags = 0;
++
++ switch (event) {
++ case AVAHI_RESOLVER_FAILURE:
++
++ r->callback(r,
++ r->interface,
++ r->protocol,
++ event,
++ r->service_name,
++ r->service_type,
++ r->domain_name,
++ NULL,
++ NULL,
++ 0,
++ NULL,
++ flags,
++ r->userdata);
++ break;
++
++ case AVAHI_RESOLVER_FOUND: {
++ AvahiAddress a;
++
++ if (r->address_record) {
++ switch (r->address_record->key->type) {
++ case AVAHI_DNS_TYPE_A:
++ a.proto = AVAHI_PROTO_INET;
++ a.data.ipv4 = r->address_record->data.a.address;
++ break;
++
++ case AVAHI_DNS_TYPE_AAAA:
++ a.proto = AVAHI_PROTO_INET6;
++ a.data.ipv6 = r->address_record->data.aaaa.address;
++ break;
++
++ default:
++ assert(0);
++ }
++ }
++
++ flags = 0;
++ if (avahi_domain_equal(r->server->host_name_fqdn, r->host))
++ flags |= AVAHI_LOOKUP_RESULT_LOCAL;
++ r->callback(r,
++ r->interface,
++ r->protocol,
++ event,
++ r->service_name,
++ r->service_type,
++ r->domain_name,
++ r->host,
++ r->address_record ? &a : NULL,
++ r->port,
++ r->txt_record ? r->txt_record->data.txt.string_list : NULL,
++ flags,
++ r->userdata);
++ break;
++ }
++ }
++}
++
++static void query_record(DNSServiceRef sdRef, const DNSServiceFlags flags, uint32_t ifIndex, DNSServiceErrorType errorCode,
++ const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata, uint32_t ttl, void *context)
++{
++ AvahiSServiceResolver *r = context;
++ const unsigned char *rd = rdata;
++ AvahiAddress a;
++ int changed = 0;
++
++ if (r->interface > 0 && ifIndex != r->interface)
++ return;
++ if (r->interface <= 0)
++ r->interface = ifIndex;
++
++ switch (rrtype) {
++ case kDNSServiceType_A:
++ if (!r->address_record) {
++ if (!(r->address_record = avahi_record_new_full(r->host, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_A, ttl))) {
++ avahi_server_set_errno(r->server, AVAHI_ERR_NO_MEMORY);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ return;
++ }
++ if (avahi_rdata_parse(r->address_record, rdata, rdlen) != 0) {
++ avahi_server_set_errno(r->server, AVAHI_ERR_INVALID_PACKET);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ }
++ changed = 1;
++ if (r->protocol == AVAHI_PROTO_UNSPEC)
++ r->protocol = AVAHI_PROTO_INET;
++ }
++ break;
++
++ case kDNSServiceType_A6:
++ if (!r->address_record) {
++ if (!(r->address_record = avahi_record_new_full(r->host, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_AAAA, ttl))) {
++ avahi_server_set_errno(r->server, AVAHI_ERR_NO_MEMORY);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ return;
++ }
++ if (avahi_rdata_parse(r->address_record, rdata, rdlen) != 0) {
++ avahi_server_set_errno(r->server, AVAHI_ERR_INVALID_PACKET);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ }
++ changed = 1;
++ if (r->protocol == AVAHI_PROTO_UNSPEC)
++ r->protocol = AVAHI_PROTO_INET6;
++ }
++ break;
++ default:
++ abort();
++
++ }
++
++ if (changed &&
++ (r->txt_record || (r->user_flags & AVAHI_LOOKUP_NO_TXT)) &&
++ r->address_record || (r->user_flags & AVAHI_LOOKUP_NO_ADDRESS)) {
++ finish(r, AVAHI_RESOLVER_FOUND);
++ }
++}
++
++static void resolve_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent events, void *userdata) {
++ AvahiSServiceResolver *r = userdata;
++ DNSServiceErrorType ret;
++ DNSServiceRef client;
++
++ assert(w);
++ assert(fd >= 0);
++ assert(events & AVAHI_WATCH_IN);
++
++ if (fd == DNSServiceRefSockFD(r->client))
++ client = r->client;
++ else if (fd == DNSServiceRefSockFD(r->client_a))
++ client = r->client_a;
++ else if (fd == DNSServiceRefSockFD(r->client_a6))
++ client = r->client_a6;
++ else
++ assert (0);
++
++ ret = DNSServiceProcessResult(client);
++ if (ret != kDNSServiceErr_NoError) {
++ if (client == r->client) {
++ if (r->watch) {
++ r->server->poll_api->watch_free(r->watch);
++ r->watch = NULL;
++ }
++ DNSServiceRefDeallocate(r->client);
++ r->client = NULL;
++ } else if (client == r->client_a) {
++ if (r->watch_a) {
++ r->server->poll_api->watch_free(r->watch_a);
++ r->watch_a = NULL;
++ }
++ DNSServiceRefDeallocate(r->client_a);
++ r->client_a = NULL;
++ } else if (client == r->client_a6) {
++ if (r->watch_a6) {
++ r->server->poll_api->watch_free(r->watch_a6);
++ r->watch_a6 = NULL;
++ }
++ DNSServiceRefDeallocate(r->client_a6);
++ r->client_a6 = NULL;
++ }
++ avahi_server_set_errno(r->server, AVAHI_ERR_DISCONNECTED);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ }
++}
++
++static void resolve_reply(DNSServiceRef client, const DNSServiceFlags flags, uint32_t ifIndex, DNSServiceErrorType errorCode,
++ const char *fullname, const char *host, uint16_t opaqueport, uint16_t txtlen, const char* txtrecord, void *context) {
++ AvahiSServiceResolver *r = context;
++ AvahiServer *s = r->server;
++ DNSServiceErrorType ret;
++ DNSServiceRef new_client;
++
++ if (r->interface > 0 && ifIndex != r->interface)
++ return;
++ if (r->interface <= 0)
++ r->interface = ifIndex;
++
++ if (host) {
++ if (!(r->host = avahi_strdup(host))) {
++ avahi_server_set_errno(r->server, AVAHI_ERR_NO_MEMORY);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ }
++ }
++ if (!(r->user_flags & AVAHI_LOOKUP_NO_ADDRESS)) {
++ if (!r->txt_record) {
++ if (!(r->txt_record = avahi_record_new_full(r->host, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_TXT, AVAHI_DEFAULT_TTL))) {
++ avahi_server_set_errno(r->server, AVAHI_ERR_NO_MEMORY);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ return;
++ }
++ }
++ if (avahi_rdata_parse(r->txt_record, txtrecord, txtlen) != 0) {
++ avahi_server_set_errno(r->server, AVAHI_ERR_INVALID_PACKET);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ }
++ }
++ r->port = ntohs(opaqueport);
++ if (!(r->user_flags & AVAHI_LOOKUP_NO_ADDRESS)) {
++ if (r->address_protocol == AVAHI_PROTO_INET || r->address_protocol == AVAHI_PROTO_UNSPEC) {
++ if (r->client_a) {
++ if (r->watch_a) {
++ r->server->poll_api->watch_free(r->watch_a);
++ r->watch_a = NULL;
++ }
++ DNSServiceRefDeallocate(r->client_a);
++ r->client_a = NULL;
++ }
++ ret = DNSServiceQueryRecord(&r->client_a, 0, ifIndex, host, kDNSServiceType_A, kDNSServiceClass_IN, query_record, r);
++ if (ret != kDNSServiceErr_NoError || !r->client_a) {
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ return;
++ }
++ r->watch_a = s->poll_api->watch_new(s->poll_api, DNSServiceRefSockFD(r->client_a), AVAHI_WATCH_IN, resolve_socket_event, r);
++ }
++
++ if (r->address_protocol == AVAHI_PROTO_INET6 || r->address_protocol == AVAHI_PROTO_UNSPEC) {
++ if (r->client_a6) {
++ if (r->watch_a6) {
++ r->server->poll_api->watch_free(r->watch_a6);
++ r->watch_a6 = NULL;
++ }
++ DNSServiceRefDeallocate(r->client_a6);
++ r->client_a6 = NULL;
++ }
++ ret = DNSServiceQueryRecord(&r->client_a6, 0, ifIndex, host, kDNSServiceType_A6, kDNSServiceClass_IN, query_record, r);
++ if (ret != kDNSServiceErr_NoError || !r->client_a6) {
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ return;
++ }
++ r->watch_a6 = s->poll_api->watch_new(s->poll_api, DNSServiceRefSockFD(r->client_a6), AVAHI_WATCH_IN, resolve_socket_event, r);
++ }
++ } else {
++ finish(r, AVAHI_RESOLVER_FOUND);
++ }
++}
++
++static void resolve_error_callback(AvahiTimeEvent *e, void *userdata) {
++ AvahiSServiceResolver *r = userdata;
++
++ if (r->defer_time_event) {
++ avahi_time_event_free(r->defer_time_event);
++ r->defer_time_event = NULL;
++ }
++ avahi_server_set_errno(r->server, AVAHI_ERR_FAILURE);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++}
++
++static void avahi_resolve_service_start(AvahiServer *s, AvahiSServiceResolver *r) {
++ DNSServiceErrorType ret;
++
++ ret = DNSServiceResolve(&r->client,
++ 0,
++ r->interface == AVAHI_IF_UNSPEC ?
++ kDNSServiceInterfaceIndexAny :
++ r->interface,
++ r->service_name,
++ r->service_type,
++ r->domain_name,
++ resolve_reply,
++ r);
++ if (ret != kDNSServiceErr_NoError || !r->client) {
++ r->defer_time_event = avahi_time_event_new(r->server->time_event_queue, NULL, resolve_error_callback, r);
++ } else {
++ r->watch = s->poll_api->watch_new(s->poll_api, DNSServiceRefSockFD(r->client), AVAHI_WATCH_IN, resolve_socket_event, r);
++ }
++}
++#else
++
+ static void finish(AvahiSServiceResolver *r, AvahiResolverEvent event) {
+ AvahiLookupResultFlags flags;
+
+@@ -140,6 +438,7 @@
+ }
+ }
+ }
++#endif
+
+ static void time_event_callback(AvahiTimeEvent *e, void *userdata) {
+ AvahiSServiceResolver *r = userdata;
+@@ -163,6 +462,7 @@
+ r->time_event = avahi_time_event_new(r->server->time_event_queue, &tv, time_event_callback, r);
+ }
+
++#ifndef HAVE_BONJOUR
+ static void record_browser_callback(
+ AvahiSRecordBrowser*rr,
+ AvahiIfIndex interface,
+@@ -374,6 +674,7 @@
+ break;
+ }
+ }
++#endif
+
+ AvahiSServiceResolver *avahi_s_service_resolver_new(
+ AvahiServer *server,
+@@ -433,6 +734,17 @@
+ r->time_event = NULL;
+ AVAHI_LLIST_PREPEND(AvahiSServiceResolver, resolver, server->service_resolvers, r);
+
++#ifdef HAVE_BONJOUR
++ r->defer_time_event = NULL;
++ r->host = NULL;
++ r->watch = NULL;
++ r->watch_a = NULL;
++ r->watch_a6 = NULL;
++ r->client = NULL;
++ r->client_a = NULL;
++ r->client_a6 = NULL;
++ avahi_resolve_service_start(server, r);
++#else
+ k = avahi_key_new(n, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_SRV);
+ r->record_browser_srv = avahi_s_record_browser_new(server, interface, protocol, k, flags & ~(AVAHI_LOOKUP_NO_TXT|AVAHI_LOOKUP_NO_ADDRESS), record_browser_callback, r);
+ avahi_key_unref(k);
+@@ -452,6 +764,7 @@
+ return NULL;
+ }
+ }
++#endif
+
+ start_timeout(r);
+
+@@ -482,6 +795,29 @@
+ if (r->address_record)
+ avahi_record_unref(r->address_record);
+
++#ifdef HAVE_BONJOUR
++ if (r->defer_time_event) {
++ avahi_time_event_free(r->defer_time_event);
++ r->defer_time_event = NULL;
++ }
++
++ if (r->host)
++ avahi_free(r->host);
++
++ if (r->watch)
++ r->server->poll_api->watch_free(r->watch);
++ if (r->watch_a)
++ r->server->poll_api->watch_free(r->watch_a);
++ if (r->watch_a6)
++ r->server->poll_api->watch_free(r->watch_a6);
++
++ if (r->client)
++ DNSServiceRefDeallocate (r->client);
++ if (r->client_a)
++ DNSServiceRefDeallocate (r->client_a);
++ if (r->client_a6)
++ DNSServiceRefDeallocate (r->client_a6);
++#endif
+ avahi_free(r->service_name);
+ avahi_free(r->service_type);
+ avahi_free(r->domain_name);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/06-server.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,100 @@
+Source: Desktop consolidation
+Upstream promotion status: unknown
+
+--- /usr/tmp/clean/avahi-0.6.28/avahi-core/server.c 2010-08-26 01:51:38.993153000 +0100
++++ avahi-0.6.28/avahi-core/server.c 2011-01-20 12:44:02.347982322 +0000
+@@ -1074,7 +1074,9 @@
+
+ s->state = state;
+
++#ifndef HAVE_BONJOUR
+ avahi_interface_monitor_update_rrs(s->monitor, 0);
++#endif
+
+ if (s->callback)
+ s->callback(s, state, s->userdata);
+@@ -1211,9 +1213,11 @@
+ server_set_state(s, AVAHI_SERVER_REGISTERING);
+ s->n_host_rr_pending ++; /** Make sure that the state isn't changed tp AVAHI_SERVER_RUNNING too early */
+
++#ifndef HAVE_BONJOUR
+ register_hinfo(s);
+ register_browse_domain(s);
+ avahi_interface_monitor_update_rrs(s->monitor, 0);
++#endif
+
+ assert(s->n_host_rr_pending > 0);
+ s->n_host_rr_pending --;
+@@ -1373,6 +1377,10 @@
+ else
+ avahi_server_config_init(&s->config);
+
++#ifdef HAVE_BONJOUR
++ s->need_service_cleanup = 0;
++ s->cleanup_time_event = NULL;
++#else
+ if ((e = setup_sockets(s)) < 0) {
+ if (error)
+ *error = e;
+@@ -1382,7 +1390,7 @@
+
+ return NULL;
+ }
+-
++#endif
+ s->n_host_rr_pending = 0;
+ s->need_entry_cleanup = 0;
+ s->need_group_cleanup = 0;
+@@ -1428,6 +1436,12 @@
+ s->local_service_cookie = (uint32_t) rand() * (uint32_t) rand();
+ } while (s->local_service_cookie == AVAHI_SERVICE_COOKIE_INVALID);
+
++#ifdef HAVE_BONJOUR
++ AVAHI_LLIST_HEAD_INIT(AvahiService, s->services);
++ s->wide_area_lookup_engine = NULL;
++ s->multicast_lookup_engine = NULL;
++ s->monitor = NULL;
++#else
+ if (s->config.enable_wide_area) {
+ s->wide_area_lookup_engine = avahi_wide_area_engine_new(s);
+ avahi_wide_area_set_servers(s->wide_area_lookup_engine, s->config.wide_area_servers, s->config.n_wide_area_servers);
+@@ -1438,6 +1452,7 @@
+
+ s->monitor = avahi_interface_monitor_new(s);
+ avahi_interface_monitor_sync(s->monitor);
++#endif
+
+ register_localhost(s);
+ register_stuff(s);
+@@ -1472,7 +1487,8 @@
+ while(s->entries)
+ avahi_entry_free(s, s->entries);
+
+- avahi_interface_monitor_free(s->monitor);
++ if (s->monitor)
++ avahi_interface_monitor_free(s->monitor);
+
+ while (s->groups)
+ avahi_entry_group_free(s, s->groups);
+@@ -1485,7 +1501,8 @@
+
+ if (s->wide_area_lookup_engine)
+ avahi_wide_area_engine_free(s->wide_area_lookup_engine);
+- avahi_multicast_lookup_engine_free(s->multicast_lookup_engine);
++ if (s->multicast_lookup_engine)
++ avahi_multicast_lookup_engine_free(s->multicast_lookup_engine);
+
+ if (s->cleanup_time_event)
+ avahi_time_event_free(s->cleanup_time_event);
+@@ -1524,6 +1541,11 @@
+
+ avahi_server_config_free(&s->config);
+
++#ifdef HAVE_BONJOUR
++ if (s->cleanup_time_event)
++ avahi_time_event_free(s->cleanup_time_event);
++#endif
++
+ avahi_free(s);
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/07-daemon.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,286 @@
+Source: Desktop consolidation
+Upstream promotion status: unknown
+
+--- /usr/tmp/clean/avahi-0.6.28/avahi-daemon/main.c 2010-08-26 01:51:39.000153000 +0100
++++ avahi-0.6.28/avahi-daemon/main.c 2011-01-20 14:40:47.924814317 +0000
+@@ -73,7 +73,9 @@
+
+ #include "setproctitle.h"
+ #include "main.h"
++#ifndef HAVE_BONJOUR
+ #include "simple-protocol.h"
++#endif
+ #include "static-services.h"
+ #include "static-hosts.h"
+ #include "ini-file-parser.h"
+@@ -134,11 +136,13 @@
+ #define RESOLV_CONF "/etc/resolv.conf"
+ #define BROWSE_DOMAINS_MAX 16
+
++#ifndef HAVE_BONJOUR
+ static AvahiSEntryGroup *dns_servers_entry_group = NULL;
+ static AvahiSEntryGroup *resolv_conf_entry_group = NULL;
+
+ static char **resolv_conf_name_servers = NULL;
+ static char **resolv_conf_search_domains = NULL;
++#endif
+
+ static DaemonConfig config;
+
+@@ -150,6 +154,7 @@
+ return strlen(s) >= l && strncmp(s, prefix, l) == 0;
+ }
+
++#ifndef HAVE_BONJOUR
+ static int load_resolv_conf(void) {
+ int ret = -1;
+ FILE *f;
+@@ -334,6 +339,7 @@
+ avahi_server_set_browse_domains(avahi_server, l);
+ avahi_string_list_free(l);
+ }
++#endif
+
+ static void server_callback(AvahiServer *s, AvahiServerState state, void *userdata) {
+ DaemonConfig *c = userdata;
+@@ -359,7 +365,7 @@
+
+ static_service_add_to_server();
+ static_hosts_add_to_server();
+-
++#ifndef HAVE_BONJOUR
+ remove_dns_server_entry_groups();
+
+ if (c->publish_resolv_conf && resolv_conf_name_servers && resolv_conf_name_servers[0])
+@@ -369,6 +375,7 @@
+ dns_servers_entry_group = add_dns_servers(s, dns_servers_entry_group, c->publish_dns_servers);
+
+ simple_protocol_restart_queries();
++#endif
+ break;
+
+ case AVAHI_SERVER_COLLISION: {
+@@ -376,7 +383,9 @@
+
+ static_service_remove_from_server();
+ static_hosts_remove_from_server();
++#ifndef HAVE_BONJOUR
+ remove_dns_server_entry_groups();
++#endif
+
+ n = avahi_alternative_host_name(avahi_server_get_host_name(s));
+
+@@ -405,7 +414,9 @@
+
+ static_service_remove_from_server();
+ static_hosts_remove_from_server();
++#ifndef HAVE_BONJOUR
+ remove_dns_server_entry_groups();
++#endif
+
+ break;
+
+@@ -425,9 +436,11 @@
+ " -r --reload Request a running daemon to reload static services\n"
+ " -c --check Return 0 if a daemon is already running\n"
+ " -V --version Show version\n"
++#ifndef HAVE_BONJOUR
+ " -f --file=FILE Load the specified configuration file instead of\n"
+ " "AVAHI_CONFIG_FILE"\n"
+ " --no-rlimits Don't enforce resource limits\n"
++#endif
+ " --no-drop-root Don't drop privileges\n"
+ #ifdef ENABLE_CHROOT
+ " --no-chroot Don't chroot()\n"
+@@ -456,11 +469,15 @@
+ { "daemonize", no_argument, NULL, 'D' },
+ { "kill", no_argument, NULL, 'k' },
+ { "version", no_argument, NULL, 'V' },
++#ifndef HAVE_BONJOUR
+ { "file", required_argument, NULL, 'f' },
++#endif
+ { "reload", no_argument, NULL, 'r' },
+ { "check", no_argument, NULL, 'c' },
+ { "syslog", no_argument, NULL, 's' },
++#ifndef HAVE_BONJOUR
+ { "no-rlimits", no_argument, NULL, OPTION_NO_RLIMITS },
++#endif
+ { "no-drop-root", no_argument, NULL, OPTION_NO_DROP_ROOT },
+ #ifdef ENABLE_CHROOT
+ { "no-chroot", no_argument, NULL, OPTION_NO_CHROOT },
+@@ -472,7 +489,11 @@
+
+ assert(c);
+
++#ifdef HAVE_BONJOUR
++ while ((o = getopt_long(argc, argv, "hDkVrcs", long_options, NULL)) >= 0) {
++#else
+ while ((o = getopt_long(argc, argv, "hDkVf:rcs", long_options, NULL)) >= 0) {
++#endif
+
+ switch(o) {
+ case 's':
+@@ -490,6 +511,7 @@
+ case 'V':
+ c->command = DAEMON_VERSION;
+ break;
++#ifndef HAVE_BONJOUR
+ case 'f':
+ avahi_free(c->config_file);
+ c->config_file = avahi_strdup(optarg);
+@@ -497,12 +519,15 @@
+ case 'r':
+ c->command = DAEMON_RELOAD;
+ break;
++#endif
+ case 'c':
+ c->command = DAEMON_CHECK;
+ break;
++#ifndef HAVE_BONJOUR
+ case OPTION_NO_RLIMITS:
+ c->set_rlimits = 0;
+ break;
++#endif
+ case OPTION_NO_DROP_ROOT:
+ c->drop_root = 0;
+ break;
+@@ -576,6 +601,7 @@
+ return 0;
+ }
+
++#ifndef HAVE_BONJOUR
+ static int load_config_file(DaemonConfig *c) {
+ int r = -1;
+ AvahiIniFile *f;
+@@ -845,6 +871,7 @@
+
+ return r;
+ }
++#endif
+
+ static void log_function(AvahiLogLevel level, const char *txt) {
+
+@@ -965,6 +992,7 @@
+ static_service_add_to_server();
+ static_hosts_add_to_server();
+
++#ifndef HAVE_BONJOUR
+ if (resolv_conf_entry_group)
+ avahi_s_entry_group_reset(resolv_conf_entry_group);
+
+@@ -975,6 +1003,7 @@
+
+ if (config.publish_resolv_conf && resolv_conf_name_servers && resolv_conf_name_servers[0])
+ resolv_conf_entry_group = add_dns_servers(avahi_server, resolv_conf_entry_group, resolv_conf_name_servers);
++#endif
+ }
+
+ #ifdef HAVE_INOTIFY
+@@ -1062,8 +1091,12 @@
+ break;
+
+ case SIGUSR1:
++#ifdef HAVE_BONJOUR
++ avahi_log_info("Got SIGUSR1, ignoring recor.");
++#else
+ avahi_log_info("Got SIGUSR1, dumping record data.");
+ avahi_server_dump(avahi_server, dump, NULL);
++#endif
+ break;
+
+ default:
+@@ -1103,8 +1136,10 @@
+
+ ignore_signal(SIGPIPE);
+
++#ifndef HAVE_BONJOUR
+ if (!(nss_support = avahi_nss_support()))
+ avahi_log_warn("WARNING: No NSS support for mDNS detected, consider installing nss-mdns!");
++#endif
+
+ if (!(simple_poll_api = avahi_simple_poll_new())) {
+ avahi_log_error("Failed to create main loop object.");
+@@ -1123,8 +1158,10 @@
+ goto finish;
+ }
+
++#ifndef HAVE_BONJOUR
+ if (simple_protocol_setup(poll_api) < 0)
+ goto finish;
++#endif
+
+ #ifdef HAVE_DBUS
+ if (c->enable_dbus) {
+@@ -1193,7 +1230,9 @@
+ }
+ #endif
+
++#ifndef HAVE_BONJOUR
+ load_resolv_conf();
++#endif
+ #ifdef ENABLE_CHROOT
+ static_service_load(config.use_chroot);
+ static_hosts_load(config.use_chroot);
+@@ -1207,8 +1246,10 @@
+ goto finish;
+ }
+
++#ifndef HAVE_BONJOUR
+ update_wide_area_servers();
+ update_browse_domains();
++#endif
+
+ if (c->daemonize) {
+ daemon_retval_send(0);
+@@ -1238,10 +1279,12 @@
+
+ static_hosts_remove_from_server();
+ static_hosts_free_all();
++#ifndef HAVE_BONJOUR
+
+ remove_dns_server_entry_groups();
+
+ simple_protocol_shutdown();
++#endif
+
+ #ifdef HAVE_DBUS
+ if (c->enable_dbus)
+@@ -1555,8 +1598,10 @@
+ goto finish;
+ }
+
++#ifndef HAVE_BONJOUR
+ if (load_config_file(&config) < 0)
+ goto finish;
++#endif
+
+ if (config.daemonize) {
+ daemon_retval_init();
+@@ -1648,9 +1693,13 @@
+
+ avahi_server_config_free(&config.server_config);
+ avahi_free(config.config_file);
++#ifdef HAVE_BONJOUR
++ assert(config.publish_dns_servers == NULL);
++#else
+ avahi_strfreev(config.publish_dns_servers);
+ avahi_strfreev(resolv_conf_name_servers);
+ avahi_strfreev(resolv_conf_search_domains);
++#endif
+
+ if (wrote_pid_file) {
+ #ifdef ENABLE_CHROOT
+--- avahi-0.6.30/avahi-daemon/static-services.c.orig 2011-08-22 13:40:56.137423950 +0100
++++ avahi-0.6.30/avahi-daemon/static-services.c 2011-08-22 14:02:55.507416810 +0100
+@@ -711,7 +711,11 @@
+ break;
+ #endif
+ default:
++#ifdef HAVE_BONJOUR
++ avahi_log_info("Failed to read "AVAHI_SERVICE_DIR".");
++#else
+ avahi_log_error("Failed to read "AVAHI_SERVICE_DIR".");
++#endif
+ break;
+ }
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/08-man-page.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,343 @@
+Source: Desktop consolidation
+Upstream promotion status: Solaris man page patch. No promote.
+
+--- /dev/null 2007-06-13 17:00:01.000000000 +0100
++++ avahi-0.6.19/man/avahi-daemon-bridge-dsd.1 2007-06-13 17:07:14.447743000 +0100
+@@ -0,0 +1,61 @@
++.TH avahi-daemon-bridge-dsd 1 User Manuals
++.SH NAME
++avahi-daemon-bridge-dsd \- The Avahi daemon bridge to dsd
++.SH SYNOPSIS
++\fBavahi-daemon-bridge-dsd [\fIoptions\fB]
++
++avahi-daemon-bridge-dsd --kill\fB
++
++avahi-daemon-bridge-dsd --check\fB
++\f1
++.SH DESCRIPTION
++The daemon implements a DBUS interface which provides a rich object oriented interface to DBUS enabled applications which browse for or register for services.
++
++Instead of implementing Apple's ZeroConf architecture (also known as "Rendezvous" or "Bonjour") it makes calls to the DNS Service Discovery API provided by Bonjour and so functions as a Bonjour client.
++.SH OPTIONS
++.TP
++\fB-D | --daemonize\f1
++Daemonize after startup. Implies \fB--syslog\f1
++.TP
++\fB-s | --syslog\f1
++Log to syslog instead of STDERR. Implied by \fB--daemonize\f1
++.TP
++\fB--debug\f1
++Increase verbosity to debug level
++.TP
++\fB--no-drop-root\f1
++Don't drop root priviliges after startup and don't require daemon to be started as root. We recommend not to use this option.
++.TP
++\fB--no-chroot\f1
++Don't \fBchroot(2)\f1 the daemon. This option is only available when compiled with chroot() support.
++.TP
++\fB--no-proctitle\f1
++Don't change the process name while running. Unless this option is specified avahi will reflect it's current state and selected host name in the process title.
++.TP
++\fB-k | --kill\f1
++Kill an already running avahi-daemon-bridge-dsd. (equivalent to sending a SIGTERM)
++.TP
++\fB-r | --reload\f1
++Tell an already running avahi-daemon-bridge-dsd to reread the files from \fI/etc/avahi/services/\f1. (equivalent to sending a SIGHUP)
++.TP
++\fB-c | --check\f1
++Return 0 as return code when avahi-daemon-bridge-dsd is already running.
++.TP
++\fB-h | --help\f1
++Show help
++.TP
++\fB-v | --version\f1
++Show version information
++.SH FILES
++\fI/etc/avahi/hosts\f1: additional static hostname mappings to publish in mDNS,
++see \fBavahi.hosts(5)\f1 for more information.
++
++\fI/etc/avahi/services/*.service\f1: static service definitions, see \fBavahi.service(5)\f1 for more information.
++.SH SIGNALS
++\fISIGINT, SIGTERM, SIGQUIT\f1: avahi-daemon will shutdown. This is issued by passing --kill to avahi-daemon.
++
++\fISIGHUP\f1: avahi-daemon-bridge-dsd will reload and static service definitions from \fI/etc/avahi/services/\f1.
++
++.SH SEE ALSO
++.SH COMMENTS
++This man page was written using \fBxml2man(1)\f1 by Padraig O'Briain.
+--- /dev/null 2007-06-13 17:00:01.000000000 +0100
++++ avahi-0.6.19/man/avahi-daemon-bridge-dsd.1.xml.in 2007-06-13 17:07:33.097758000 +0100
+@@ -0,0 +1,117 @@
++<?xml version="1.0"?><!--*-nxml-*-->
++<!DOCTYPE manpage SYSTEM "xmltoman.dtd">
++<?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
++
++<!-- $Id: avahi-daemon.1.xml.in 1138 2006-02-14 22:13:30Z lennart $ -->
++
++<!--
++ This file is part of avahi.
++
++ avahi is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Lesser General Public License as
++ published by the Free Software Foundation; either version 2.1 of the
++ License, or (at your option) any later version.
++
++ avahi is distributed in the hope that it will be useful, but WITHOUT
++ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
++ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
++ Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with avahi; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
++ USA.
++-->
++
++ <manpage name="avahi-daemon-bridge-dsd" section="1" desc="The Avahi daemon">
++
++ <synopsis>
++ <cmd>avahi-daemon [<arg>options</arg>]</cmd>
++ <cmd>avahi-daemon <opt>--kill</opt></cmd>
++ <cmd>avahi-daemon <opt>--check</opt></cmd>
++ </synopsis>
++
++ <description>
++ <p>The daemon implements a DBUS interface which provides a
++ rich object oriented interface to DBUS enabled applications which
++ browse for or register for services.</p>
++
++ <p>Instead of implementing Apple's ZeroConf architecture (also known as
++ "Rendezvous" or "Bonjour") it makes calls to the DNS Service Discovery
++ API provided by Bonjour and so functions as a Bonjour client.</p>
++ </description>
++
++ <options>
++
++ <option>
++ <p><opt>-D | --daemonize</opt></p>
++ <optdesc><p>Daemonize after startup. Implies <opt>--syslog</opt></p></optdesc>
++ </option>
++
++ <option>
++ <p><opt>-s | --syslog</opt></p>
++ <optdesc><p>Log to syslog instead of STDERR. Implied by <opt>--daemonize</opt></p></optdesc>
++ </option>
++
++ <option>
++ <p><opt>--debug</opt></p>
++ <optdesc><p>Increase verbosity to debug level</p></optdesc>
++ </option>
++
++ <option>
++ <p><opt>--no-drop-root</opt></p>
++ <optdesc><p>Don't drop root priviliges after startup and don't require daemon to be started as root. We recommend not to use this option.</p></optdesc>
++ </option>
++
++ <option>
++ <p><opt>--no-chroot</opt></p>
++ <optdesc><p>Don't <manref section="2" name="chroot"/> the daemon. This option is only available when compiled with chroot() support.</p></optdesc>
++ </option>
++
++ <option>
++ <p><opt>--no-proctitle</opt></p>
++ <optdesc><p>Don't change the process name while
++ running. Unless this option is specified avahi will reflect
++ it's current state and selected host name in the process
++ title.</p></optdesc>
++ </option>
++
++ <option>
++ <p><opt>-k | --kill</opt></p>
++ <optdesc><p>Kill an already running avahi-daemon-bridge-dsd. (equivalent to sending a SIGTERM)</p></optdesc>
++ </option>
++
++ <option>
++ <p><opt>-c | --check</opt></p>
++ <optdesc><p>Return 0 as return code when avahi-daemon-bridge-dsd is already running.</p></optdesc>
++ </option>
++
++ <option>
++ <p><opt>-h | --help</opt></p>
++ <optdesc><p>Show help</p></optdesc>
++ </option>
++
++ <option>
++ <p><opt>-v | --version</opt></p>
++ <optdesc><p>Show version information </p></optdesc>
++ </option>
++
++ </options>
++
++ <section name="Files">
++
++ </section>
++
++ <section name="Signals">
++ <p><arg>SIGINT, SIGTERM, SIGQUIT</arg>: avahi-daemon-bridge-dsd will shutdown. This is issued by passing --kill to avahi-daemon-bridge-dsd.</p>
++ </section>
++
++ <section name="See also">
++ </section>
++
++ <section name="Comments">
++ <p>This man page was written using <manref name="xml2man" section="1"
++ href="http://masqmail.cx/xml2man/"/> by Padraig O'Briain.</p>
++ </section>
++
++ </manpage>
+--- /usr/tmp/clean/avahi-0.6.19/man/avahi-browse.1 Wed May 9 15:45:42 2007
++++ avahi-0.6.19/man/avahi-browse.1 Wed Jun 13 16:08:06 2007
+@@ -13,7 +13,7 @@
+ avahi-browse-domains [\fIoptions\fB]
+ \f1
+ .SH DESCRIPTION
+-Browse for mDNS/DNS-SD network services and browsing domains using the Avahi daemon.
++Browse for mDNS/DNS-SD network services and browsing domains using the Avahi daemon. The daemon is not the standard Avahi daemon but a proxy to a Bonjour daemon.
+ .SH OPTIONS
+ Specify a DNS-SD service type (e.g. _http._tcp) to browse for on the command line, or \fB-a\f1 to browse for all available service types. Items that appear on the network are prefixed with "+", items that disappear are prefixed with "-". If \fB--resolve\f1 is passed items that are resolved are prefixed with "=".
+ .TP
+@@ -55,9 +55,7 @@
+ .TP
+ \fB-V | --version\f1
+ Show version information.
+-.SH AUTHORS
+-The Avahi Developers <avahi (at) lists (dot) freedesktop (dot) org>; Avahi is available from \fBhttp://avahi.org/\f1
+ .SH SEE ALSO
+-\fBavahi-publish(1)\f1, \fBavahi-resolve(1)\f1, \fBavahi-daemon(8)\f1
++\fBavahi-publish(1)\f1, \fBavahi-resolve(1)\f1
+ .SH COMMENTS
+ This man page was written using \fBxml2man(1)\f1 by Oliver Kurth.
+--- /usr/tmp/clean/avahi-0.6.19/man/avahi-discover.1 Wed May 9 15:45:43 2007
++++ avahi-0.6.19/man/avahi-discover.1 Wed Jun 13 15:42:13 2007
+@@ -5,12 +5,10 @@
+ \fBavahi-discover
+ \f1
+ .SH DESCRIPTION
+-Show a real-time graphical browse list for mDNS/DNS-SD network services running on the local LAN using the Avahi daemon.
++Show a real-time graphical browse list for mDNS/DNS-SD network services running on the local LAN using the Avahi daemon. The daemon is not the standard Avahi daemon but a proxy to a Bonjour daemon.
+ .SH OPTIONS
+ avahi-discover takes no command line arguments at the moment.
+-.SH AUTHORS
+-The Avahi Developers <avahi (at) lists (dot) freedesktop (dot) org>; Avahi is available from \fBhttp://avahi.org/\f1
+ .SH SEE ALSO
+-\fBavahi-daemon(8)\f1, \fBavahi-browse(1)\f1
++\fBavahi-browse(1)\f1
+ .SH COMMENTS
+ This man page was written using \fBxml2man(1)\f1 by Oliver Kurth.
+--- /usr/tmp/clean/avahi-0.6.19/man/avahi-publish.1 Wed May 9 15:45:43 2007
++++ avahi-0.6.19/man/avahi-publish.1 Wed Jun 13 15:44:27 2007
+@@ -11,7 +11,7 @@
+ avahi-publish-address [\fIoptions\fB] \fIhost name\fB \fIaddress\fB
+ \f1
+ .SH DESCRIPTION
+-Register an mDNS/DNS-SD service or host name/address mapping using the Avahi daemon.
++Register an mDNS/DNS-SD service or host name/address mapping using the Avahi daemon. The daemon is not the standard Avahi daemon but a proxy to a Bonjour daemon.
+ .SH OPTIONS
+ When calling in service registration mode, specify a DNS-SD service name (e.g. "Lennart's Files"), a service type (e.g. _http._tcp) and an IP port number for the service, optionally followed by any number of TXT record strings on the command line. When calling in address/host name registration mode specify a fully qualified host name and an address (IPv4 or IPv6).
+ .TP
+@@ -41,9 +41,7 @@
+ .TP
+ \fB-V | --version\f1
+ Show version information.
+-.SH AUTHORS
+-The Avahi Developers <avahi (at) lists (dot) freedesktop (dot) org>; Avahi is available from \fBhttp://avahi.org/\f1
+ .SH SEE ALSO
+-\fBavahi-resolve(1)\f1, \fBavahi-browse(1)\f1, \fBavahi-daemon(8)\f1
++\fBavahi-resolve(1)\f1, \fBavahi-browse(1)\f1
+ .SH COMMENTS
+ This man page was written using \fBxml2man(1)\f1 by Oliver Kurth.
+--- /usr/tmp/clean/avahi-0.6.22/man/avahi-resolve.1 Mon Dec 17 15:40:46 2007
++++ avahi-0.6.22/man/avahi-resolve.1 Tue Dec 18 08:38:39 2007
+@@ -11,7 +11,7 @@
+ avahi-resolve-address \fIaddress ...\fB
+ \f1
+ .SH DESCRIPTION
+-Resolve one or more mDNS/DNS host name(s) to IP address(es) (and vice versa) using the Avahi daemon.
++Resolve one or more mDNS/DNS host name(s) to IP address(es) (and vice versa) using the Avahi daemon. The daemon is not the standard Avahi daemon but a proxy to a Bonjour daemon.
+ .SH OPTIONS
+ When passing -n, specify one or more fully qualified mDNS/DNS host name(s) (e.g. "foo.local") to resolve into IP addresses on the command line. When passing -a, specify one or more IP address to resolve into host names.
+
+@@ -39,9 +39,7 @@
+ .TP
+ \fB-V | --version\f1
+ Show version information.
+-.SH AUTHORS
+-The Avahi Developers <avahi (at) lists (dot) freedesktop (dot) org>; Avahi is available from \fBhttp://avahi.org/\f1
+ .SH SEE ALSO
+-\fBavahi-publish-address(1)\f1, \fBavahi-daemon(8)\f1
++\fBavahi-publish-address(1)\f1
+ .SH COMMENTS
+ This man page was written using \fBxml2man(1)\f1 by Oliver Kurth.
+--- /usr/tmp/clean/avahi-0.6.22/man/avahi-set-host-name.1 Mon Dec 17 15:40:46 2007
++++ avahi-0.6.22/man/avahi-set-host-name.1 Tue Dec 18 08:39:22 2007
+@@ -5,7 +5,7 @@
+ \fBavahi-set-host-name \fIhost-name\fB
+ \f1
+ .SH DESCRIPTION
+-Set the mDNS host name of a currently running Avahi daemon. The effect of this operation is not persistent across daemon restarts. This operation is usually privileged.
++Set the mDNS host name of a currently running Avahi daemon. The effect of this operation is not persistent across daemon restarts. This operation is usually privileged. The daemon is not the standard Avahi daemon but a proxy to a Bonjour daemon.
+ .SH OPTIONS
+ .TP
+ \fB-v | --verbose\f1
+@@ -16,9 +16,5 @@
+ .TP
+ \fB-V | --version\f1
+ Show version information.
+-.SH AUTHORS
+-The Avahi Developers <avahi (at) lists (dot) freedesktop (dot) org>; Avahi is available from \fBhttp://avahi.org/\f1
+-.SH SEE ALSO
+-\fBavahi-daemon(8)\f1
+ .SH COMMENTS
+ This man page was written using \fBxml2man(1)\f1 by Oliver Kurth.
+--- /usr/tmp/clean/avahi-0.6.23/man/bssh.1 2008-06-24 00:29:07.000000000 +0100
++++ avahi-0.6.23/man/bssh.1 2008-06-25 13:56:28.037867000 +0100
+@@ -28,8 +28,6 @@
+ .TP
+ \fB-h | --help\f1
+ Show help.
+-.SH AUTHORS
+-The Avahi Developers <avahi (at) lists (dot) freedesktop (dot) org>; Avahi is available from \fBhttp://avahi.org/\f1
+ .SH SEE ALSO
+ \fBavahi-browse(1)\f1, \fBssh(1)\f1, \fBvncviewer(1)\f1
+ .SH COMMENTS
+--- /usr/tmp/clean/avahi-0.6.28/man/Makefile.am 2010-08-26 01:51:39.039153001 +0100
++++ avahi-0.6.28/man/Makefile.am 2011-01-20 14:48:39.364580063 +0000
+@@ -45,6 +45,11 @@
+ avahi-autoipd.action.8.xml \
+ bssh.1.xml
+
++if HAVE_BONJOUR
++noinst_DATA += \
++ avahi-daemon-bridge-dsd.1.xml
++endif
++
+ CLEANFILES = \
+ $(noinst_DATA)
+
+@@ -81,6 +86,15 @@
+ endif
+ endif
+
++if HAVE_BONJOUR
++man_MANS += \
++ avahi-daemon-bridge-dsd.1
++
++avahi-daemon-bridge-dsd.1.xml: avahi-daemon-bridge-dsd.1.xml.in Makefile
++ sed -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
++ -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
++endif
++
+ %.xml: %.xml.in Makefile
+ $(AM_V_GEN) sed -e 's,@pkgsysconfdir\@,$(pkgsysconfdir),g' \
+ -e 's,@servicedir\@,$(servicedir),g' \
+@@ -130,6 +144,10 @@
+ xmltoman.xsl \
+ xmltoman.dtd
+
++if HAVE_BONJOUR
++EXTRA_DIST += \
++ avahi-daemon-bridge-dsd.1.xml.in
++endif
+
+ if HAVE_DBUS
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/09-resolve-host-name.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,270 @@
+Source: Desktop consolidation
+Upstream promotion status: unknown
+
+--- /usr/tmp/clean/avahi-0.6.28/avahi-core/resolve-host-name.c 2010-08-26 01:51:38.991153000 +0100
++++ avahi-0.6.28/avahi-core/resolve-host-name.c 2011-01-20 15:06:17.971781264 +0000
+@@ -22,6 +22,7 @@
+ #endif
+
+ #include <stdlib.h>
++#include <stdio.h>
+
+ #include <avahi-common/domain.h>
+ #include <avahi-common/timeval.h>
+@@ -50,6 +51,15 @@
+
+ AvahiTimeEvent *time_event;
+
++#ifdef HAVE_BONJOUR
++ AvahiTimeEvent *defer_time_event;
++ AvahiWatch *watch_a;
++ AvahiWatch *watch_a6;
++ AvahiLookupFlags lookup_flags;
++ DNSServiceRef client_a;
++ DNSServiceRef client_a6;
++#endif
++
+ AVAHI_LLIST_FIELDS(AvahiSHostNameResolver, resolver);
+ };
+
+@@ -86,7 +96,7 @@
+ break;
+
+ }
+-
++
+ case AVAHI_RESOLVER_FAILURE:
+
+ r->callback(r, r->interface, r->protocol, event, r->host_name, NULL, r->flags, r->userdata);
+@@ -94,6 +104,168 @@
+ }
+ }
+
++#ifdef HAVE_BONJOUR
++static void resolve_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent events,
++void *userdata) {
++ AvahiSHostNameResolver *r = userdata;
++ DNSServiceErrorType ret;
++ DNSServiceRef client;
++
++ assert(w);
++ assert(fd >= 0);
++ assert(events & AVAHI_WATCH_IN);
++
++ if (fd == DNSServiceRefSockFD(r->client_a))
++ client = r->client_a;
++ else if (fd == DNSServiceRefSockFD(r->client_a6))
++ client = r->client_a6;
++ else
++ assert (0);
++
++ ret = DNSServiceProcessResult(client);
++ if (ret != kDNSServiceErr_NoError) {
++ if (client == r->client_a) {
++ if (r->watch_a) {
++ r->server->poll_api->watch_free(r->watch_a);
++ r->watch_a = NULL;
++ }
++ DNSServiceRefDeallocate(r->client_a);
++ r->client_a = NULL;
++ } else if (client == r->client_a6) {
++ if (r->watch_a6) {
++ r->server->poll_api->watch_free(r->watch_a6);
++ r->watch_a6 = NULL;
++ }
++ DNSServiceRefDeallocate(r->client_a6);
++ r->client_a6 = NULL;
++ }
++ avahi_server_set_errno(r->server, AVAHI_ERR_DISCONNECTED);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ }
++}
++
++static void resolve_reply(DNSServiceRef client, DNSServiceFlags flags, uint32_t IfIndex, DNSServiceErrorType errorCode, const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void* rdata, uint32_t ttl, void *context) {
++ AvahiSHostNameResolver *r = context;
++ const unsigned char *rd = rdata;
++ AvahiAddress a;
++
++ assert(rrtype == kDNSServiceType_A || rrtype == kDNSServiceType_A6);
++ if (!flags & kDNSServiceFlagsAdd)
++ /* this is a remove event so ignore*/
++ return;
++
++ if (r->interface > 0 && IfIndex != r->interface)
++ return;
++ if (r->interface <= 0)
++ r->interface = IfIndex;
++
++ /*
++ * Using Bonjour we cannot determine whether result was obtained from
++ * multicast ot unicast query
++ */
++ r->flags = 0;
++
++ switch (rrtype) {
++ case kDNSServiceType_A:
++ if (r->protocol == AVAHI_PROTO_UNSPEC)
++ r->protocol = AVAHI_PROTO_INET;
++ else if (r->protocol != AVAHI_PROTO_INET)
++ return;
++
++ if (!r->address_record) {
++ if (!(r->address_record = avahi_record_new_full(r->host_name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_A, ttl))) {
++ avahi_server_set_errno(r->server, AVAHI_ERR_NO_MEMORY);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ return;
++ }
++ if (avahi_rdata_parse(r->address_record, rdata, rdlen) != 0) {
++ avahi_server_set_errno(r->server, AVAHI_ERR_INVALID_PACKET);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ }
++ }
++ break;
++ case kDNSServiceType_A6:
++ if (r->protocol == AVAHI_PROTO_UNSPEC)
++ r->protocol = AVAHI_PROTO_INET6;
++ else if (r->protocol != AVAHI_PROTO_INET6)
++ return;
++ if (!r->address_record) {
++ if (!(r->address_record = avahi_record_new_full(r->host_name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_AAAA, ttl))) {
++ avahi_server_set_errno(r->server, AVAHI_ERR_NO_MEMORY);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ return;
++ }
++ if (avahi_rdata_parse(r->address_record, rdata, rdlen) != 0) {
++ avahi_server_set_errno(r->server, AVAHI_ERR_INVALID_PACKET);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ return;
++ }
++ }
++ break;
++ default:
++ abort();
++ }
++ finish(r, AVAHI_RESOLVER_FOUND);
++}
++
++static void resolve_error_callback(AvahiTimeEvent *e, void *userdata) {
++ AvahiSHostNameResolver *r = userdata;
++
++ if (r->defer_time_event) {
++ avahi_time_event_free(r->defer_time_event);
++ r->defer_time_event = NULL;
++ }
++ avahi_server_set_errno(r->server, AVAHI_ERR_FAILURE);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++}
++
++static void avahi_resolve_host_name_start(AvahiSHostNameResolver *r, AvahiProtocol aprotocol)
++{
++ DNSServiceErrorType ret;
++ DNSServiceFlags flags;
++
++ if (r->flags == AVAHI_LOOKUP_USE_MULTICAST)
++ flags = kDNSServiceFlagsForceMulticast;
++
++ if (aprotocol == AVAHI_PROTO_INET || aprotocol == AVAHI_PROTO_UNSPEC) {
++ ret = DNSServiceQueryRecord(&r->client_a,
++ flags,
++ r->interface == AVAHI_IF_UNSPEC ?
++ kDNSServiceInterfaceIndexAny :
++ r->interface,
++ r->host_name,
++ kDNSServiceType_A,
++ kDNSServiceClass_IN,
++ resolve_reply,
++ r);
++ if (ret != kDNSServiceErr_NoError || !r->client_a) {
++ r->defer_time_event = avahi_time_event_new(r->server->time_event_queue, NULL, resolve_error_callback, r);
++ return;
++ } else {
++ r->watch_a = r->server->poll_api->watch_new(r->server->poll_api, DNSServiceRefSockFD(r->client_a), AVAHI_WATCH_IN, resolve_socket_event, r);
++ }
++ }
++ if (aprotocol == AVAHI_PROTO_INET6 || aprotocol == AVAHI_PROTO_UNSPEC) {
++ ret = DNSServiceQueryRecord(&r->client_a6,
++ flags,
++ r->interface == AVAHI_IF_UNSPEC ?
++ kDNSServiceInterfaceIndexAny :
++ r->interface,
++ r->host_name,
++ kDNSServiceType_AAAA,
++ kDNSServiceClass_IN,
++ resolve_reply,
++ r);
++ if (ret != kDNSServiceErr_NoError || !r->client_a6) {
++ r->defer_time_event = avahi_time_event_new(r->server->time_event_queue, NULL, resolve_error_callback, r);
++ return;
++ } else {
++ r->watch_a6 = r->server->poll_api->watch_new(r->server->poll_api, DNSServiceRefSockFD(r->client_a6), AVAHI_WATCH_IN, resolve_socket_event, r);
++ }
++ }
++}
++#endif
++
+ static void time_event_callback(AvahiTimeEvent *e, void *userdata) {
+ AvahiSHostNameResolver *r = userdata;
+
+@@ -116,6 +288,7 @@
+ r->time_event = avahi_time_event_new(r->server->time_event_queue, &tv, time_event_callback, r);
+ }
+
++#ifndef HAVE_BONJOUR
+ static void record_browser_callback(
+ AvahiSRecordBrowser*rr,
+ AvahiIfIndex interface,
+@@ -200,6 +373,7 @@
+ break;
+ }
+ }
++#endif
+
+ AvahiSHostNameResolver *avahi_s_host_name_resolver_new(
+ AvahiServer *server,
+@@ -246,6 +420,15 @@
+
+ r->record_browser_aaaa = r->record_browser_a = NULL;
+
++#ifdef HAVE_BONJOUR
++ r->defer_time_event = NULL;
++ r->watch_a = NULL;
++ r->watch_a6 = NULL;
++ r->client_a = NULL;
++ r->client_a6 = NULL;
++ r->lookup_flags = flags;
++ avahi_resolve_host_name_start (r, aprotocol);
++#else
+ if (aprotocol == AVAHI_PROTO_INET || aprotocol == AVAHI_PROTO_UNSPEC) {
+ k = avahi_key_new(host_name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_A);
+ r->record_browser_a = avahi_s_record_browser_new(server, interface, protocol, k, flags, record_browser_callback, r);
+@@ -265,6 +448,7 @@
+ }
+
+ assert(r->record_browser_aaaa || r->record_browser_a);
++#endif
+
+ start_timeout(r);
+
+@@ -291,6 +475,22 @@
+
+ if (r->address_record)
+ avahi_record_unref(r->address_record);
++#ifdef HAVE_BONJOUR
++ if (r->defer_time_event) {
++ avahi_time_event_free(r->defer_time_event);
++ r->defer_time_event = NULL;
++ }
++
++ if (r->watch_a)
++ r->server->poll_api->watch_free(r->watch_a);
++ if (r->watch_a6)
++ r->server->poll_api->watch_free(r->watch_a6);
++
++ if (r->client_a)
++ DNSServiceRefDeallocate(r->client_a);
++ if (r->client_a6)
++ DNSServiceRefDeallocate(r->client_a6);
++#endif
+
+ avahi_free(r->host_name);
+ avahi_free(r);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/10-resolve-address.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,185 @@
+Source: Desktop consolidation
+Upstream promotion status: unknown
+
+--- /usr/tmp/clean/avahi-0.6.28/avahi-core/resolve-address.c 2010-08-26 01:51:38.991153000 +0100
++++ avahi-0.6.28/avahi-core/resolve-address.c 2011-01-20 15:17:11.922176647 +0000
+@@ -22,6 +22,7 @@
+ #endif
+
+ #include <stdlib.h>
++#include <stdio.h>
+
+ #include <avahi-common/timeval.h>
+ #include <avahi-common/malloc.h>
+@@ -51,6 +52,13 @@
+
+ AvahiTimeEvent *time_event;
+
++#ifdef HAVE_BONJOUR
++ AvahiTimeEvent *defer_time_event;
++ AvahiLookupFlags lookup_flags;
++ AvahiWatch *watch;
++ DNSServiceRef client;
++#endif
++
+ AVAHI_LLIST_FIELDS(AvahiSAddressResolver, resolver);
+ };
+
+@@ -74,6 +82,100 @@
+ }
+ }
+
++#ifdef HAVE_BONJOUR
++static void resolve_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent events,
++void *userdata) {
++ AvahiSAddressResolver *r = userdata;
++ DNSServiceErrorType ret;
++
++ assert(w);
++ assert(fd >= 0);
++ assert(events & AVAHI_WATCH_IN);
++
++ assert (fd == DNSServiceRefSockFD(r->client));
++
++ ret = DNSServiceProcessResult(r->client);
++ if (ret != kDNSServiceErr_NoError) {
++ if (r->watch) {
++ r->server->poll_api->watch_free(r->watch);
++ r->watch = NULL;
++ }
++ DNSServiceRefDeallocate(r->client);
++ r->client = NULL;
++ avahi_server_set_errno(r->server, AVAHI_ERR_DISCONNECTED);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ }
++}
++
++static void resolve_reply(DNSServiceRef client, DNSServiceFlags flags, uint32_t
++IfIndex, DNSServiceErrorType errorCode, const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void* rdata, uint32_t ttl, void *context) {
++ AvahiSAddressResolver *r = context;
++
++ assert(rrtype == kDNSServiceType_PTR);
++ if (r->interface > 0 && IfIndex != r->interface)
++ return;
++ if (r->interface <= 0)
++ r->interface = IfIndex;
++
++ /*
++ * Using Bonjour we cannot determine whether result was obtained from
++ * multicast ot unicast query
++ */
++ r->flags = 0;
++
++ if (!(r->ptr_record = avahi_record_new(r->key, ttl))) {
++ avahi_server_set_errno(r->server, AVAHI_ERR_NO_MEMORY);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ return;
++ }
++ if (avahi_rdata_parse(r->ptr_record, rdata, rdlen) != 0) {
++ avahi_server_set_errno(r->server, AVAHI_ERR_INVALID_PACKET);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++ return;
++ }
++ finish(r, AVAHI_RESOLVER_FOUND);
++}
++
++static void resolve_error_callback(AvahiTimeEvent *e, void *userdata) {
++ AvahiSAddressResolver *r = userdata;
++
++ if (r->defer_time_event) {
++ avahi_time_event_free(r->defer_time_event);
++ r->defer_time_event = NULL;
++ }
++ avahi_server_set_errno(r->server, AVAHI_ERR_FAILURE);
++ finish(r, AVAHI_RESOLVER_FAILURE);
++}
++
++static void avahi_resolve_address_start(AvahiSAddressResolver *r)
++{
++ DNSServiceErrorType ret;
++ DNSServiceFlags flags;
++
++ if (r->flags != AVAHI_LOOKUP_USE_WIDE_AREA)
++ flags = kDNSServiceFlagsForceMulticast;
++ else
++ flags = 0;
++
++ ret = DNSServiceQueryRecord(&r->client,
++ flags,
++ r->interface == AVAHI_IF_UNSPEC ?
++ kDNSServiceInterfaceIndexAny :
++ r->interface,
++ r->key->name,
++ kDNSServiceType_PTR,
++ kDNSServiceClass_IN,
++ resolve_reply,
++ r);
++ if (ret != kDNSServiceErr_NoError || !r->client) {
++ r->defer_time_event = avahi_time_event_new(r->server->time_event_queue, NULL, resolve_error_callback, r);
++ } else {
++ r->watch = r->server->poll_api->watch_new(r->server->poll_api, DNSServiceRefSockFD(r->client), AVAHI_WATCH_IN, resolve_socket_event, r);
++ }
++}
++#endif
++
++
+ static void time_event_callback(AvahiTimeEvent *e, void *userdata) {
+ AvahiSAddressResolver *r = userdata;
+
+@@ -95,6 +197,7 @@
+ r->time_event = avahi_time_event_new(r->server->time_event_queue, &tv, time_event_callback, r);
+ }
+
++#ifndef HAVE_BONJOUR
+ static void record_browser_callback(
+ AvahiSRecordBrowser*rr,
+ AvahiIfIndex interface,
+@@ -173,6 +276,7 @@
+ break;
+ }
+ }
++#endif
+
+ AvahiSAddressResolver *avahi_s_address_resolver_new(
+ AvahiServer *server,
+@@ -225,6 +329,13 @@
+
+ r->time_event = NULL;
+
++#ifdef HAVE_BONJOUR
++ r->defer_time_event = NULL;
++ r->watch = NULL;
++ r->client = NULL;
++ r->lookup_flags = flags;
++ avahi_resolve_address_start(r);
++#else
+ if (!(flags & (AVAHI_LOOKUP_USE_MULTICAST|AVAHI_LOOKUP_USE_WIDE_AREA))) {
+
+ if (!server->wide_area_lookup_engine || !avahi_wide_area_has_servers(server->wide_area_lookup_engine))
+@@ -241,6 +352,7 @@
+ avahi_s_address_resolver_free(r);
+ return NULL;
+ }
++#endif
+
+ start_timeout(r);
+
+@@ -264,5 +376,18 @@
+ if (r->key)
+ avahi_key_unref(r->key);
+
++#ifdef HAVE_BONJOUR
++ if (r->defer_time_event) {
++ avahi_time_event_free(r->defer_time_event);
++ r->defer_time_event = NULL;
++ }
++
++ if (r->watch)
++ r->server->poll_api->watch_free(r->watch);
++
++ if (r->client)
++ DNSServiceRefDeallocate(r->client);
++#endif
++
+ avahi_free(r);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/11-browse-domain.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,201 @@
+Source: Desktop consolidation
+Upstream promotion status: unknown
+
+--- /usr/tmp/clean/avahi-0.6.28/avahi-core/browse-domain.c 2010-08-26 01:51:38.982153000 +0100
++++ avahi-0.6.28/avahi-core/browse-domain.c 2011-01-20 15:24:22.639202717 +0000
+@@ -26,6 +26,9 @@
+ #include <avahi-common/domain.h>
+ #include <avahi-common/malloc.h>
+ #include <avahi-common/error.h>
++#ifdef HAVE_BONJOUR
++#include <avahi-common/timeval.h>
++#endif
+
+ #include "browse.h"
+ #include "log.h"
+@@ -45,6 +48,14 @@
+
+ int all_for_now_scheduled;
+
++#ifdef HAVE_BONJOUR
++ AvahiIfIndex interface;
++ AvahiTimeEvent *browse_error_event;
++ AvahiTimeEvent *all_for_now_event;
++ AvahiLookupFlags flags;
++ AvahiWatch *watch;
++ DNSServiceRef client;
++#endif
+ AVAHI_LLIST_FIELDS(AvahiSDomainBrowser, browser);
+ };
+
+@@ -135,6 +146,122 @@
+ avahi_s_domain_browser_free(b);
+ }
+
++#ifdef HAVE_BONJOUR
++static void enumerate_reply(DNSServiceRef service,
++ DNSServiceFlags flags,
++ uint32_t IfIndex,
++ DNSServiceErrorType errorCode,
++ const char *replyDomain,
++ void *context) {
++ AvahiSDomainBrowser *b = context;
++ AvahiIfIndex interface;
++
++ if (flags & kDNSServiceFlagsDefault)
++ if (b->flags != AVAHI_DOMAIN_BROWSER_BROWSE_DEFAULT &&
++ b->flags != AVAHI_DOMAIN_BROWSER_REGISTER_DEFAULT)
++ return;
++
++ interface = (IfIndex == kDNSServiceInterfaceIndexAny) ? AVAHI_IF_UNSPEC : IfIndex;
++
++ b->callback(b, interface, AVAHI_PROTO_UNSPEC, AVAHI_BROWSER_NEW, replyDomain, 0 /* flags */, b->userdata);
++}
++
++static void enumerate_error_callback(AvahiTimeEvent *e, void *userdata) {
++ AvahiSDomainBrowser *b = userdata;
++
++ if (b->browse_error_event) {
++ avahi_time_event_free(b->browse_error_event);
++ b->browse_error_event = NULL;
++ }
++ avahi_server_set_errno(b->server, AVAHI_ERR_FAILURE);
++ b->callback(b,
++ b->interface,
++ AVAHI_PROTO_UNSPEC,
++ AVAHI_BROWSER_FAILURE,
++ NULL,
++ 0,
++ b->userdata);
++}
++
++static void all_for_now_callback(AvahiTimeEvent *e, void* userdata) {
++ AvahiSDomainBrowser *b = userdata;
++
++ assert(e);
++ assert(b);
++
++ avahi_time_event_free(b->all_for_now_event);
++ b->all_for_now_event = NULL;
++
++ b->callback(b,
++ AVAHI_IF_UNSPEC,
++ AVAHI_PROTO_UNSPEC,
++ AVAHI_BROWSER_ALL_FOR_NOW,
++ NULL,
++ 0,
++ b->userdata);
++}
++
++static void enumerate_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent events, void *userdata) {
++ AvahiSDomainBrowser *b = userdata;
++ DNSServiceErrorType ret;
++
++ assert(w);
++ assert(fd >= 0);
++ assert(events & AVAHI_WATCH_IN);
++
++ assert (fd == DNSServiceRefSockFD(b->client));
++ ret = DNSServiceProcessResult(b->client);
++ if (ret != kDNSServiceErr_NoError) {
++ if (b->watch) {
++ b->server->poll_api->watch_free(b->watch);
++ b->watch = NULL;
++ }
++ DNSServiceRefDeallocate(b->client);
++ b->client = NULL;
++ avahi_server_set_errno(b->server, AVAHI_ERR_DISCONNECTED);
++ b->callback(b,
++ b->interface,
++ AVAHI_PROTO_UNSPEC,
++ AVAHI_BROWSER_FAILURE,
++ NULL,
++ 0,
++ b->userdata);
++ }
++}
++
++static void avahi_browse_domains_start(AvahiSDomainBrowser *b) {
++ DNSServiceErrorType ret;
++ DNSServiceFlags flags;
++ struct timeval tv;
++
++ if (b->flags == AVAHI_DOMAIN_BROWSER_BROWSE ||
++ b->flags == AVAHI_DOMAIN_BROWSER_BROWSE_DEFAULT)
++ flags = kDNSServiceFlagsBrowseDomains;
++ else if (b->flags == AVAHI_DOMAIN_BROWSER_REGISTER ||
++ b->flags == AVAHI_DOMAIN_BROWSER_REGISTER_DEFAULT)
++ flags = kDNSServiceFlagsRegistrationDomains;
++
++ ret = DNSServiceEnumerateDomains(&b->client,
++ flags,
++ b->interface == AVAHI_IF_UNSPEC ?
++ kDNSServiceInterfaceIndexAny :
++ b->interface,
++ enumerate_reply,
++ b);
++ if (ret != kDNSServiceErr_NoError || !b->client) {
++ b->browse_error_event = avahi_time_event_new(b->server->time_event_queue,
++NULL, enumerate_error_callback, b);
++ } else {
++ b->watch = b->server->poll_api->watch_new(b->server->poll_api, DNSServiceRefSockFD(b->client), AVAHI_WATCH_IN, enumerate_socket_event, b);
++
++ /* Add a second */
++ gettimeofday(&tv, NULL);
++ avahi_timeval_add(&tv, 1000000);
++ b->all_for_now_event = avahi_time_event_new(b->server->time_event_queue, &tv, all_for_now_callback, b);
++ }
++}
++#endif
++
+ AvahiSDomainBrowser *avahi_s_domain_browser_new(
+ AvahiServer *server,
+ AvahiIfIndex interface,
+@@ -191,6 +318,15 @@
+
+ AVAHI_LLIST_PREPEND(AvahiSDomainBrowser, browser, server->domain_browsers, b);
+
++#ifdef HAVE_BONJOUR
++ b->interface = interface;
++ b->client = NULL;
++ b->watch = NULL;
++ b->browse_error_event = NULL;
++ b->all_for_now_event = NULL;
++ b->flags = flags;
++ avahi_browse_domains_start(b);
++#else
+ if (!(k = avahi_key_new(n, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_PTR))) {
+ avahi_server_set_errno(server, AVAHI_ERR_NO_MEMORY);
+ goto fail;
+@@ -203,6 +339,7 @@
+
+ if (type == AVAHI_DOMAIN_BROWSER_BROWSE && b->server->config.browse_domains)
+ b->defer_event = avahi_time_event_new(server->time_event_queue, NULL, defer_callback, b);
++#endif
+
+ return b;
+
+@@ -225,6 +362,23 @@
+
+ AVAHI_LLIST_REMOVE(AvahiSDomainBrowser, browser, b->server->domain_browsers, b);
+
++#ifdef HAVE_BONJOUR
++ if (b->browse_error_event) {
++ avahi_time_event_free(b->browse_error_event);
++ b->browse_error_event = NULL;
++ }
++ if (b->all_for_now_event) {
++ avahi_time_event_free(b->all_for_now_event);
++ b->all_for_now_event = NULL;
++ }
++
++ if (b->watch)
++ b->server->poll_api->watch_free(b->watch);
++
++ if (b->client)
++ DNSServiceRefDeallocate(b->client);
++#endif
++
+ if (b->record_browser)
+ avahi_s_record_browser_free(b->record_browser);
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/12-browse.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,159 @@
+Source: Desktop consolidation
+Upstream promotion status: unknown
+
+--- /usr/tmp/clean/avahi-0.6.28/avahi-core/browse.c 2010-08-26 01:51:38.983153000 +0100
++++ avahi-0.6.28/avahi-core/browse.c 2011-01-20 15:27:33.366236170 +0000
+@@ -22,6 +22,7 @@
+ #endif
+
+ #include <stdlib.h>
++#include <stdio.h>
+
+ #include <avahi-common/timeval.h>
+ #include <avahi-common/malloc.h>
+@@ -519,6 +520,91 @@
+ }
+ }
+
++#ifdef HAVE_BONJOUR
++static void resolve_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent events,
++void *userdata) {
++ AvahiSRecordBrowser *b = userdata;
++ DNSServiceErrorType ret;
++ DNSServiceRef client;
++
++ assert(w);
++ assert(fd >= 0);
++ assert(events & AVAHI_WATCH_IN);
++
++ assert (fd == DNSServiceRefSockFD(b->client));
++
++ ret = DNSServiceProcessResult(b->client);
++ if (ret != kDNSServiceErr_NoError) {
++ if (b->watch) {
++ b->server->poll_api->watch_free(b->watch);
++ b->watch = NULL;
++ }
++ DNSServiceRefDeallocate(b->client);
++ b->client = NULL;
++ avahi_server_set_errno(b->server, AVAHI_ERR_DISCONNECTED);
++ b->callback(b, b->interface, b->protocol, AVAHI_BROWSER_FAILURE, NULL, 0, b->userdata);
++ }
++}
++
++static void resolve_error_callback(AvahiTimeEvent *e, void *userdata) {
++ AvahiSRecordBrowser *b = userdata;
++
++ if (b->defer_time_event) {
++ avahi_time_event_free(b->defer_time_event);
++ b->defer_time_event = NULL;
++ }
++ avahi_server_set_errno(b->server, AVAHI_ERR_FAILURE);
++ b->callback(
++ b, b->interface, b->protocol, AVAHI_BROWSER_FAILURE, NULL,
++ 0,
++ b->userdata);
++}
++
++static void browse_reply(DNSServiceRef client, DNSServiceFlags flags, uint32_t ifIndex, DNSServiceErrorType errorCode,
++ const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata, uint32_t ttl, void *context) {
++ AvahiSRecordBrowser *b = context;
++ AvahiRecord *rr;
++ AvahiKey *k;
++
++ k = avahi_key_new(fullname, rrclass, rrtype);
++ rr = avahi_record_new(k, ttl);
++ if (avahi_rdata_parse(rr, rdata, rdlen) != 0) {
++ printf("parse failed\n");
++ return;
++ }
++ b->callback(b, b->interface, b->protocol, AVAHI_BROWSER_NEW, rr, 0, b->userdata);
++ avahi_record_unref(rr);
++}
++
++static void avahi_browse_record_start(AvahiSRecordBrowser *b) {
++ DNSServiceErrorType ret;
++ DNSServiceFlags flags;
++
++ if (b->flags != AVAHI_LOOKUP_USE_WIDE_AREA)
++ flags = kDNSServiceFlagsForceMulticast;
++ else
++ flags = 0;
++
++ ret = DNSServiceQueryRecord(&b->client,
++ 0,
++ b->interface == AVAHI_IF_UNSPEC ?
++ kDNSServiceInterfaceIndexAny :
++ b->interface,
++ b->key->name,
++ b->key->type,
++ b->key->clazz,
++ browse_reply,
++ b);
++ if (ret != kDNSServiceErr_NoError || !b->client) {
++ b->defer_time_event = avahi_time_event_new(b->server->time_event_queue,
++NULL, resolve_error_callback, b);
++ } else {
++ b->defer_time_event = NULL;
++ b->watch = b->server->poll_api->watch_new(b->server->poll_api, DNSServiceRefSockFD(b->client), AVAHI_WATCH_IN, resolve_socket_event, b);
++ }
++}
++#endif
++
+ AvahiSRecordBrowser *avahi_s_record_browser_new(
+ AvahiServer *server,
+ AvahiIfIndex interface,
+@@ -560,9 +646,15 @@
+
+ AVAHI_LLIST_PREPEND(AvahiSRecordBrowser, browser, server->record_browsers, b);
+
++#ifdef HAVE_BONJOUR
++ b->watch = NULL;
++ b->client = NULL;
++ avahi_browse_record_start(b);
++#else
+ /* The currently cached entries are scanned a bit later, and than we will start querying, too */
+ b->defer_time_event = avahi_time_event_new(server->time_event_queue, NULL, defer_callback, b);
+ assert(b->defer_time_event);
++#endif
+
+ return b;
+ }
+@@ -575,6 +667,13 @@
+ b->server->need_browser_cleanup = 1;
+
+ browser_cancel(b);
++#ifdef HAVE_BONJOUR
++ if (b->watch)
++ b->server->poll_api->watch_free(b->watch);
++
++ if (b->client)
++ DNSServiceRefDeallocate(b->client);
++#endif
+ }
+
+ void avahi_s_record_browser_destroy(AvahiSRecordBrowser *b) {
+@@ -608,6 +707,8 @@
+
+ if (server->wide_area_lookup_engine)
+ avahi_wide_area_cleanup(server->wide_area_lookup_engine);
++#ifndef HAVE_BONJOUR
+ avahi_multicast_lookup_engine_cleanup(server->multicast_lookup_engine);
++#endif
+ }
+
+--- /usr/tmp/clean/avahi-0.6.28/avahi-core/browse.h 2010-08-26 01:51:38.983153000 +0100
++++ avahi-0.6.28/avahi-core/browse.h 2011-01-21 09:33:14.663164775 +0000
+@@ -50,6 +50,12 @@
+ unsigned n_lookups;
+
+ AvahiSRBLookup *root_lookup;
++
++#ifdef HAVE_BONJOUR
++ DNSServiceRef client;
++ AvahiWatch *watch;
++#endif
++
+ };
+
+ void avahi_browser_cleanup(AvahiServer *server);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/13-remove-debug-trap.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,179 @@
+Source: Desktop consolidation
+Upstream promotion status: This patch will be reworked because now (in Userland) the
+ Solaris studio is used instead of gcc.
+
+--- /usr/tmp/clean/avahi-0.6.22/avahi-python/Makefile.am Mon Sep 24 22:11:29 2007
++++ avahi-0.6.22/avahi-python/Makefile.am Tue Dec 18 08:48:40 2007
+@@ -19,9 +19,6 @@
+
+ AM_CFLAGS=-I$(top_srcdir)
+
+-# This cool debug trap works on i386/gcc only
+-AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
+-
+ EXTRA_DIST = \
+ avahi-bookmarks.in
+
+--- /usr/tmp/clean/avahi-0.6.12/avahi-utils/Makefile.am 2005-11-16 22:36:56.000000000 +0000
++++ avahi-0.6.12/avahi-utils/Makefile.am 2006-08-22 09:34:47.937663000 +0100
+@@ -19,9 +19,6 @@
+
+ AM_CFLAGS=-I$(top_srcdir)
+
+-# This cool debug trap works on i386/gcc only
+-AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
+-
+ if HAVE_DBUS
+
+ bin_PROGRAMS = avahi-browse avahi-resolve avahi-publish avahi-set-host-name
+--- /usr/tmp/clean/avahi-0.6.12/avahi-common/Makefile.am 2006-04-24 22:01:32.000000000 +0100
++++ avahi-0.6.12/avahi-common/Makefile.am 2006-08-22 09:35:52.013532000 +0100
+@@ -19,9 +19,6 @@
+
+ AM_CFLAGS=-I$(top_srcdir)
+
+-# This cool debug trap works on i386/gcc only
+-AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
+-
+ avahi_commonincludedir=$(includedir)/avahi-common
+
+ avahi_commoninclude_HEADERS = \
+--- /usr/tmp/clean/avahi-0.6.12/avahi-client/Makefile.am 2006-03-01 23:27:45.000000000 +0000
++++ avahi-0.6.12/avahi-client/Makefile.am 2006-08-22 09:37:26.320792000 +0100
+@@ -19,9 +19,6 @@
+
+ AM_CFLAGS=-I$(top_srcdir)
+
+-# This cool debug trap works on i386/gcc only
+-AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
+-
+ if HAVE_DBUS
+
+ avahi_clientincludedir=$(includedir)/avahi-client
+--- /usr/tmp/clean/avahi-0.6.12/avahi-compat-libdns_sd/Makefile.am 2005-11-25 01:19:31.000000000 +0000
++++ avahi-0.6.12/avahi-compat-libdns_sd/Makefile.am 2006-08-22 09:38:37.573278000 +0100
+@@ -19,9 +19,6 @@
+
+ AM_CFLAGS=-I$(top_srcdir)
+
+-# This cool debug trap works on i386/gcc only
+-AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
+-
+ if HAVE_DBUS
+ if ENABLE_COMPAT_LIBDNS_SD
+
+--- /usr/tmp/clean/avahi-0.6.12/avahi-daemon/Makefile.am 2006-03-01 23:51:22.000000000 +0000
++++ avahi-0.6.12/avahi-daemon/Makefile.am 2006-08-22 09:40:28.041468000 +0100
+@@ -19,9 +19,6 @@
+
+ AM_CFLAGS=-I$(top_srcdir)
+
+-# This cool debug trap works on i386/gcc only
+-AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
+-
+ if HAVE_LIBDAEMON
+ if HAVE_XML
+
+--- /usr/tmp/clean/avahi-0.6.12/avahi-glib/Makefile.am 2005-10-19 01:10:29.000000000 +0100
++++ avahi-0.6.12/avahi-glib/Makefile.am 2006-08-22 09:41:03.362768000 +0100
+@@ -19,9 +19,6 @@
+
+ AM_CFLAGS=-I$(top_srcdir)
+
+-# This cool debug trap works on i386/gcc only
+-AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
+-
+ if HAVE_GLIB
+
+ avahiglibincludedir=$(includedir)/avahi-glib
+--- /usr/tmp/clean/avahi-0.6.12/avahi-compat-howl/Makefile.am 2005-11-25 01:19:31.000000000 +0000
++++ avahi-0.6.12/avahi-compat-howl/Makefile.am 2006-08-22 09:41:49.972884000 +0100
+@@ -19,9 +19,6 @@
+
+ AM_CFLAGS=-I$(top_srcdir)
+
+-# This cool debug trap works on i386/gcc only
+-AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
+-
+ SUBDIRS = . samples
+
+ if HAVE_DBUS
+--- /usr/tmp/clean/avahi-0.6.12/avahi-compat-howl/samples/Makefile.am 2005-11-20 15:02:38.000000000 +0000
++++ avahi-0.6.12/avahi-compat-howl/samples/Makefile.am 2006-08-22 09:42:37.591297000 +0100
+@@ -19,9 +19,6 @@
+
+ AM_CFLAGS=-I$(top_srcdir) -I$(top_srcdir)/avahi-compat-howl/include
+
+-# This cool debug trap works on i386/gcc only
+-AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
+-
+ if HAVE_DBUS
+ if ENABLE_COMPAT_HOWL
+
+--- /usr/tmp/clean/avahi-0.6.23/avahi-core/Makefile.am 2008-06-23 23:22:38.000000000 +0100
++++ avahi-0.6.23/avahi-core/Makefile.am 2008-06-25 14:06:43.632972000 +0100
+@@ -19,9 +19,6 @@
+
+ AM_CFLAGS=-I$(top_srcdir)
+
+-# This cool debug trap works on i386/gcc only
+-AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
+-
+ avahiincludedir=$(includedir)/avahi-core
+
+ avahiinclude_HEADERS = \
+@@ -41,14 +38,12 @@
+ conformance-test \
+ avahi-reflector \
+ dns-test \
+- dns-spin-test \
+ timeeventq-test \
+ hashmap-test \
+ querier-test \
+ update-test
+
+ TESTS = \
+- dns-spin-test \
+ dns-test \
+ hashmap-test
+ endif
+@@ -147,11 +142,6 @@
+ dns_test_CFLAGS = $(AM_CFLAGS)
+ dns_test_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la
+
+-dns_spin_test_SOURCES = \
+- dns-spin-test.c
+-dns_spin_test_CFLAGS = $(AM_CFLAGS)
+-dns_spin_test_LDADD = $(AM_LDADD) libavahi-core.la
+-
+ timeeventq_test_SOURCES = \
+ timeeventq-test.c \
+ timeeventq.h timeeventq.c \
++--- /usr/tmp/clean/avahi-0.6.28/avahi-discover-standalone/Makefile.am 2010-08-
+26 01:51:39.004153001 +0100
+++++ avahi-0.6.28/avahi-discover-standalone/Makefile.am 2011-01-20 15:30:29.0964
+42076 +0000
++@@ -20,9 +20,6 @@
++ interfaces = \
++ avahi-discover.ui
++
++-# This cool debug trap works on i386/gcc only
++-AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
++-
++ if HAVE_GTK2OR3
++ if HAVE_GLIB
++ bin_PROGRAMS = \
++--- /usr/tmp/clean/avahi-0.6.28/avahi-dnsconfd/Makefile.am 2010-08-26 01:51
+:39.005153001 +0100
+++++ avahi-0.6.28/avahi-dnsconfd/Makefile.am 2011-01-20 15:32:22.328800575 +0
+000
++@@ -28,9 +28,6 @@
++ -DAVAHI_SOCKET=\"$(avahi_socket)\" \
++ -DAVAHI_DNSCONF_SCRIPT=\"$(pkgsysconfdir)/avahi-dnsconfd.action\"
++
++-# This cool debug trap works on i386/gcc only
++-AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
++-
++ sbin_PROGRAMS = avahi-dnsconfd
++
++ avahi_dnsconfd_SOURCES = main.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/14-desktop.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,48 @@
+Source: Desktop consolidation
+Patch Comment: type:bug bugid:122 bugster:6795230 state:upstream
+
+--- avahi-0.6.23/avahi-python/avahi-discover/avahi-discover.desktop.in.in.orig 2009-01-20 09:09:20.444848513 +0900
++++ avahi-0.6.23/avahi-python/avahi-discover/avahi-discover.desktop.in.in 2009-01-20 09:09:33.278310858 +0900
+@@ -0,0 +1,12 @@
++[Desktop Entry]
++Version=1.0
++Encoding=UTF-8
++_Name=Avahi Zeroconf Browser
++_Comment=Browse for Zeroconf services available on your network
++Exec=@bindir@/avahi-discover
++Terminal=false
++Type=Application
++Icon=network-wired
++Categories=GNOME;Application;System;
++StartupNotify=false
++GenericName=
+--- avahi-0.6.23/avahi-ui/bvnc.desktop.in.in.orig 2009-01-20 08:52:19.688074614 +0900
++++ avahi-0.6.23/avahi-ui/bvnc.desktop.in.in 2009-01-20 08:52:14.570970389 +0900
+@@ -0,0 +1,12 @@
++[Desktop Entry]
++Version=1.0
++Encoding=UTF-8
++_Name=Avahi VNC Server Browser
++_Comment=Browse for Zeroconf-enabled VNC Servers
++Exec=@bindir@/bvnc
++Terminal=false
++Type=Application
++Icon=network-wired
++Categories=GNOME;Application;Network;
++StartupNotify=false
++GenericName=
+--- avahi-0.6.23/avahi-ui/bssh.desktop.in.in.orig 2009-01-20 08:51:46.718876131 +0900
++++ avahi-0.6.23/avahi-ui/bssh.desktop.in.in 2009-01-20 08:51:35.330721384 +0900
+@@ -0,0 +1,12 @@
++[Desktop Entry]
++Version=1.0
++Encoding=UTF-8
++_Name=Avahi SSH Server Browser
++_Comment=Browse for Zeroconf-enabled SSH Servers
++Exec=@bindir@/bssh
++Terminal=false
++Type=Application
++Icon=network-wired
++Categories=GNOME;Application;Network;
++StartupNotify=false
++GenericName=
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/15-secure-dbus-dest.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,17 @@
+Source: Desktop consolidation
+Patch Comment: type:branding bugid:263 bugster:6794539
+
+--- /usr/tmp/clean/avahi-0.6.28/avahi-daemon/avahi-dbus.conf.in 2010-08-26 01:51:38.996153000 +0100
++++ avahi-0.6.28/avahi-daemon/avahi-dbus.conf.in 2011-01-20 15:42:21.930449367 +0000
+@@ -20,11 +20,6 @@
+ send_interface="org.freedesktop.Avahi.Server" send_member="SetHostName"/>
+ </policy>
+
+- <!-- Allow everything, including access to SetHostName to users of the group "@AVAHI_PRIV_ACCESS_GROUP@" -->
+- <policy group="@AVAHI_PRIV_ACCESS_GROUP@">
+- <allow send_destination="org.freedesktop.Avahi"/>
+- <allow receive_sender="org.freedesktop.Avahi"/>
+- </policy>
+ <policy user="root">
+ <allow send_destination="org.freedesktop.Avahi"/>
+ <allow receive_sender="org.freedesktop.Avahi"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/16-memory-crash.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,26 @@
+Source: Desktop consolidation
+Patch Comment: type:bug bugster:6804284
+
+--- avahi-0.6.30/avahi-utils/stdb.c.orig 2011-06-08 10:28:42.651208301 +0100
++++ avahi-0.6.30/avahi-utils/stdb.c 2011-06-08 10:32:25.750739026 +0100
+@@ -136,8 +136,9 @@
+
+ avahi_free(buffer);
+ buffer = avahi_strndup(data.dptr, data.dsize);
++#ifdef HAVE_GDBM
+ free(data.dptr);
+-
++#endif
+ return buffer;
+
+ fail:
+@@ -199,7 +200,9 @@
+ return NULL;
+
+ enum_key = avahi_strndup(key.dptr, key.dsize);
++#ifdef HAVE_GDBM
+ free(key.dptr);
++#endif
+
+ if (!strchr(enum_key, '['))
+ return enum_key;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/17-compat.with_newer_automake.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,46 @@
+Source: http://git.0pointer.net/avahi.git/commit/?id=e98b5b0df0b6241a59a39cda8f78c7d8d4622881
+
+From e98b5b0df0b6241a59a39cda8f78c7d8d4622881 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <[email protected]>
+Date: Tue, 14 Feb 2012 21:43:03 +0000
+Subject: build-sys: compatibility with newer automake
+
+Place the service type database in $(prefix)/lib/avahi instead of
+$(libdir)/avahi.
+---
+(limited to 'service-type-database/Makefile.am')
+
+diff --git a/service-type-database/Makefile.am b/service-type-database/Makefile.am
+index fa1bd40..1e9e70f 100644
+--- a/service-type-database/Makefile.am
++++ b/service-type-database/Makefile.am
+@@ -17,14 +17,16 @@
+
+ EXTRA_DIST=build-db.in service-types
+
++pkglibdatadir=$(prefix)/lib/avahi
++
+ pkgdata_DATA=service-types
+-pkglib_DATA=
++pkglibdata_DATA=
+
+ if HAVE_PYTHON
+ if HAVE_GDBM
+
+ noinst_SCRIPTS=build-db
+-pkglib_DATA+=service-types.db
++pkglibdata_DATA+=service-types.db
+
+ build-db: build-db.in
+ $(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \
+@@ -41,7 +43,7 @@ endif
+ if HAVE_DBM
+
+ noinst_SCRIPTS=build-db
+-pkglib_DATA+=service-types.db.pag service-types.db.dir
++pkglibdata_DATA+=service-types.db.pag service-types.db.dir
+
+ build-db: build-db.in
+ $(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \
+--
+cgit v0.9.2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/avahi/patches/18-gir-scanner-flags.patch Tue Oct 27 07:12:09 2015 -0700
@@ -0,0 +1,14 @@
+Source: In-house
+note: Recent release of the gir-scanner deprecate --strip-prefix
+
+--- avahi-0.6.30/avahi-gobject/Makefile.am.orig 2015-04-07 16:28:55.538156105 -0700
++++ avahi-0.6.30/avahi-gobject/Makefile.am 2015-04-07 16:30:01.099587139 -0700
+@@ -122,7 +122,7 @@
+ Avahi_0_6_gir_CFLAGS = $(libavahi_gobject_la_CFLAGS)
+ Avahi_0_6_gir_LIBS = $(lib_LTLIBRARIES)
+ Avahi_0_6_gir_FILES = $(addprefix $(srcdir)/, $(CORE_SOURCES)) $(BUILT_SOURCES)
+-Avahi_0_6_gir_SCANNERFLAGS = --strip-prefix=Ga
++Avahi_0_6_gir_SCANNERFLAGS = --identifier-prefix=Ga
+ INTROSPECTION_GIRS += Avahi-0.6.gir
+ INTROSPECTION_INSTALL_GIRS = AvahiCore-0.6.gir $(INTROSPECTION_GIRS)
+