s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre |
Next
Previous
Contents
13. Appendix B - Making your own RPMs
The RPM package format is already very well documented, particularly in the book Maximum RPM by Ed Bailey, which you can download from the RPM WWW site - also available from all good book stores! This is just a couple of quick hints for people in a hurry.
RPM packages are built from a spec file. This consists (in a similar fashion to the KickStart config file) of a recipe of steps that need to be taken in order to build the package - it's expected that you'll have to build it from source, potentially for multiple platforms, and may need to apply patches before compiling. Once built and installed, a binary RPM will be created from the files and directories you specify as being associated with the package. It's important to note that RPM has no idea of which files and directories are related to a given package - you have to tell it. Here's a sample specification for a custom RPM of the Squid WWW cache server:
Here's how to build this RPM:
This will automatically create a subdirectory under the BUILD
directory, into which it'll unpack the source code and then apply the
patch (there are a number of options available for patching - check
the book for details). Now, RPM will automatically build the package
by running
Note that we can insert arbitrary shell commands into the unpacking,
building and installing processes, e.g. the call to
The final binary RPM will be left under the RPMS directory in
the platform specific subdirectory i386. In this case it
will be called squid-1.NOVM.22-1.i386.rpm. Note that the
filename is created by concatenating the values of the following
parameters from the spec file:
It's also worth bearing in mind that you can build RPMs without having to rebuild the whole software package, e.g.
In this case we simply create an RPM based on the /boot/vmlinuz file and the contents of the directory /lib/modules/2.0.36, and execute /sbin/lilo after the package has been installed on a target machine. Let me know if you know much neater way of writing the spec file than this.
Next Previous Contents |