Changes between Version 40 and Version 41 of RpmHowToPackagers


Ignore:
Timestamp:
Apr 11, 2016, 12:45:52 PM (8 years ago)
Author:
dmik
Comment:

Update links to Fedora .spec files.

Legend:

Unmodified
Added
Removed
Modified
  • RpmHowToPackagers

    v40 v41  
    1717Also, there is a Fedora [http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html-single/RPM_Guide/ RPM Guide] that may be used as an RPM reference documentation.
    1818
    19 Instead of writing a .spec file from scratch, you can get an existing one: a good source for them is the RPM find service like [http://rpm.pbone.net/ rpm.pbone.net] or [http://www.rpmfind.net www.rpmfind.net]. Enter the name of your package, and choose a distribution: most core packages have been built using Fedora 13 as template; when Fedora 13 is not available, Fedora 14/15 or OpenSUSE 11.3 are good. Select your package from the left link, you will get a page with all details; one of them is the .src.rpm package, it contains the spec file, platform specific patches, package sources (in .tar.gz, .tar.bz2, .tar.xz format). Use  unrpm.cmd (check bootstrap directory) to extract all files to a temporary location.
     19If you package cross-platform open-source software, there is a great chance that a .spec file for it already exists and it is a good idea to take it as a base and adapt to OS/2 as needed instead of creating a new one from scratch. The best source for .spec files is Fedora (it has RPMs for virtually each and every open source project) and all it's .spec files are available online: http://pkgs.fedoraproject.org/cgit/rpms/. In fact, the majority of OS/2 .spec files are created from Fedora .spec files so you should check this source first and only proceed with other ways of creating .spec if you fail to find one there. The repository is very big but there is a search field to the left that allows you quickly navigate to the needed .spec file by project/library name.
     20
     21If, for some reason, you fail to find the right .spec file in the Fedora repository (which is unlikely), you may try to search it in other places using the RPM find services like [http://rpm.pbone.net/ rpm.pbone.net] or [http://www.rpmfind.net www.rpmfind.net]. Enter the name of your package, and choose a distribution: prefer Fedora (see above) or OpenSUSE if Fedora is not available. Select your package from the left link, you will get a page with all details; one of them is the .src.rpm package, it contains the spec file, platform specific patches, package sources (in .tar.gz, .tar.bz2, .tar.xz format). Use  unrpm.cmd (check bootstrap directory) to extract all files to a temporary location.
     22
     23When you create an OS/2 .spec file based on the existing one, please always reference the original file the first line of the resulting .spec file, like this: [source:/spec/trunk/SPECS/nspr.spec#L1] (i.e. you put either an URL to the Fedora .spec file or to the SRPM file you used to get .spec from). This is important for further updating.
     24
     25If you create a .spec file for new or proprietary software then you most likely don't have a .spec file to copy from. In this case it's best to select some similar application or library among existing OS/2 or Fedora .spec files and use it as a template.
    2026
    2127RPM packages are created from .spec files using the ''rpmbuild'' command. The first time you try to build a package (see '''Building package''' below), rpmbuild will create a set of directories in your %HOME% directory that it uses for the package generation process: