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. |
| 19 | If 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 | |
| 21 | If, 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 | |
| 23 | When 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 | |
| 25 | If 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. |