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.
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:
|Upstream sources file||sources.download||Required
|RPM spec file||miniupnpd.spec||Required
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.
The “sources.download” file will be replaced by the “sources” file when the migration to the Koji build system is completed.
Sources File - sources.download
When you are ready to build your RPM, create the sources.download with the following data:
md5sum tarball URL
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
git clone https://github.com/pcbaldwin/miniupnpd.git
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.