Bug#588528: cyrus-sasl2: fails to build with glibc 2.12 due to getsubopt conflict

Colin Watson cjwatson at ubuntu.com
Fri Jul 9 11:38:21 UTC 2010


Package: cyrus-sasl2
Version: 2.1.23.dfsg1-5
Severity: important
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch maverick

cyrus-sasl2 fails to build in Ubuntu:

  https://bugs.launchpad.net/ubuntu/maverick/+source/cyrus-sasl2/+bug/600180

The getsubopt function was added to POSIX 2008, and glibc followed suit
in 2.12 (not yet in Debian).  The specialised config.h that was added to
Debian some time back to build the examples is too simplistic, and
doesn't take the results of autoconf into account, so it fails to notice
that getsubopt is provided by system headers and provides a conflicting
version.

The following patch fixes this by adding .. to the sample include path
so that we use the autoconf-generated config.h instead during package
build, and installing that config.h as an example for use when building
externally.

  * Remove unhelpful debian/sample/config.h, stop copying it in, and arrange
    to have the autoconf-generated config.h included when building sample/
    instead.

diff -u cyrus-sasl2-2.1.23.dfsg1/debian/rules cyrus-sasl2-2.1.23.dfsg1/debian/rules
--- cyrus-sasl2-2.1.23.dfsg1/debian/rules
+++ cyrus-sasl2-2.1.23.dfsg1/debian/rules
@@ -106,8 +106,7 @@
 	rm -f build-stamp build-indep-stamp build-arch-stamp
 
 	rm -f $(CURDIR)/sample/sample-client \
-		$(CURDIR)/sample/sample-server \
-		$(CURDIR)/sample/config.h
+		$(CURDIR)/sample/sample-server
 	[ ! -f Makefile ] || $(MAKE) distclean
 	$(AUTOTOOLS_REVERSE)
 	(cd saslauthd && $(AUTOTOOLS_REVERSE) && cd ..)
@@ -170,9 +169,6 @@
 	       --with-configdir=/etc/sasl:/usr/lib/sasl2 \
 	       --sysconfdir=/etc \
 	       --with-devrandom=/dev/urandom
-	       
-	# Prepare to build sample-{client,server}
-	cp -f $(CURDIR)/debian/sample/config.h $(CURDIR)/sample/config.h
 
 	# Record the build-time settings for later reference
 	echo 'To build this package, configure was called as follows:' \
diff -u cyrus-sasl2-2.1.23.dfsg1/debian/libsasl2-dev.examples cyrus-sasl2-2.1.23.dfsg1/debian/libsasl2-dev.examples
--- cyrus-sasl2-2.1.23.dfsg1/debian/libsasl2-dev.examples
+++ cyrus-sasl2-2.1.23.dfsg1/debian/libsasl2-dev.examples
@@ -3 +3 @@
-debian/sample/*.h
+config.h
diff -u cyrus-sasl2-2.1.23.dfsg1/debian/sample/Makefile cyrus-sasl2-2.1.23.dfsg1/debian/sample/Makefile
--- cyrus-sasl2-2.1.23.dfsg1/debian/sample/Makefile
+++ cyrus-sasl2-2.1.23.dfsg1/debian/sample/Makefile
@@ -9,4 +9,4 @@
-	gcc -g -o sample-server sample-server.c -I. -I$(INCDIR) -L$(LIBDIR) -lsasl2
+	gcc -g -o sample-server sample-server.c -I. -I.. -I$(INCDIR) -L$(LIBDIR) -lsasl2
 
 sample-client: sample-client.c
-	gcc -g -o sample-client sample-client.c -I. -I$(INCDIR) -L$(LIBDIR) -lsasl2
+	gcc -g -o sample-client sample-client.c -I. -I.. -I$(INCDIR) -L$(LIBDIR) -lsasl2
reverted:
--- cyrus-sasl2-2.1.23.dfsg1/debian/sample/config.h
+++ cyrus-sasl2-2.1.23.dfsg1.orig/debian/sample/config.h
@@ -1,11 +0,0 @@
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#define PACKAGE "sasl-sample-pkg"
-#define VERSION "0.0"
-#define PLUGINDIR "/usr/lib/sasl2"
-#define EXIT_FAILURE 1
-#define EXIT_SUCCESS 0
-#define HIER_DELIMITER '/'
-

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]





More information about the Pkg-cyrus-sasl2-debian-devel mailing list