ports/189757: Enable building CUPS 1.7.x with native Avahi backend

Raivo Hool raivo.hool at gmail.com
Tue May 13 10:10:00 UTC 2014


>Number:         189757
>Category:       ports
>Synopsis:       Enable building CUPS 1.7.x with native Avahi backend
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 13 10:10:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Raivo Hool
>Release:        10.0-STABLE
>Organization:
>Environment:
FreeBSD buzibusz.lehma.com 10.0-STABLE FreeBSD 10.0-STABLE #0 r265351: Mon May  5 14:53:23 EEST 2014     root at buzibusz.lan:/usr/obj/usr/src/sys/BUZIBUSZ  amd64<
>Description:
The print/cups-base port has been marked as BROKEN if built against Avahi since version 1.4. (The Makefile even helpfully points the user to http://www.avahi.org/ticket/303 which states that the problem exists with CUPS version 1.4 and that a fix is in the making.) Since version 1.6, however, there exists native Avahi support in CUPS and there is really no point in marking the port broken and including all kinds of compatibility headers that are no longer of any use whatsoever. Building CUPS 1.7 directly against Avahi works well and without any need for the avahi-compat-libdns_sd headers. I tested the setup on my system and came up with the following patch that incidentally also checks whether one or the other mDNS backend was selected and activates the pkg-plist magic accordingly. (Note how the dependency on avahi-libdns has been replaced with a dependency on avahi-app, as the configure script checks for the presence of libavahi-client.so, installed by net/avahi-app.) I also took th
 e liberty of explicitly disabling Avahi when mDNSResponder is selected, and vice versa.

>How-To-Repeat:
Try to rebuild print/cups-base with the option "Zeroconf support via Avahi" enabled.
>Fix:
Remove legacy cruft from the Makefile, enable building with native Avahi. A working patch is attached.

Patch attached with submission follows:

--- Makefile.orig	2014-05-13 10:43:30.488345573 +0300
+++ Makefile	2014-05-13 12:51:23.497632104 +0300
@@ -155,17 +155,15 @@
 IGNORE=			You must select one and only one option to build for Zeroconf
 .endif
 LIB_DEPENDS+=		libdns_sd.so:${PORTSDIR}/net/mDNSResponder
-CONFIGURE_ARGS+=	--with-dnssd-includes=${LOCALBASE}/include
-PLIST_SUB+=		WITH_MDNSRESPONDER=""
+CONFIGURE_ARGS+=	--with-dnssd-includes=${LOCALBASE}/include --disable-avahi
+PLIST_SUB+=		DNSSD="" MDNS=""
 .elif !defined(CUPS_CLIENT) && !defined(CUPS_IMAGE) && ${PORT_OPTIONS:MAVAHI}
-CONFIGURE_ARGS+=	--enable-dnssd \
-			--with-dnssd-libs=${LOCALBASE}/lib/
-LIB_DEPENDS+=		libdns_sd.so:${PORTSDIR}/net/avahi-libdns
-CONFIGURE_ARGS+=	--with-dnssd-includes=${LOCALBASE}/include/avahi-compat-libdns_sd/
-BROKEN=			missing function, see http://www.avahi.org/ticket/303
+CONFIGURE_ARGS+=	--enable-avahi --disable-dnssd
+LIB_DEPENDS+=		libavahi-client.so:${PORTSDIR}/net/avahi-app
+PLIST_SUB+=		DNSSD="" MDNS="@comment "
 .else
 CONFIGURE_ARGS+=	--disable-dnssd
-PLIST_SUB+=		WITH_MDNSRESPONDER="@comment "
+PLIST_SUB+=		DNSSD="@comment " MDNS="@comment "
 .endif
 
 .if !defined(CUPS_CLIENT) && !defined(CUPS_IMAGE) && ${PORT_OPTIONS:MPAM}
--- pkg-plist.orig	2014-05-13 10:43:35.894162185 +0300
+++ pkg-plist	2014-05-13 12:47:01.661646623 +0300
@@ -83,8 +83,8 @@
 libexec/cups/backend/snmp
 libexec/cups/backend/socket
 libexec/cups/backend/usb
-%%WITH_MDNSRESPONDER%%libexec/cups/backend/dnssd
-%%WITH_MDNSRESPONDER%%libexec/cups/backend/mdns
+%%DNSSD%%libexec/cups/backend/dnssd
+%%MDNS%%libexec/cups/backend/mdns
 libexec/cups/cgi-bin/admin.cgi
 libexec/cups/cgi-bin/classes.cgi
 libexec/cups/cgi-bin/help.cgi


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-ports-bugs mailing list