VirtualBox

Changes between Version 3 and Version 4 of Ticket #18818, comment 2


Ignore:
Timestamp:
Aug 10, 2019 11:41:05 AM (5 years ago)
Author:
Frank Batschulat (Oracle)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18818, comment 2

    v3 v4  
    1 {{{
    2 I've looked into the RPM packaging background on
    3 this issue a bit, for the record here are the
    4 details discussed in the proposed change,
     1I've looked into the RPM packaging background on this issue for a bit, here are the details regarding the proposed change,
    52just in case we have to do it that way:
    63
     
    85
    96http://ftp.rpm.org/max-rpm/s1-rpm-specref-files-list.html
     7
    108http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list.html
     9
    1110https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/rpm_packaging_guide/index#files
     11
    1212https://docs.fedoraproject.org/ro/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s05.html
     13
    1314https://wiki.mageia.org/en/Packagers_RPM_tutorial#Files_section
    14 https://www.techrepublic.com/article/making-rpms-part-3-installing-files/
    1515
    16 <snip>
    17 "The %files list indicates which files on the build
    18 system are to be packaged. The list consists of
    19 one file per line. If a directory is specified,
    20 by default all files and subdirectories will be packaged."
     16https://www.techrepublic.com/article/making-rpms-part-3-installing-files
    2117
    22 "%files         The list of files that will be installed in their final resting place in the context of the target system."
     18From there:
    2319
    24 " The %files section holds a list of all the files that RPM should install from the package. This list should be exhaustive, so that the RPM system knows exactly what your package installs. There are some options, though, to name all the files within a directory to help with packages containing hundreds of files.
     20"The %files list indicates which files on the build system are to be packaged. The list consists of one file per line. If a directory is specified, by default all files and subdirectories will be packaged."
     21
     22"%files The list of files that will be installed in their final resting place in the context of the target system."
     23
     24"The %files section holds a list of all the files that RPM should install from the package. This list should be exhaustive, so that the RPM system knows exactly what your package installs. There are some options, though, to name all the files within a directory to help with packages containing hundreds of files.
    2525In the default case, each line under the %files section names a separate file with its full path"
    26 <snip end>
    2726
    2827%install:
    2928
    3029https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/rpm_packaging_guide/index
    31 https://www.techrepublic.com/article/making-rpms-part-3-installing-files/
     30
     31https://www.techrepublic.com/article/making-rpms-part-3-installing-files
     32
    3233https://unix.stackexchange.com/questions/180666/rpm-install-section
     34
    3335https://rpm-guide.readthedocs.io/en/latest/rpm-guide.html
     36
    3437https://wiki.mageia.org/en/Packagers_RPM_tutorial#Install_section
    35 https://www.techrepublic.com/article/making-rpms-part-3-installing-files/
    3638
    37 <snip>
    38 " %install
    39 Command or series of commands for copying the desired build artifacts from the %builddir (where the build happens) to the %buildroot directory (which contains the directory structure with the files to be packaged). This usually means copying files from ~/rpmbuild/BUILD to ~/rpmbuild/BUILDROOT and creating the necessary directories in ~/rpmbuild/BUILDROOT. This is only run when creating a package, not when the end-user installs the package. See Section 5.1.7, “Working with SPEC files” for details."
     39https://www.techrepublic.com/article/making-rpms-part-3-installing-files
    4040
    41 "%install       Command or series of commands used to actually install the various artifacts into a resulting location in the FHS. Something to note is that this is done within the relative context of the %buildroot (more on that later)."
     41From there:
     42
     43"%install Command or series of commands for copying the desired build artifacts from the %builddir (where the build happens) to the %buildroot directory (which contains the directory structure with the files to be packaged). This usually means copying files from ~/rpmbuild/BUILD to ~/rpmbuild/BUILDROOT and creating the necessary directories in ~/rpmbuild/BUILDROOT. This is only run when creating a package, not when the end-user installs the package. See Section 5.1.7, “Working with SPEC files” for details."
     44
     45"%install Command or series of commands used to actually install the various artifacts into a resulting location in the FHS. Something to note is that this is done within the relative context of the %buildroot (more on that later)."
    4246
    4347"in the %install section, you are supposed to install all your files in the %{buildroot] directory; just the way they will be installed on the final system."
    4448
    4549"This section will contain the script responsible for actually installing the package in the simulated installation directory: %{buildroot}, or the equivalent $RPM_BUILD_ROOT.
    46 It will contain all the commands necessary to make the software ready to run on the user's system.
    47 "
    48 <snip end>
     50It will contain all the commands necessary to make the software ready to run on the user's system."
    4951
    50 The proposal:
    51 
    52 <snip>
    53 just add:
     52The proposal is to just add:
    5453
    5554touch $RPM_BUILD_ROOT/var/log/vbox-setup.log
    5655
    57 to the %install section of the spec file
    58 <snip end>
     56to the %install section of the spec file.
    5957
    60 So as the touch in the build area (which is when the
    61 %install section is executed) is unlikely going to
    62 have the proper set of permissions that we want to
    63 have on the final install destination, we'd also need
    64 to add an %attr or %defattr% directive to the %files
    65 section to manage proper install permissions.
     58So the touch in the build area (which is when the %install section is executed) is unlikely going to have the proper set of owner and permissions that we want to have on the final install destination, thus we'd also need to add an %attr or %defattr% directive to the %files section to manage proper install permissions.
    6659
    67 The %files section will pull into the binary RPM package
    68 from the build directory. So the %files section would
    69 need to make sure to use a permission directive for the
    70 empty log %file using%attr and %defattr when deploying
    71 the package on the destination:
     60As %files section will pull into the binary RPM package from the build directory. So the %files section would need to make sure to use a permission directive for the empty log %file using%attr and %defattr when deploying the package on the destination:
    7261
    7362http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html#S3-RPM-INSIDE-FLIST-DEFATTR-DIRECTIVE
     
    7766https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Reference_Guide/s1-filesystem-fhs.html
    7867
    79 <snip>
    80 3.2.1.14. The /var/ Directory
     68"3.2.1.14. The /var/ Directory
    8169Since the FHS requires Linux to mount /usr/ as read-only, any programs that write log files or need spool/ or lock/ directories should write them to the /var/ directory. The FHS states /var/ is for:
    82 
    83     ...variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files.
    84 System log files, such as messages and lastlog, go in the /var/log/ directory. The /var/lib/rpm/ directory contains RPM system databases. Lock files go in the /var/lock/ directory, usually in directories for the program using the file. The /var/spool/ directory has subdirectories for programs in which data files are stored.
    85 <snip end>
    86 }}}
     70...variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files.
     71System log files, such as messages and lastlog, go in the /var/log/ directory. The /var/lib/rpm/ directory contains RPM system databases. Lock files go in the /var/lock/ directory, usually in directories for the program using the file. The /var/spool/ directory has subdirectories for programs in which data files are stored."

© 2023 Oracle
ContactPrivacy policyTerms of Use