rpmbuild of Mysql 5.1.58 on SLES 11

A relative newbie to SuSE, here is how I managed to build MySQL on SLES 11, in a VMWare Fusion virtual machine on a Mac:

  • Download the SLES/SuSE 11 source rpm from mysql.com
  • Extract the MySQL tarball and spec file from the source rpm
    • $ rpm -ivh MySQL-community-5.1.58-1.sles11.src.rpm
      (The above stored the output in /usr/src/packages)
  • $ cd /usr/src/packages/SPECS/
  • $ rpmbuild -ba --define 'community 1' mysql-5.1.58.sles11.spec
    (Complained about needing gperg, readline-devel and zlib-devel)
  • $ sudo zypper addrepo http://download.opensuse.org/distribution/11.4/repo/oss/ oss
  • $ sudo zypper addrepo http://download.opensuse.org/distribution/11.4/repo/non-oss/ non-oss
  • $ sudo zypper in gperf
  • $ sudo zypper in readline-devel
  • $ sudo zypper in zlib-devel
  • $ rpmbuild -ba --define 'community 1' mysql-5.1.58.sles11.spec