How to build an RPM in CentOS 7
Step 1 Install the required packages
#yum install -y rpm-build make tree
Step 2 Create the required directories
#mkdir -p /project/my-rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp}
# tree /project/my-rpm

Step 3 Create the SPEC file
# touch /project/my-rpm/SPECS/my-rpm.spec
# vi /project/my-rpm/SPECS/my-rpm.spec
Name: m-rpm
Version: 1.0
Release: 0
Summary: RPM to show how to create an RPM.
Group: RPM
License: GPL
URL: http://linuxvaults.com
Vendor: LinuxVaults
Source: %{name}-%{version}.tar.gz
Prefix: %{_prefix}
Packager:
BuildRoot: %{_tmppath}/%{name}-root
%description
%prep
%build
make
%install
%clean
%files