Bug #35424 binary dist built with make_binary_distribution still expects "source" paths
Submitted: 19 Mar 2008 4:45 Modified: 21 Apr 2008 12:36
Reporter: Vicki Brown Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Packaging Severity:S3 (Non-critical)
Version:5.0.51a OS:Any
Assigned to: Kent Boortz CPU Architecture:Any

[19 Mar 2008 4:45] Vicki Brown
Description:
I built the dist from source. I then ran make_binary_distribution to create a binary dist tgz file which I installed. Then the headaches started.

My attempt to start mysqld died with
080318 21:28:44  mysqld started
080318 21:28:44 [ERROR] Can't find messagefile '/usr/local/share/mysql/english/errmsg.sys'
080318 21:28:44 [ERROR] Aborting

well, duh, it's not IN /usr/local/share/mysql; it's in /usr/local/mysql/share/mysql

I made a symlink. Similarly, I've had to make symlinks to /usr/local/include/mysql and /usr/local/lib/mysql.
The binary installation directory layout matches what's described in the INSTALL_SOURCE file but the programs are expecting a source dist layout!

How to repeat:
make
make test
scripts/make_binary_distribution
cd /usr/local
tar xzf /usr/local/src/mysql/mysql-5.0.51a-darwin9.2.0-powerpc.tar.gz
...
follow instructions in ./mysql/INSTALL_BINARY
...
bin/mysqld_safe --user=mysql &
...Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/goto.pid
080318 21:24:40  mysqld ended

view data/host.err

Suggested fix:
install the source dist into the same directory structure under /usr/local/mysql as the binary distros! That's such a good idea anyway -- everything all together in one place. If people wannt to rearrange where things go, well, they have the sourc.e, They can change the paths. But the default should be /usr/local/mysql.
[19 Mar 2008 5:15] Kent Boortz
It is not a "source dist path" but "make_binary_distribution"
is expecting configure and make to be run a specific way,
undocumented and too restrictive. Until this bug is solved
you can create the package like

  % cd <top-dir-of-source>
  % ./configure --prefix=/usr/local/mysql ....
  % make
  % make install DESTDIR=`pwd`
  % mv usr/local/mysql mysql-5.0.51-<platform-name>
  % tar -czf mysql-5.0.51-<platform-name>.tar.gz mysql-5.0.51-<platform-name>

Alternatively, you can create the expected installation
paths and use the script

  % prefix=/usr/local/mysql

  % conf_opt="--prefix=$prefix"
  % conf_opt="$conf_opt --localstatedir=$prefix/data"
  % conf_opt="$conf_opt --libexecdir=$prefix/bin"
  % conf_opt="$conf_opt --enable-thread-safe-client"
  % conf_opt="$conf_opt --enable-local-infile"
  % ./configure $conf_opt

  % make_opt="pkgincludedir=$prefix/include"
  % make_opt="$make_opt pkgdatadir=$prefix/share"
  % make_opt="$make_opt pkgsuppdir=$prefix/support-files"
  % make_opt="$make_opt mandir=$prefix/man"
  % make_opt="$make_opt infodir=$prefix/info"
  % make $make_opt

  % scripts/make_binary_distribution
[21 Apr 2008 12:36] Kent Boortz
I actually misunderstood the reporters problem. Reverifying I can't repeat
this problem. Note the "--prefix" option needed to configure. Verified not
to be a bug, like

  % ./configure --prefix=/usr/local/mysql
  % make
  % scripts/make_binary_distribution
  % sudo bash
  > cd /usr/local
  > tar -xzf .../mysql-5.0.60-linux-x86_64.tar.gz
  > ln -s mysql-5.0.60-linux-x86_64 mysql
  > cd mysql
  > scripts/mysql_install_db
  > bin/mysqld_safe &

note that "mysqld_safe" assumes current directory to be in the
directory above "bin" and "data"

  http://dev.mysql.com/doc/refman/5.0/en/mysqld-safe.html

From the error messages in the "hostname.err" file I realized
I had not created the initial database

  http://dev.mysql.com/doc/refman/5.0/en/mysql-install-db.html

The different layouts of the package content, is documented at

  http://dev.mysql.com/doc/refman/5.0/en/installation-layouts.html