_arch x86_64
_os linux
_host x86_64-redhat-linux-gnu
_host_alias x86_64-redhat-linux-gnu%{nil}
_host_cpu x86_64
_host_os linux
_host_vendor redhat
_vendor redhat
_prefix /usr
_exec_prefix %{_prefix}
_sysconfdir /etc
_usr /usr
_usrsrc %{_usr}/src
_userunitdir /usr/lib/systemd/user
_var /var
_bindir %{_exec_prefix}/bin
_binfmtdir /usr/lib/binfmt.d
_rundir /run
_lib lib64
_libdir %{_prefix}/lib64
_libexecdir %{_exec_prefix}/libexec
_configure ./configure
_datadir %{_datarootdir}
_datarootdir %{_prefix}/share
_defaultdocdir %{_prefix}/share/doc
_defaultlicensedir %{_datadir}/licenses
_docdir_fmt %%{NAME}-%%{VERSION}
_dbpath %{_var}/lib/rpm
_tmppath %{_var}/tmp
_build %{_host}
_build_alias %{_host_alias}
_build_arch x86_64
_build_cpu %{_host_cpu}
_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
_build_os %{_host_os}
_build_vendor %{_host_vendor}
_buildshell /bin/sh
_rpmconfigdir %{getconfdir}
_rpmfilename %{_build_name_fmt}
_rpmlock_path %{_dbpath}/.rpm.lock
_topdir %{getenv:HOME}/rpmbuild
_builddir %{_topdir}/BUILD
_buildrootdir %{_topdir}/BUILDROOT
_sourcedir %{_topdir}/SOURCES
_specdir %{_topdir}/SPECS
_rpmdir %{_topdir}/RPMS
_srcrpmdir %{_topdir}/SRPMS
buildroot %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}
rpm spec
source 可以是压缩包和文件, 可以有多个source0,source1,source2
源文件有压缩包时通过%prep %setup 进行加压,多个压缩包需要设置多个%setup 或者手动设置解压过程