几个主要的宏
%{_builddir} 对应/root/rpmbuild/BUILD/
%{_buildrootdir} 对应/root/rpmbuild/BUILDROOT/
#dist是一个宏.el7,ver,rel都是版本号
Name:
Version: %{ver}
Release: %{rel}%{?dist}
Group:
License: BSD and LGPLv2 and GPLv2 Summary:
Source:
%prep
%setup -q -n %{srcname}
rpmbuild 依据Source指定的源代码压缩文件,将其解压到 /root/rpmbuild/BUILD目录中, -q忽略提示, -n指定自定义目录(默认为name-ver-release)
#主要是进行相关程序的编译,支持shell命令
%build
#需要将文件放到指定的地方(先是虚拟位置),在rpm实际安装时,会放到对应的目录)
#需要先创建该虚拟目录,再将需要的二进制或库拷贝到该目录
%install
#对rpm包的描述
%description
Provid yusur proviate storage acceration engine
#需要打包的文件(其位置是相对于BUILDROOT的位置)
%files
以上关键字段填充后,可在/root/rpmbuild/RPMS中生成RPM包
可参考: