RPM SPEC常用路径以及宏变量

发布时间: 更新时间: 总字数:218 阅读时间:1m 作者: IP上海 分享 网址
专栏文章
  1. 常用 Linux RPM 下载地址和 RPM 下载方法
  2. Linux rpmbuild 使用介绍及 OpenStack rpm 打包示例
  3. RPM SPEC常用路径以及宏变量(当前)
  4. Linux 搭建本地 YUM 源
  5. OpenStack rpm-packaging 介绍使用
  6. CentOS 基于mock构建RPM包
  7. 使用Coprs构建并发布RPM包
  8. Ruby1.9.3 rpm安装包制作
  9. Ruby2.3.1 rpm安装包制作
  10. Ruby2.4.x rpm安装包制作
  11. Haproxy rpm 制作方法
  12. 解决执行yum报Segmentation fault错误问题

Redhat/CentOS 采用 RPM 格式的安装文件包,在制作RPM时,SPEC文件中有很多路径、宏变量等,下面详细介绍它们的用法和作用。

Valid RPM Macros

Here are the definitions for some common specfile macros as they are defined on Fedora Core 11 (rpm-4.7.0-1.fc11). For definitions of more macros, examine the output of “rpm –showrc “. To see the expanded definition of a macro use the command rpm –eval “%{macro}” . Note that neither command will take into account macros defined inside specfiles, but both will take into account macros defined in your ~/.rpmmacros file and macros defined on the command line. Keep in mind that some of these macros may evaluate differently on older Fedora or EPEL releases.

查阅rpm常用路径

rpm --showrc>/usr/rpmShowrc.txt

Macros mimicking autoconf variables

%{_sysconfdir}        /etc
%{_prefix}            /usr
%{_exec_prefix}       %{_prefix}
%{_bindir}            %{_exec_prefix}/bin
%{_lib}               lib (lib64 on 64bit systems)
%{_libdir}            %{_exec_prefix}/%{_lib}
%{_libexecdir}        %{_exec_prefix}/libexec
%{_sbindir}           %{_exec_prefix}/sbin
%{_sharedstatedir}    /var/lib
%{_datadir}           %{_prefix}/share
%{_includedir}        %{_prefix}/include
%{_oldincludedir}     /usr/include
%{_infodir}           /usr/share/info
%{_mandir}            /usr/share/man
%{_localstatedir}     /var
%{_initddir}          %{_sysconfdir}/rc.d/init.d

RPM directory macros

%{_topdir}            %{getenv:HOME}/rpmbuild
%{_builddir}          %{_topdir}/BUILD
%{_rpmdir}            %{_topdir}/RPMS
%{_sourcedir}         %{_topdir}/SOURCES
%{_specdir}           %{_topdir}/SPECS
%{_srcrpmdir}         %{_topdir}/SRPMS
%{_buildrootdir}      %{_topdir}/BUILDROOT
Home Archives Categories Tags Statistics
本文总阅读量 次 本站总访问量 次 本站总访客数