Install rpmbuild
Sudo yum install rpm-build
Configurations of common users
/Home/you/rpmbuild/assume that the rpm directory is to be built
Let's talk about the usage of rpmbuild. Here is an example:
Echo "% _ topdir/home/you/rpmbuild"> ~ /. Rpmmacros
Mkdir-p/home/you/rpmbuild/{SPECS, BUILD, SRPMS, RPMS, SOURCES}
The configuration in/usr/lib/rpm/macros allows you to change the specific build configuration item. If an error occurs, you can modify this [differences between the old and new versions]
Build
V build from source code
Rpmbuild-ta memcached-1.x.x.tar.gz
V Mysql build example
Sudo yum install gcc-c ++ gperf ncurses-devel perl readline-devel time zlib-devel libaio-devel bison cmake
First, make sure that the mysql dependent database is available
For convenience
Copy mysql-5.6.15.tar.gz to/home/you/rpmbuild/SOURCES
Copy mysql-5.6.15/support-files/mysql.5.6.15.sepc to/home/you/rpmbuild/SPECS
Rpm-bb/home/you/rpmbuild/SPECS/mysql.5.6.15.sepc
After that, you can view the created mysql rpm file package in/home/you/rpmbuild/RPMS.
If you want to customize it, you can modify it for mysql.5.6.15.sepc and re-build it.
Reference
RPM packaging software for http://www.ibm.com/developerworks/cn/linux/management/package/rpm/part1/, part 1