Bug 191619

Summary: [patch] print/cups-base links uses avahi if present even when MDNSRESPONDER option is selected
Product: Ports & Packages Reporter: Don Lewis <truckman>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Some People CC: marino
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to cups-base/Makefile none

Description Don Lewis freebsd_committer freebsd_triage 2014-07-04 23:51:35 UTC
Created attachment 144418 [details]
patch to cups-base/Makefile

cups-base-1.7.3
print/cups-base/Makefile r360086

If the avahi port is installed and cups-base is configured to with the MDNSRESPONDER option set, cups-base will use avahi.

===>  License GPLv2 accepted by the user
===>  Found saved configuration for cups-base-1.7.3
===>   cups-base-1.7.3 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by cups-base-1.7.3 for building
===>  Extracting for cups-base-1.7.3
=> SHA256 Checksum OK for cups-1.7.3-source.tar.bz2.
===>  Patching for cups-base-1.7.3
===>  Applying FreeBSD patches for cups-base-1.7.3
===>   cups-base-1.7.3 depends on package: cups-client>=1.7.3 - found
===>   cups-base-1.7.3 depends on package: cups-image>=1.7.3 - found
===>   cups-base-1.7.3 depends on executable: gmake - found
===>   cups-base-1.7.3 depends on executable: pkgconf - found
===>   cups-base-1.7.3 depends on executable: gtk-update-icon-cache - found
===>   cups-base-1.7.3 depends on shared library: libcups.so - found (/usr/local/lib/libcups.so.2) - found (/usr/local/lib/libcups.so.2)
===>   cups-base-1.7.3 depends on shared library: libcupsimage.so - found (/usr/local/lib/libcupsimage.so.2) - found (/usr/local/lib/libcupsimage.so.2)
===>   cups-base-1.7.3 depends on shared library: libdns_sd.so - found (/usr/local/lib/libdns_sd.so.1) - found (/usr/local/lib/libdns_sd.so.1)

[** libdns_sd.so.1 is the library for MDNSRESPONDER **]

===>   cups-base-1.7.3 depends on shared library: libdbus-1.so - found (/usr/local/lib/libdbus-1.so.3.8.5) - found (/usr/local/lib/libdbus-1.so.3.8.5)
===>   cups-base-1.7.3 depends on shared library: libatk-1.0.so - found (/usr/local/lib/libatk-1.0.so.0) - found (/usr/local/lib/libatk-1.0.so.0)
===>   cups-base-1.7.3 depends on shared library: libgdk_pixbuf-2.0.so - found (/usr/local/lib/libgdk_pixbuf-2.0.so.0.2800.2) - found (/usr/local/lib/libgdk_pixbuf-2.0.so.0.2800.2)
===>   cups-base-1.7.3 depends on shared library: libglib-2.0.so - found (/usr/local/lib/libglib-2.0.so.0) - found (/usr/local/lib/libglib-2.0.so.0)
===>   cups-base-1.7.3 depends on shared library: libpcre.so - found (/usr/local/lib/libpcre.so.3) - found (/usr/local/lib/libpcre.so.3)
===>   cups-base-1.7.3 depends on shared library: libpango-1.0.so - found (/usr/local/lib/libpango-1.0.so.0.3400.1) - found (/usr/local/lib/libpango-1.0.so.0.3400.1)
===>  Configuring for cups-base-1.7.3

[SNIP]

checking for Avahi... yes


In config.log:

  $ ./configure --localstatedir=/var --disable-gssapi --with-cups-user=cups --with-cups-group=cups --with-system-groups=wheel --with-docdir=/usr/local/share/doc/cups --with-menudir=/usr/local/share/applications --with-domainsocket=/var/run/cups.sock --with-cachedir=/var/db/cups --with-pam-module=unix --enable-ssl --with-printcap=/usr/local/etc/printcap --disable-gnutls --enable-openssl --with-dnssd-includes=/usr/local/include --disable-pam --enable-dbus --enable-libusb --with-icondir=/usr/local/share/icons --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ --build=i386-portbld-freebsd11.0

I see --with-dnssd-includes=/usr/local/include, which looks correct, but
further down:

DEFS='-DHAVE_CONFIG_H'
DNSSDLIBS='-L/usr/local/lib -lavahi-common -lavahi-client  '
DNSSD_BACKEND='dnssd'
DSO='$(CC)'

The proof is in the pudding:

# ldd work/stage/usr/local/bin/lpq
work/stage/usr/local/bin/lpq:
	libcups.so.2 => /usr/local/lib/libcups.so.2 (0x881da000)
	libssl.so.7 => /usr/lib/libssl.so.7 (0x8823d000)
	libcrypto.so.7 => /lib/libcrypto.so.7 (0x88c00000)
	libavahi-common.so.3 => /usr/local/lib/libavahi-common.so.3 (0x88298000)
	libavahi-client.so.3 => /usr/local/lib/libavahi-client.so.3 (0x882a3000)
	libz.so.6 => /lib/libz.so.6 (0x882b2000)
	libm.so.5 => /lib/libm.so.5 (0x882c7000)
	libcrypt.so.5 => /lib/libcrypt.so.5 (0x882ef000)
	libthr.so.3 => /lib/libthr.so.3 (0x88313000)
	libc.so.7 => /lib/libc.so.7 (0x8806d000)
	libintl.so.9 => /usr/local/lib/libintl.so.9 (0x88335000)
	libdbus-1.so.3 => /usr/local/lib/libdbus-1.so.3 (0x8833e000)

lpq is linked against libavahi-common.so.3 and libavahi-client.so.3, not libdns_sd.so.1!



After applying the attached patch, libavahi* is not referenced and lpq is linked against libdns_sd.so.1 as expected.

# ldd work/stage/usr/local/bin/lpq
work/stage/usr/local/bin/lpq:
	libcups.so.2 => /usr/local/lib/libcups.so.2 (0x881da000)
	libssl.so.7 => /usr/lib/libssl.so.7 (0x8823d000)
	libcrypto.so.7 => /lib/libcrypto.so.7 (0x88c00000)
	libdns_sd.so => /usr/local/lib/libdns_sd.so (0x88298000)
	libz.so.6 => /lib/libz.so.6 (0x882a0000)
	libm.so.5 => /lib/libm.so.5 (0x882b5000)
	libcrypt.so.5 => /lib/libcrypt.so.5 (0x882dd000)
	libthr.so.3 => /lib/libthr.so.3 (0x88301000)
	libc.so.7 => /lib/libc.so.7 (0x8806d000)
Comment 1 John Marino freebsd_committer freebsd_triage 2014-07-26 07:21:30 UTC
note that port isn't maintained, but attached fix looks simple enough...
Comment 2 commit-hook freebsd_committer freebsd_triage 2014-07-28 19:23:05 UTC
A commit references this bug:

Author: marino
Date: Mon Jul 28 19:22:24 UTC 2014
New revision: 363233
URL: http://svnweb.freebsd.org/changeset/ports/363233

Log:
  print/cups-base: Don't use avahi when MDNSRESPONDER option is selected

  PR:		191619
  Submitted by:	Don Lewis
  Approval:	Not required; port is unmaintained

Changes:
  head/print/cups-base/Makefile
Comment 3 John Marino freebsd_committer freebsd_triage 2014-07-28 19:23:33 UTC
Thanks Don!