[debian-mysql] Bug#611965: mysql-5.1: MySQL should export its configured source tree as a binary package.

Clint Byrum clint at ubuntu.com
Fri Feb 4 08:04:18 UTC 2011


Package: mysql-5.1
Version: 5.1.54-1
Severity: wishlist
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu natty ubuntu-patch



*** /tmp/tmpPSJm2C
In Ubuntu, the attached patch was applied to achieve the following:


  * export configured source dir as binary package. -- needed for some
    plugins to build.


Basically some plugins need access to MySQL internals. Specifically
HandlerSocket:

https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL

And XtraBackup:

http://www.percona.com/docs/wiki/percona-xtrabackup:start

These simply cannot build without the full source tree because mysql's
headers are not built for export.

The patch creates a bin package that places a tarball of the configured
source in /usr/src/mysql, which can then be consumed by those plugins'
build.

As an example, I've prepared the handlersocket plugin for Ubuntu here:

https://code.launchpad.net/~clint-fewbar/+junk/handlersocket/

Please consider including this soon, otherwise it may not be possible
to include these plugins in Ubuntu.

Thanks for considering the patch.


-- System Information:
Debian Release: squeeze/sid
  APT prefers natty-updates
  APT policy: (500, 'natty-updates'), (500, 'natty-security'), (500, 'natty')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-1-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
-------------- next part --------------
=== modified file 'debian/changelog'

=== modified file 'debian/control'
--- debian/control	2011-01-26 09:19:25 +0000
+++ debian/control	2011-02-02 19:48:39 +0000
@@ -180,3 +180,14 @@
  ease of use.
  .
  This package includes the MySQL testsuite.
+
+Package: mysql-source-5.1
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: MySQL source
+ MySQL is a fast, stable, and true multi-user, multi-threaded SQL database
+ server.  SQL (Structured Query Language) is the most popular database query
+ language in the world. The main goals of MySQL are speed, robustness and
+ ease of use.
+ .
+ This package includes the MySQL source code as configured before building.

=== added file 'debian/mysql-source-5.1.files'
--- debian/mysql-source-5.1.files	1970-01-01 00:00:00 +0000
+++ debian/mysql-source-5.1.files	2011-02-02 19:44:09 +0000
@@ -0,0 +1 @@
+usr/src/mysql/*

=== modified file 'debian/rules'
--- debian/rules	2010-08-20 10:12:48 +0000
+++ debian/rules	2011-02-02 21:59:52 +0000
@@ -21,6 +21,8 @@
 DEB_UPSTREAM_VERSION ?= $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//')
 DEB_UPSTREAM_VERSION_MAJOR_MINOR := $(shell echo $(DEB_UPSTREAM_VERSION) | sed -r -n 's/^([0-9]+\.[0-9]+).*/\1/p')
 
+EXPORTED_SOURCE_TARBALL = debian/mysql-source-5.1.tar.gz
+
 DISTRIBUTION = $(shell lsb_release -i -s)
 
 MAKE_J = -j$(shell if [ -f /proc/cpuinfo ] ; then grep -c processor.* /proc/cpuinfo ; else echo 1 ; fi)
@@ -127,6 +129,9 @@
 build-stamp: configure
 	@echo "RULES.$@"
 	dh_testdir
+	[ -f $(EXPORTED_SOURCE_TARBALL) ] || tar -zcf $(EXPORTED_SOURCE_TARBALL) \
+      --exclude=debian . \
+      --transform="s,^\./,mysql-5.1/,"
 
 	cd $(builddir) && $(MAKE) $(MAKE_J)
 
@@ -184,6 +189,7 @@
 	rm -rf $(BUILDDIR) $(BUILDDIR_PIC)
 
 	debconf-updatepo
+	rm -f $(EXPORTED_SOURCE_TARBALL)
 	dh_clean -v
 
 
@@ -276,6 +282,8 @@
 	# install Apport hook
 	install -D -m 644 debian/mysql-server-5.1.py $(TMP)/usr/share/apport/package-hooks/source_mysql-dfsg-5.1.py
 
+	install -D -m 0644 $(EXPORTED_SOURCE_TARBALL) $(TMP)/usr/src/mysql/`basename $(EXPORTED_SOURCE_TARBALL)`
+
 	dh_movefiles
 	
 # Build architecture-independent files here.



More information about the pkg-mysql-maint mailing list