Package: mysql-dfsg-5.0
Version: 5.0.18-4
Severity: important
Tags: patch
Hi,
mysql-dfsg-5.0 FTBFS on hurd-i386 due to the following issues:
- The check for /proc/1 in debian/rules' configure target fails as there
is no /proc on the Hurd. The Build-Depends say procps | hurd, so I
suggest not doing that check on hurd-i386.
- The configure check on how to run ps to get mysqld's $PID does not
work on the Hurd, as the PPID is prepended with a - for login shells,
thus making grep look for -bash, which it complains as an invalid
argument. Filtering out '-' from the ps output makes this work fine.
- There are some occurances of PATH_MAX in the code which are used
unconditionally. As there is no system limit on path names on GNU,
PATH_MAX is not defined. A work-around is to define PATH_MAX in the
source to some arbitrary value.
The attached patch fixes all these issues, changing debian/rules and
introducing two more dpatches. I verified it still builds fine on
GNU/Linux.
An alternative solution for the first two would be to hardcode the
FIND_PROC command on Linux similar to how it is done on e.g. FreeBSD.
This would also remove the Build-Depends on procps I guess.
cheers,
Michael
--
Michael Banck
Debian Developer
[EMAIL PROTECTED]
http://www.advogato.org/person/mbanck/diary.html
diff -u mysql-dfsg-5.0-5.0.18/debian/patches/00list
mysql-dfsg-5.0-5.0.18/debian/patches/00list
--- mysql-dfsg-5.0-5.0.18/debian/patches/00list
+++ mysql-dfsg-5.0-5.0.18/debian/patches/00list
@@ -19,0 +20,2 @@
+86_PATH_MAX.dpatch
+87_ps_Hurd.dpatch
diff -u mysql-dfsg-5.0-5.0.18/debian/rules mysql-dfsg-5.0-5.0.18/debian/rules
--- mysql-dfsg-5.0-5.0.18/debian/rules
+++ mysql-dfsg-5.0-5.0.18/debian/rules
@@ -10,6 +10,7 @@
TMP=$(PWD)/debian/tmp/
ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+ARCH_OS = $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEBVERSION = $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }' |
sed 's/^.*-//' )
@@ -44,7 +45,9 @@
@echo "RULES.configure-stamp"
dh_testdir
+ifneq ($(ARCH_OS),hurd)
if [ ! -d /proc/1 ]; then echo "/proc IS NEEDED" 1>&2; exit 1; fi
+endif
sh -c 'PATH=$${MYSQL_BUILD_PATH:-"/bin:/usr/bin"} \
CC=$${MYSQL_BUILD_CC:-gcc} \
only in patch2:
unchanged:
--- mysql-dfsg-5.0-5.0.18.orig/debian/patches/86_PATH_MAX.dpatch
+++ mysql-dfsg-5.0-5.0.18/debian/patches/86_PATH_MAX.dpatch
@@ -0,0 +1,112 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 86_PATH_MAX.dpatch by <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Patch to define PATH_MAX on systems which do not.
+
[EMAIL PROTECTED]@
+
+--- mysql-dfsg-5.0-5.0.18.orig/ndb/src/common/logger/FileLogHandler.cpp
++++ mysql-dfsg-5.0-5.0.18/ndb/src/common/logger/FileLogHandler.cpp
+@@ -18,6 +18,10 @@
+ #include <FileLogHandler.hpp>
+ #include <File.hpp>
+
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
++
+ //
+ // PUBLIC
+ //
+--- mysql-dfsg-5.0-5.0.18.orig/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
++++ mysql-dfsg-5.0-5.0.18/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
+@@ -64,6 +64,10 @@
+ #define WRITEBUFFERSIZE 262144
+ #endif
+
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
++
+ const char *actionName[] = {
+ "open",
+ "close",
+--- mysql-dfsg-5.0-5.0.18.orig/ndb/src/kernel/blocks/ndbfs/Filename.cpp
++++ mysql-dfsg-5.0-5.0.18/ndb/src/kernel/blocks/ndbfs/Filename.cpp
+@@ -25,6 +25,10 @@
+
+ #include <signaldata/FsOpenReq.hpp>
+
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
++
+ static const char* fileExtension[] = {
+ ".Data",
+ ".FragLog",
+--- mysql-dfsg-5.0-5.0.18.orig/ndb/src/kernel/blocks/ndbfs/Filename.hpp
++++ mysql-dfsg-5.0-5.0.18/ndb/src/kernel/blocks/ndbfs/Filename.hpp
+@@ -17,6 +17,10 @@
+ #ifndef Filename_H
+ #define Filename_H
+
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
++
+ //===========================================================================
+ //
+ // .DESCRIPTION
+--- mysql-dfsg-5.0-5.0.18.orig/ndb/src/kernel/vm/Configuration.cpp
++++ mysql-dfsg-5.0-5.0.18/ndb/src/kernel/vm/Configuration.cpp
+@@ -39,6 +39,10 @@
+ #include <LogLevel.hpp>
+ #include <NdbSleep.h>
+
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
++
+ extern "C" {
+ void ndbSetOwnVersion();
+ }
+--- mysql-dfsg-5.0-5.0.18.orig/ndb/src/cw/cpcd/CPCD.cpp
++++ mysql-dfsg-5.0-5.0.18/ndb/src/cw/cpcd/CPCD.cpp
+@@ -24,6 +24,10 @@
+
+ #include "common.hpp"
+
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
++
+ extern const ParserRow<CPCDAPISession> commands[];
+
+
+--- mysql-dfsg-5.0-5.0.18.orig/ndb/src/cw/cpcd/Process.cpp
++++ mysql-dfsg-5.0-5.0.18/ndb/src/cw/cpcd/Process.cpp
+@@ -27,6 +27,10 @@
+ #include <sys/resource.h>
+ #endif
+
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
++
+ void
+ CPCD::Process::print(FILE * f){
+ fprintf(f, "define process\n");
+--- mysql-dfsg-5.0-5.0.18.orig/ndb/tools/restore/Restore.hpp
++++ mysql-dfsg-5.0-5.0.18/ndb/tools/restore/Restore.hpp
+@@ -26,6 +26,10 @@
+ #include <ndb_version.h>
+ #include <version.h>
+
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
++
+ static const char * delimiter = ";"; // Delimiter in file dump
+
+ const int FileNameLenC = 256;
only in patch2:
unchanged:
--- mysql-dfsg-5.0-5.0.18.orig/debian/patches/87_ps_Hurd.dpatch
+++ mysql-dfsg-5.0-5.0.18/debian/patches/87_ps_Hurd.dpatch
@@ -0,0 +1,30 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 87_ps_hurd.dpatch by <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Patch to make the configure check work with the Hurd's ps.
+
[EMAIL PROTECTED]@
+
+--- mysql-dfsg-5.0-5.0.18/configure.in.orig 2006-01-14 20:38:43.000000000
+0100
++++ mysql-dfsg-5.0-5.0.18/configure.in 2006-01-14 20:40:00.000000000 +0100
+@@ -434,7 +434,7 @@
+ AC_MSG_CHECKING("how to check if pid exists")
+ PS=$ac_cv_path_PS
+ # Linux style
+-if $PS p $$ 2> /dev/null | grep $0 > /dev/null
++if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
+ then
+ FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
+ # Solaris
+--- mysql-dfsg-5.0-5.0.18/configure.orig 2006-01-14 20:56:37.000000000
+0100
++++ mysql-dfsg-5.0-5.0.18/configure 2006-01-14 20:56:51.000000000 +0100
+@@ -21975,7 +21930,7 @@
+ echo $ECHO_N "checking \"how to check if pid exists\"... $ECHO_C" >&6
+ PS=$ac_cv_path_PS
+ # Linux style
+-if $PS p $$ 2> /dev/null | grep $0 > /dev/null
++if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
+ then
+ FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
+ # Solaris