1, first install Rpmbuild
#Yum Install rpm-build gcc gcc-c++ cmake bison ncurses-devel zlib - y
2, download the official source package (tar.gz format), and unzip
#wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.15.tar.gz
#tar-XVF mysql-5.6.15.tar.gz
3. New RPM Folder
#CD mysql-5.6.15
#mkdir rpm
4. Copy the prepared spec file to the new RPM folder and start rebuilding the RPM package, and the resulting RPM package is placed under the ~/rpmbuild/rpms/x86_64 folder.
#RPMBUILD-BB Mysql.spec (will generate Rpmbuild folder in the current user home directory)
---------------------------------------------------------------------------------------------------------------
If you want to view the original spec file , use the following methods:
1, first install Rpmbuild
#Yum Install rpm-build gcc gcc-c++ cmake bison ncurses-devel zlib- y
2. Download the official source code RPM package
wget http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-5.6.26-1.el6.src.rpm
3. Download the above downloaded RPM package to the home directory, and then perform
#Rpmbuild ~ will be home directory generation Rpmbuil and the following build BuildRoot RPMS SOURCES SPECS Srpms sub-empty directory structure
#RPM-IVH mysql-5.6.26-1.el6.src.rpm
#LS rpmbuild - R is shown below:
Rpmbuild:build buildroot RPMS SOURCES SPECS SRPMS
Rpmbuild/build:
Rpmbuild/buildroot:
Rpmbuild/rpms:
Rpmbuild/sources:
Mysql-5.6.26.tar.gz
Rpmbuild/specs:
Mysql.spec
Rpmbuild/srpms:
4. Start modifying the generated Mysql.spec file
#vim Rpmbuild/mysql.spec
The main modification of the build full release section of the installation of MySQL required compilation parameters.
5. Build a custom generated RPM package based on the Mysql.spec file, and the resulting RPM package is placed under the ~/rpmbuild/rpms/x86_64 folder
#rpmbuild-BB Mysql.spec
------------------------------------------
Build a custom MySQL RPM package based on the official source RPM package under Linux