File Layout
This document provides information on the file layout used for building RPMs on the ClearOS build system. This document is especially useful for those who are maintaining upstream packages during the migration to git/GitHub.
If you are not familiar with building RPMs, the getting started document is a good place to start. There are also other online resources that can provide help with the basics of building an RPM.
Layout
The build system for ClearOS 6 uses the old Plague software with CVS for source code management. That's old school… really old school. We are in the process of upgrading the build system to the more modern Koji build system which is used by Red Hat for their Fedora and Enterprise Linux products.
The file layout for building upstream packages on both the old and new build systems is essentially identical. To build an upstream RPM, configuration files, scripts and patches are typically required. The following table describes the basic structure:
Description | Example | Status |
---|---|---|
Upstream sources file | sources.download | Required |
RPM spec file | miniupnpd.spec | Required |
Configuration files | miniupnpd.conf | Optional |
Scripts | miniupnpd-init | Optional |
Patches | miniupnpd-1.6.20120121-clearos.patch | Optional |
You can see an example layout for the MiniUPnP package on GitHub.
There's probably nothing too surprising here except for the sources file. Instead of storing the tarball in the git source code management system, the URL to the upstream source is stored in the sources.download file.
Sources File - sources.download
When you are ready to build your RPM, create the sources.download with the following data:
md5sum tarball URL
For example:
7183a28a6dd47ef32d70a73204aa4a82 miniupnpd-1.6.20120121.tar.gz http://miniupnp.free.fr/files/download.php?file=miniupnpd-1.6.20120121.tar.gz
Building the RPM
As long as you adhere to the file layout and have a sources.download file in place, you can use the clearos local command to build a test version of your RPM. You can give this a try in your development environment by using the MiniUPnP example:
yum install iptables-devel mkdir /tmp/my_scratch cd /tmp/my_scratch git clone https://github.com/pcbaldwin/miniupnpd.git cd miniupnpd clearos local
Once the build system migration is complete, you will able to push a build up to the ClearOS build/repository infrastructure using a single command. For now, please contact the ClearOS development team to push your package to the build system.