RPM Spec File Reference

RPM Spec File Reference

Spec File Reference

Tags

  • Name: is used to define the name of the software being packaged.
  • Version: defines the version of the software being packaged.
  • Release: can be thought of as the package’s version.
  • %description describe the packages intended use.
  • Summary: is used to define a one-line description of the packaged software.
  • Copyright: is used to define the copyright terms applicable to the software being packaged.
  • Distribution: is used to define a group of packages, of which this package is a part.
  • Icon: is used to name a file containing an icon representing the packaged software.
  • Vendor: is used to define the name of the entity that is responsible for packaging the software.
  • URL: is used to define a URL that can be used to obtain additional information about the packaged software.
  • Group: is used to group packages together by the types of functionality they provide.
  • Packager: is used to hold the name and contact information for the person or persons who built the package.
  • Requires: is used to alert RPM to the fact that the package needs to have certain capabilities available in order to operate properly.
  • Serial: is used to define a serial number for a package. This is only necessary if RPM is unable to determine the ordering of a package’s version numbers.
  • Conflicts: is used to alert RPM to the fact that the package is not compatible with other packages.
  • AutoReqProv: is used to control the automatic dependency processing performed when the package is being built.
    • To disable automatic dependency processing, add the following line: AutoReqProv: no
  • ExcludeArch: is used to direct RPM to ensure that the package does not attempt to build on the excluded architecture(s).
  • ExclusiveArch: is used to direct RPM to ensure the package is only built on the specified architecture(s).
  • ExcludeOs: is used to direct RPM to ensure that the package does not attempt to build on the excluded operating system(s).
  • ExclusiveOs: is used to denote which operating system(s) should only be be permitted to build the package.
  • Prefix: is used to define part of the path RPM will use when installing the package’s files.
  • BuildArch: is used to define the architecture of the intended install target.
  • BuildRoot: is used to define an alternate build root, where the software will be installed during the build process.
  • Source: is used to define the filename of the sources to be packaged.
  • NoSource: is used to alert RPM to the fact that one or more source files should be excluded from the source package file.
  • Patch: is used to define the name of a patch file to be applied to the package’s sources.
  • NoPatch: is used to alert RPM to the fact that one or more patch files should be excluded from the source package file.
  • %files list indicates to RPM which files on the build system are to be packaged.

Scripts

  • %prep is executed first during an rpm build (creating an rpm).
  • %build is the second scriptlet executed during an rpm build.
  • %install does whatever is necessary to actually install the newly built software.
  • %clean as the name implies, is used to clean up the software’s build directory tree.
  • %pre executes just before the package is to be installed.
  • %post executes after the package has been installed.
  • %preun executes just before the package is to be erased.
  • %postun executes after the package has been erased.
  • %verifyscript executes whenever the installed package is verified by RPM’s verification command.

Macros

  • %setup is used to unpack the original sources, in preparation for the build.
  • %patch as its name implies, is used to apply patches to the unpacked sources.

File-related Directives

  • %doc flags the filename(s) that follow, as being documentation.
  • %config is used to flag the specified file as being a configuration file.
  • %attr permits finer control over three key file attributes: mode, uid, gid
  • %verify can control which of 9 file attributes are to be checked when an RPM verification is done.
  • %docdir is used to add a directory to the list of directories that will contain documentation.
  • %dir RPM will package only the directory itself.
  • %package is used to permit the creation of more than one package per spec file and can appear at any point in the spec file.

Conditionals

  • %ifarch is used to begin a section of the spec file that is architecture-specific.
  • %ifnarch is used in a similar fashion to %ifarch, except that the logic is reversed.
  • %ifos is used to control RPM’s spec file processing based on the build system’s operating system.
  • %ifnos is the logical complement to %ifos
  • %else is placed between a %if conditional of some persuasion, and a %endif.
  • %endif is used to end a conditional block of spec file statements.

转载于:https://my.oschina.net/u/158589/blog/76553

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/110329.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 什么是pisa测试_PISA测试真相:哪些学校代表中国考取第一名

    什么是pisa测试_PISA测试真相:哪些学校代表中国考取第一名原标题:PISA测试真相:哪些学校代表中国考取第一名在北京金融行业工作的王鑫如,去年女儿出生后就开始规划送她去哪里接受教育,留在北京,还是随着一个工作机会去香港,或者全家移民国外?她说,将来女儿读大学很大可能会去国外,但基础教育阶段有没有必要出去?中国的基础教育竞争力到底强不强?大学有各种国际排行榜单,不同国家的中小学质量要如何对比?12月3日公布的第七轮国际学生评估结果(Programmefor…

    2022年5月3日
    54
  • IntelliJ IDEA卸载与安装

    IntelliJ IDEA卸载与安装一、卸载(首次安装可跳过)导出配置运行卸载程序删除缓存&配置&插件卸载完成二、下载安装(一)官网:官网:http://www.jetbrains.com/idea/download/#section=windows官方文档:http://www.jetbrains.com/help/idea/meet-inte…

    2022年6月15日
    50
  • 标准模板库(STL)学习指南之map映射

    标准模板库(STL)学习指南之map映射

    2022年3月13日
    46
  • java编程常用软件

    java编程常用软件有大神曾说“给我一个记事本,我还你一个项目”,作为小白的我,以前也对这句话深信不疑,但当我参加人生第一次编程考试的时候,我发现我用记事本码代码的速度实在是太慢了,一样的代码,别人用eclipseIED编写用了5分钟,而我至少半小时。虽然有点强行甩锅IDE的嫌疑,但有款好的编程软件,就会让你打代码速度更快,让你的头发掉的更少……废话讲完了,以下是我推荐的几款编程常用软件:…

    2022年6月14日
    38
  • 49 使用linux内核源码里的矩阵键盘驱动<GPIO driven matrix keypad support>

    49 使用linux内核源码里的矩阵键盘驱动<GPIO driven matrix keypad support>这个设备驱动适用于,矩阵键盘的每行,每列都是接到一个IO口,行线接的IO口有中断功能.需要在linux内核配置里选上相关的配置。在内核源码目录下:makemenuconfigARCH=armCROSS_COMPILE=arm-linux-gnueabihf-DeviceDrivers—>Inputdevicesupport—>

    2022年5月6日
    141
  • 扒站工具整站_抓包知乎

    扒站工具整站_抓包知乎前两节说了利用浏览器或者借助仿站工具来扒站,这些方法适用于一般的web站点,对于某些不能在PC端打开的站点就比较困难了。如果只是在后台检验客户端来限制用户浏览,比如你用PC访问的时候自动转到PC页面或

    2022年8月6日
    5

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号