diff -Nru mysql-5.5-5.5.23/debian/changelog mysql-5.5-5.5.23/debian/changelog
--- mysql-5.5-5.5.23/debian/changelog	2012-05-08 05:59:19.000000000 +0100
+++ mysql-5.5-5.5.23/debian/changelog	2012-05-19 21:01:10.000000000 +0100
@@ -1,3 +1,13 @@
+mysql-5.5 (5.5.23-3) UNRELEASED; urgency=low
+
+  * Changes to prevent certain failures to build from scratch
+    when building against MySQL 5.5 (Closes: #590905)
+    - Patched mysql_config so that it no longer mandates -lssl -lcrypto
+    - Added libwrap0-dev as a dependency of libmysqld-dev, libmysqld-pic
+    - Added libaio-dev as a Linux dependency of libmysqld-dev, libmysqld-pic
+
+ -- Nicholas Bamber <nicholas@periapt.co.uk>  Fri, 18 May 2012 17:36:37 +0100
+
 mysql-5.5 (5.5.23-2) unstable; urgency=low
 
   * Stopped overriding the -j build parameter (Closes: #512964)
diff -Nru mysql-5.5-5.5.23/debian/control mysql-5.5-5.5.23/debian/control
--- mysql-5.5-5.5.23/debian/control	2012-05-07 19:33:17.000000000 +0100
+++ mysql-5.5-5.5.23/debian/control	2012-05-19 21:01:35.000000000 +0100
@@ -27,7 +27,8 @@
 Package: libmysqld-pic
 Architecture: any
 Section: libdevel
-Depends: libmysqlclient-dev (>= ${source:Version}), ${misc:Depends}
+Depends: libmysqlclient-dev (>= ${source:Version}), ${misc:Depends},
+ libwrap0-dev (>= 7.6-8.3), libaio-dev[linux-any]
 Description: PIC version of MySQL embedded server development files
  MySQL is a fast, stable and true multi-user, multi-threaded SQL database
  server. SQL (Structured Query Language) is the most popular database query
@@ -39,7 +40,8 @@
 Package: libmysqld-dev
 Architecture: any
 Section: libdevel
-Depends: libmysqlclient-dev (>= ${source:Version}), ${misc:Depends}
+Depends: libmysqlclient-dev (>= ${source:Version}), ${misc:Depends},
+ libwrap0-dev (>= 7.6-8.3), libaio-dev[linux-any]
 Description: MySQL embedded database development files
  MySQL is a fast, stable and true multi-user, multi-threaded SQL database
  server. SQL (Structured Query Language) is the most popular database query
diff -Nru mysql-5.5-5.5.23/debian/rules mysql-5.5-5.5.23/debian/rules
--- mysql-5.5-5.5.23/debian/rules	2012-05-05 13:32:23.000000000 +0100
+++ mysql-5.5-5.5.23/debian/rules	2012-05-20 16:03:23.000000000 +0100
@@ -93,6 +93,7 @@
 		-DCMAKE_VERBOSE_MAKEFILE=ON \
 		$(FORCE_FPIC) \
 		-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock \
+	       	-DCMAKE_VERBOSE_MAKEFILE=yes \
 	       	-DMYSQL_USER=mysql \
 		-DWITH_LIBWRAP=ON \
 		-DWITH_READLINE=OFF \
@@ -177,6 +178,13 @@
 	install -m 0644 -o root -g root $(BUILDDIR_PIC)/libmysqld/libmysqld.a $(TMP)/usr/lib/mysql/libmysqld_pic.a
 	# mysql_config won't report the -fPIC, so give libmysqld-pic users a way to get their flags
 	install -m 0755 -o root -g root $(BUILDDIR_PIC)/scripts/mysql_config $(TMP)/usr/bin/mysql_config_pic
+	# As per #590905 we don't want mysql_config saying -lssl -lcrypto
+	# because those libraries are overkill for most packages.
+	# Patch mysql_config inline rather using quilt because the latter
+	# seems not to work, though I don't know why. Comments hold
+	# but not the real bit of work. The source is scripts/mysql_config.sh.
+	# That needs to be fixed, but a quick fix is needed for now.
+	sed -i -e's/-lssl -lcrypto //' $(TMP)/usr/bin/mysql_config*
 	# mysql-client
 	install -m 0755 debian/additions/mysqlreport $(TMP)/usr/bin/
 	install -m 0755 debian/additions/innotop/innotop $(TMP)/usr/bin/
