File Explorer

/proc/thread-self/root/usr/share/doc/rpm

This explorer reads the filesystem of the server it runs on, so /workspace/user isn't present here. Browsing and the terminal still work against this server's own disk from /.

buildroot3.7 KB · 123 lines
/*! \page buildroot Using a build root The build root is very similar to Root: (which is now legacy).By using Buildroot: in your spec file you are indicatingthat your package can be built (installed into and packaged from)a user-definable directory.  This helps package building by normalusers. \section buildroot_specfile The Spec File Simply use\verbatim  Buildroot: <dir>\endverbatim in your spec file.  The actual buildroot used by RPM during thebuild will be available to you (and your %prep, %build, and %installsections) as the environment variable RPM_BUILD_ROOT.  You mustmake sure that the files for the package are installed into theproper buildroot.  As with Root:, the files listed in the %filessection should *not* contain the buildroot.  For example, thefollowing hypothetical spec file: \verbatim  Name: foo  ...  Root: /tmp    %prep  ...    %build  ...    %install  install -m755 fooprog /tmp/usr/bin/fooprog    %files  /usr/bin/fooprog\endverbatim would be changed to: \verbatim  Name: foo  ...  BuildRoot: /tmp    %prep  ...    %build  ...    %install  install -m755 fooprog $RPM_BUILD_ROOT/usr/bin/fooprog    %files  /usr/bin/fooprog\endverbatim \section buildroot_building Building With a Build Root RPM will use the buildroot listed in the spec file as the defaultbuildroot.  There are two ways to override this.  First, you canhave "buildroot: <dir>" in your rpmrc.  Second, you can overridethe default, and any entry in an rpmrc by using "--buildroot <dir>"on the RPM command line. \section buildroot_caveats Caveats using Build Roots Care should be taken when using buildroots that the install directoryis owned by the correct package.  For example the file \verbatim	/usr/lib/perl5/site_perl/MD5.pm\endverbatim is installed by the package perl-MD5.  If we were to use a buildrootand specified  \verbatim	%files  	/usr/lib/perl5/site_perl\endverbatim we would end up with the directory /usr/lib/perl5/site_perl beingowned by the library package. This directory is in fact used by ALLperl libraries and should be owned by the package for perl not any ofits libraries. It is important that the %files command specifies allthe known directories explicitly. So this would be preferable: \verbatim	/usr/lib/perl5/site_perl/*\endverbatim Since we only want the files and directories that the package perl-MD5installed into /usr/lib/perl5/site_perl/ to be owned by the package.The directory /usr/lib/perl5/site_perl/ is created when perl isinstalled. If we were to use the bad %files line shown above, then when the MD5package is removed, RPM will try to remove each of the perl-MD5 files andthen try to remove the dir itself. If there's still files in thesite_perl directory (e.g. from other packages) then the Unix rmdir(2)will fail and you will get a non-zero return code from RPM. If thermdir succeeds then you will no longer have a site_perl directory onyour machine even though this directory was created when Perl wasinstalled. The other common problem is that two packages could install two fileswith the the same name into the same directory. This would lead toother collision problems when removing the file. Care should be takenby the packager to ensure that all packages install unique files.Explicit use of %files can help make the packager aware of potentialproblems before they happen. When you try to install a package whichcontains file names already used by other packages on the system thenRPM will warn you of the problem and give a fatal error. This error canbe overridden with --force and the installed file will be replaced by thenew file and when the new package is removed the file will be removed as well. */