Help building MySQL RPM

Mário Gamito gamito at gmail.com
Sun Mar 4 11:09:27 UTC 2007


Hi,

I'm tring to build a MyQSL RPM that gets installed in /usr/local/mysql.

But the MySQL's subdirectories (and mysql also) always gets instaled in 
/usr/local and not /usr/local/mysql

My mysql.spec follows my signature (i know it's a clumsy spec, but i'm 
giving my first steps in RPM creation, so please, excuse me the 
lameliness of this question).

Any help would be appreciated.

Warm Regards,
Mário Gamito
--
Summary: MySQL
Name: mysql
Version: 5.0.33
Release: 2
Source0: %{name}-%{version}.tar.gz
License: GNU/GPL
Source: 
http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.0/mysql-5.0.33.tar.gz
Group: Applications/Databases
BuildRoot: /usr/local/mysql

%description
MySQL is probably the most world wide relational databae used in web 
development.

%prep
%setup -q

%build
./configure
make

%install

mkdir -p ${RPM_BUILD_ROOT}/
mkdir -p ${RPM_BUILD_ROOT}/bin
mkdir -p ${RPM_BUILD_ROOT}/usr/local/mysql/lib
mkdir -p ${RPM_BUILD_ROOT}/usr/local/mysql/var
mkdir -p ${RPM_BUILD_ROOT}/usr/local/mysql/include
mkdir -p ${RPM_BUILD_ROOT}/usr/local/mysql/info
mkdir -p ${RPM_BUILD_ROOT}/usr/local/mysql/libexec
mkdir -p ${RPM_BUILD_ROOT}/usr/local/mysql/man
mkdir -p ${RPM_BUILD_ROOT}/usr/local/mysql/mysql-test
mkdir -p ${RPM_BUILD_ROOT}/usr/local/mysql/share
mkdir -p ${RPM_BUILD_ROOT}/usr/local/mysql/sql-bench

make install

scripts/mysql_install_db
groupadd mysql
useradd -g mysql -s /bin/false mysql
cd /usr/local/mysql/var
chown -R mysql.mysql .
find . -follow -type d -print | xargs chown mysql.mysql
chmod -R go-rwx .
find . -follow -type d -print | xargs chmod go-rwx
cd /usr/src/redhat/BUILD/mysql-5.0.33
cp support-files/mysql.server /etc/init.d/mysqld
cd /etc/init.d
chmod +x mysqld
/etc/init.d/mysqld start
chkconfig --level 35 mysqld on
/usr/local/mysql/bin/mysqladmin -u root password secret

%clean
rm -rf ${RPM_BUILD_ROOT}

%files
%defattr(-,root,root)
/usr/local/mysql/bin
/usr/local/mysql/lib
/usr/local/mysql/var
/usr/local/mysql/include
/usr/local/mysql/info
/usr/local/mysql/libexec
/usr/local/mysql/man
/usr/local/mysql/mysql-test
/usr/local/mysql/share
/usr/local/mysql/sql-bench




More information about the fedora-extras-list mailing list