Difference between revisions of "RPM spec File Contents"

From CDOT Wiki
Jump to: navigation, search
(Created page with 'Category:SBR600Category:RPM These are the basic sections of a spec file: * Basic Sections # preamble - basic metadata # %prep - commands to prepare the package for build…')
(No difference)

Revision as of 08:25, 13 January 2011

These are the basic sections of a spec file:

  • Basic Sections
  1. preamble - basic metadata
  2.  %prep - commands to prepare the package for building
  3.  %build - commands to build the package
  4.  %install - commands to install the built files
  5.  %check - commands to check/test the built files (optional, often not included)
  6.  %clean - commands to clean up the disk space
  7.  %files - list of files to be included in the pacakge
  8.  %changelog - record of the package's change-history
  • Scriptlets
    •  %pre -- run before installation
    •  %post -- run after installation
    •  %preun -- run before uninstallation
    •  %postun -- run after uninstallation
      • Note that during upgrade, the installation of the new package is considered to happen before the removal of the old package.
  • Macros
    •  %{_tmppath}
    •  %{buildroot}
    •  %{_bindir}
    •  %{_datadir}
    •  %{_mandir}
    •  %{_smp_flags}
    •  %setup
    •  %configure
    •  %makeinstall