Developer’s Guide

This document describes the coding standards for FAN, and provides tips for FAN developers.

How to get a development environment ?

You can install FAN in a virtual machine for example and use CentOS distribution for you development.
How to get source of the FAN project ?
At the moment, FAN is a sourceforge project. You can checkout the SVN repository :

# svn co fannagioscd

To browse the Subversion tree, go to here.

How to (re)build an RPM package (on CentOS) ?

Install “Epel” package, see Fedora Project Wiki

# rpm -ivh epel-release-5-3.noarch.rpm

As root user Install rpmdevtools :

# yum install rpmdevtools
user@FAN:$ cd ~/
user@FAN:$ rpmdev-setuptree

To create a new package :

user@FAN:$ rpmdev-newspec mypackage
user@FAN:$ rpmbuild -ba rpmbuild/SPECS/mypackage.spec

Use SVN repository :

For example : create links on

user@FAN:$ svn export
user@FAN:$ cd rpmbuild
user@FAN:$ rm -rf SPECS SOURCES
user@FAN:$ ln -s ~/fannagioscd-2.4/SPECS
user@FAN:$ ln -s ~/fannagioscd-2.4/SOURCES

Rebuild all packaches

user@FAN:$ rpmbuild -ba rpmbuild/SPECS/*.spec

How to create a new FAN ISO including your own modifications and settings ?

Install createrepo and mkisofs

# yum install createrepo mkisofs

Mount FAN iso

# mount -o loop FAN-XXX.iso /media/cdrom
# cp -r /media/cdrom ~/FAN

Go to in the FAN directory :

# cd ~/FAN
# mkdir CentOS/MyPackages                     <------ Create a personal directory
# cp mypackage.rpm CentOS/MyPackages/.        <------ copy your rpm packages
# createrepo -g repodata/comps.xml .          <------ Update repodata
# mkisofs -R -J -T -no-emul-boot -boot-load-size 4 -boot-info-table -V "FAN (Fully Automated Nagios)" -A "Created on 2008/05/31" -P "FANFoundry" -p "FANfoundry" -b isolinux/isolinux.bin -c isolinux/ -x "lost+found" -o ../FAN-X.X.iso .