home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / misc / src / rpm / docs / buildroot next >
Text File  |  1997-09-17  |  1KB  |  67 lines

  1. BUILD ROOT
  2. ==========
  3.  
  4. The build root is very similar to Root: (which will be deprecated
  5. soon).  By using Buildroot: in your spec file you are indicating
  6. that your package can be built (installed into and packaged from)
  7. a user-definable directory.  This helps package building by normal
  8. users.
  9.  
  10. The Spec File
  11. -------------
  12.  
  13. Simply use
  14.  
  15.   Buildroot: <dir>
  16.  
  17. in your spec file.  The acutal buildroot used by RPM during the
  18. build will be available to you (and your %prep, %build, and %install
  19. sections) as the environment variable RPM_BUILD_ROOT.  You must
  20. make sure that the files for the package are installed into the
  21. proper buildroot.  As with Root:, the files listed in the %files
  22. section should *not* contain the buildroot.  For example, the
  23. following hypothetical spec file:
  24.  
  25.   Name: foo
  26.   ...
  27.   Root: /tmp
  28.   
  29.   %prep
  30.   ...
  31.   
  32.   %build
  33.   ...
  34.   
  35.   %install
  36.   install -m755 fooprog /tmp/usr/bin/fooprog
  37.   
  38.   %files
  39.   /usr/bin/fooprog
  40.  
  41. would be changed to:
  42.  
  43.   Name: foo
  44.   ...
  45.   Buildroot: /tmp
  46.   
  47.   %prep
  48.   ...
  49.   
  50.   %build
  51.   ...
  52.   
  53.   %install
  54.   install -m755 fooprog $RPM_BUILD_ROOT/usr/bin/fooprog
  55.   
  56.   %files
  57.   /usr/bin/fooprog
  58.  
  59. Building With a Build Root
  60. --------------------------
  61.  
  62. RPM will use the buildroot listed in the spec file as the default
  63. buildroot.  There are two ways to override this.  First, you can
  64. have "buildroot: <dir>" in your rpmrc.  Second, you can override
  65. the default, and any entry in an rpmrc by using "--buildroot <dir>"
  66. on the RPM command line.
  67.