Difference between revisions of "DPI908/SBR600 RPM-Writing Lab"

From CDOT Wiki
Jump to: navigation, search
(Created page with 'Category:SBR600 LabsCategory:DPI908 = Purpose = To create an RPM package. = Resources = * Wiki pages on RPM * [[:fedora:PackageMaintainers|Fedora Pack…')
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:SBR600 Labs]][[Category:DPI908]]
+
[[Category:DPI908/SBR600 Labs]][[Category: SBR600 Labs]]
 
= Purpose =
 
= Purpose =
  
Line 37: Line 37:
 
# Attempt to address each of the errors or warnings. Adding <code>-i</code> to the ''rpmlint'' command line will provide informative messages about the cause of each error; the [[:fedora:Common_Rpmlint_issues|Common Rpmlint issues]] page may also be a useful resource.
 
# Attempt to address each of the errors or warnings. Adding <code>-i</code> to the ''rpmlint'' command line will provide informative messages about the cause of each error; the [[:fedora:Common_Rpmlint_issues|Common Rpmlint issues]] page may also be a useful resource.
 
#* If you cannot address each of the errors and warnings, refer to the [[:fedora:Main_Page|Fedora wiki]] or use IRC and/or email to ask a Fedora packager, classmate, or your professor for assistance.
 
#* If you cannot address each of the errors and warnings, refer to the [[:fedora:Main_Page|Fedora wiki]] or use IRC and/or email to ask a Fedora packager, classmate, or your professor for assistance.
 +
 +
{{Admon/tip|Errors vs. Warnings|Errors are considered fatal and must be corrected. Warnings are considered undesirable in some cases but may be ignored. This distinction is significant!-- for example, if an RPM package has an error, it won't pass the [[:fedora:Package Review Processs|Fedora package review process]], but if it has a warning, it may pass if there's a good reason to ignore the warning.}}
  
 
= Deliverables =
 
= Deliverables =
  
Write a blog post about your experience building these packages. Include notes about what worked and didn't work, and include a link to the spec files, SRPMs, and RPMs (you can host the files on your Matrix or Zenit account).
+
Write a blog post about your experience building these packages. Include notes about what worked and didn't work, and include a link to the spec files, SRPMs, and RPMs (you can host the files on your Matrix or Zenit account), plus the rpmlint output.

Latest revision as of 16:18, 16 September 2013

Purpose

To create an RPM package.

Resources

Preparation

  1. Install the required packages:
    • yum groupinstall "Fedora Packager"
    • yum install rpmlint yum-utils
  2. Create the ~/rpmbuild directories and the ~/.rpmmacros file by running this command: rpmdev-setuptree

Steps

For each of the two packages you previously built from source:

  1. Put the package source code (tarball) in ~/rpmbuild/SOURCES
  2. Change to the SPECS directory: cd ~/rpmbuild/SPECS
  3. Create an empty skeleton spec file: rpmdev-newspec nameOfPackage
  4. Edit the specfile. Fill in the metadata and all of the required sections.
  5. Attempt to build your package: rpmbuild -ba nameOfPackage.spec
  6. If there are errors, edit the specfile and try building again. Repeat until the build is successful.
  7. When the build is successful, the binary RPMs will be placed in ~/rpmbuild/RPMS and the source RPM will be placed in ~/rpmbuild/SRPMS/

You should also test your build:

  1. Run the rpmlint command once for each of these files, giving the filename as the positional argument:
    • the spec file
    • the SRPM
    • each binary RPM
  2. Note any errors or warnings
  3. Attempt to address each of the errors or warnings. Adding -i to the rpmlint command line will provide informative messages about the cause of each error; the Common Rpmlint issues page may also be a useful resource.
    • If you cannot address each of the errors and warnings, refer to the Fedora wiki or use IRC and/or email to ask a Fedora packager, classmate, or your professor for assistance.
Idea.png
Errors vs. Warnings
Errors are considered fatal and must be corrected. Warnings are considered undesirable in some cases but may be ignored. This distinction is significant!-- for example, if an RPM package has an error, it won't pass the Fedora package review process, but if it has a warning, it may pass if there's a good reason to ignore the warning.

Deliverables

Write a blog post about your experience building these packages. Include notes about what worked and didn't work, and include a link to the spec files, SRPMs, and RPMs (you can host the files on your Matrix or Zenit account), plus the rpmlint output.