Packaging madagascar

From Madagascar
Jump to navigation Jump to search
Fotolia 4803048 XS.jpg

There are many benefits to managing your software through the standard packaging system for your platform. This page is written for the benefit of:

  • future madagascar developers who want to prepare packages for distribution
  • system administrators who need to do their own packaging, such as for the purpose of easy, customized software management over a large number of machines


To make the RPMs, it is a good idea to first create a user just for this, i.e. makerpm. Then, install dependencies and set up. As root:

<bash> yum -y groupinstall "Development Tools" yum -y install rpmdevtools rpmlint </bash>

Log in as makerpm. Type: rpmdev-setuptree to create the ~/rpmbuild directory. Place the spec file in ~/rpmbuild/SPECS , then cd to that directory and run:

<bash> rpmbuild -ba m8r-fedora12-x86_64.spec </bash>

If you want a log of the entire process, use something like:

<bash> rpmbuild -ba madagascar.spec |& tee ~/log_rpm.asc </bash>

If you want to make other RPM files, you may find useful to run

<bash> rpmlint yourfile.spec </bash>

Some warnings are OK. If you want to debug your experiments, you can comment the contents of the prep, build or clean sections in the spec file. For prep and build, you must have executed it uncommented at least once.

You may be able to QC the build with mock. For this, run as root:

<bash> yum -y install mock useradd -G mock makerpm </bash>

Then run it with mock -r fedora-12-x86_64 rebuild path_to_source_RPM .

Fedora's guide to creating RPM packages constitutes excellent further reading on the topic of making RPMs.

Creating yum repositories for RPMs

As root: <bash> yum -y install createrepo </bash> Make the repo directory, i.e. <bash> mkdir -p /var/$USER/repo/Fedora/12/{SRPMS,x86_64} </bash> You may have RPMs for more architectures, for other versions, for other distros... make directories as needed.

Copy your RPMs in the appropriate directories, then in each directory (in this case, SRPMS and x86_64), run <bash> createrepo . </bash> Tarball the whole repo directory and upload it to your web host, then unpack it there in the desired location.

Create a madagascar.repo file with contents like this one, then instruct the users to copy the file to /etc/yum.repos.d if they want to enable this repository, i.e.: <bash> su cd /etc/yum.repos.d wget </bash>

Creating a Fedora Live CD/DVD

To create a Live CD with a minimal version of the Fedora 13 64-bit XFCE desktop, just burn to a DVD this image. This was created by installing Fedora 13 x86_64 on a machine (does not have to be the same desktop, or package selection as the Live CD). Then, as root, run the commands below: <bash>

  1. Install dependencies:

yum -y install livecd-tools system-config-kickstart spin-kickstarts

  1. Set SELinux to permissive mode:

setenforce 0

  1. Make the Live DVD:

livecd-creator -f m8rFedoraLive -c fedora-live-m8r.ks </bash> The kickstart file (fedora-live-m8r.ks) can be found under version control in the SVN repository. This will create a 767Mib image that has a web browser and code editor installed, as well as the madagascar RPM and its dependencies, but not much else in terms of graphical user applications. Through additional tweaking of the install file, it should be possible to eventually bring the size of the image down to where it can be writtten on a CD instead of a DVD.