DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Developing applications

How to build from Caldera OpenLinux source files

This procedure assumes you are working with Caldera OpenLinux source RPMs. It is provided here for easy reference only. For a full description of the development system provided in LKP, see the DocView documentation server running on the LKP side at http://localhost:8457 (not installed by default), or see the OpenLinux documentation on the Web at the: Documentation Web Site.

  1. Install a development system

    Perform a All install (all rpm packages) to ensure that all necessary files are installed. If disk space is an issue, we recommend performing the Development installation from eDesktop instead.

  2. Install the source files and rebuild the binary as a sanity check.

    To install the source of package ``foo'': Insert the 2nd CD (labeled ``Source Code'') and mount it from UNIX mode.

       mount -r -F cdfs /dev/cdrom/cdrom1 /linux/mnt/cdrom
    
    All other commands should be executed from Linux mode.

  3. All source files reside on the CD under /col/sources/SRPMS as source RPM packages (each ending in src.rpm). You should find the source of binary package foo-1.0-1.i386.rpm in foo-1.0-1.src.rpm. Type
       rpm -qi foo
    
    and watch for the `Source RPM'' tag to verify which source RPM this binary originated from.

    The source RPM packages contain the main source tarball, and sometimes other source or patches. There is also a a ``spec'' file (a meta/control file that contains information like Name, Version, and Author) and instructions (in form of automated scripts) about how to build the binaries from the source.

  4. To install the source, patches and spec file of type foo:
       rpm -i /mnt/cdrom/col/sources/SRPMS/foo-1.0-1.src.rpm
    

  5. Change directory into the RPM topdir
       cd /usr/src/OpenLinux
    
    Under that directory you find some subdirectories; for example: SOURCES (the source and patches of package foo show up here), and SPECS (foo.spec shows up here).

  6. Rebuild the binaries with
       rpm -ba SPECS/foo.spec
    
    When that has finished you will find the newly built RPMs under RPMS, the target directory for binary RPMs, and also a new source RPM under SRPMS, the target directory for source RPMs. After building a package with rpm it automatically packages up the binaries into one or more binary RPMs and the source, patches and spec file into a source RPM. This assures that we get a ``snapshot'' of the source, patches and spec file at the moment it successfully built the package.

    For additional information see rpm(8linux).

  7. Customize the files to fit your needs.

    You can go into the SOURCES or SPECS directory and modify the source, patches or spec file to your needs. Take a look at the SRPMs first before downloading latest source and performing tar, configure, make, and make install. You most likely will find those commands also in the spec files, but in addition, there are hints and information about patches that we fixed or added.

Additional hints:

Example

Find out which package the command bar belongs to by using

   rpm -qf `which bar`
This will give you the name of the binary RPM bar comes with. Now find out the source RPM that builds this binary RPM, install the source RPM, edit the ``Release'' tag in the spec file and augment it by one, then rebuild the binary RPM using and update the binary package you just built using rpm -U

Start with something non-critical in case something goes wrong on your first exercise.


Next topic: Examining core Files from Linux Programs under LKP
Previous topic: Java 2 Development Kit (JDK)

© 2002 Caldera International, Inc. All rights reserved.
UnixWare 7 Release 7.1.3 - 17 October 2002