前回のlibmysqlclient.so.12の続きになります。
その後、色々と調査してみると、「MySQL-server-4.0.25-0vl0.ppc.rpm」をインストールする事で、「/usr/share/mysql/MySQL-shared-compat.spec」に、「MySQL-shared-compat.spec」が作成されている事が判明しました。
また、独自で色々と調べてみて「MySQL-shared-compat.spec」で、「MySQL-shared-compat-5.0.15-0.ppc.rpm」が作成される所まで判明しました。
下記に作成方法を記述します。
[作成方法]
①.「MySQL-shared-compat.spec」の編集から始まります。
[変更前]
%define version4 4.0.25
%define version3 3.23.58
Name: MySQL-shared-compat
Packager: Lenz Grimmer
Vendor: MySQL AB
License: GPL
Group: Applications/Databases
Autoreqprov: on
Version: %{version4}
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Obsoletes: MySQL-shared, mysql-shared
Provides: MySQL-shared
Summary: MySQL shared libraries for MySQL %{version4} and %{version3}
Source0: MySQL-shared-%{version4}-0.%{_arch}.rpm
Source1: MySQL-shared-%{version3}-1.%{_arch}.rpm
# No need to include the RPMs once more - they can be downloaded seperately
# if you want to rebuild this package
NoSource: 0
NoSource: 1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This package includes the shared libraries for both MySQL %{version3} and
MySQL %{version4}. Install this package instead of “MySQL-shared”, if you
have applications installed that are dynamically linked against MySQL
3.23.xx but you want to upgrade to MySQL 4.0.xx without breaking the library
dependencies.
%install
[ “$RPM_BUILD_ROOT” != “/” ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
mkdir -p $RPM_BUILD_ROOT
cd $RPM_BUILD_ROOT
rpm2cpio %{SOURCE0} | cpio -iv --make-directories
rpm2cpio %{SOURCE1} | cpio -iv --make-directories
%clean
[ “$RPM_BUILD_ROOT” != “/” ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
%files
%defattr(-, root, root)
%{_libdir}/libmysqlclient*
[変更後]
%define version5 5.0.15
%define version4 4.0.25
Name: MySQL-shared-compat
Packager: Lenz Grimmer
Vendor: MySQL AB
License: GPL
Group: Applications/Databases
Autoreqprov: on
Version: %{version5}
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Obsoletes: MySQL-shared, mysql-shared
Provides: MySQL-shared
Summary: MySQL shared libraries for MySQL %{version5} and %{version4}
Source0: MySQL-shared-%{version5}-0.%{_arch}.rpm
Source1: MySQL-shared-%{version4}-0.%{_arch}.rpm
# No need to include the RPMs once more - they can be downloaded seperately
# if you want to rebuild this package
NoSource: 0
NoSource: 1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This package includes the shared libraries for both MySQL %{version4} and
MySQL %{version5}. Install this package instead of “MySQL-shared”, if you
have applications installed that are dynamically linked against MySQL
4.0.xx but you want to upgrade to MySQL 5.0.xx without breaking the library
dependencies.
%install
[ “$RPM_BUILD_ROOT” != “/” ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
mkdir -p $RPM_BUILD_ROOT
cd $RPM_BUILD_ROOT
rpm2cpio %{SOURCE0} | cpio -iv --make-directories
rpm2cpio %{SOURCE1} | cpio -iv --make-directories
%clean
[ “$RPM_BUILD_ROOT” != “/” ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
%files
%defattr(-, root, root)
%{_libdir}/libmysqlclient*
②.「rpm/SOURCE/」に、「MySQL-shared-4.0.25-0.ppc.rpm」,「MySQL-shared-5.0.15-0.ppc.rpm」を格納しときます。
③.rpm -ba MySQL-shared-compat.spec >MySQL-shared-compat.log &
数分ほどで、「MySQL-shared-compat-5.0.15-0.ppc.rpm」が完成されます。
[注意事項]
・②の「MySQL-shared-4.0.25-0.ppc.rpm」,「MySQL-shared-5.0.15-0.ppc.rpm」のソフト名は、「Source0: MySQL-shared-%{version5}-0.%{_arch}.rpm」,「Source1: MySQL-shared-%{version4}-0.%{_arch}.rpm」に合わせる必要があります。