This is a procedure describing how to compile GPL packages.

* install a Linux distribution

  The whole building process have been tested on Fedora 8. The installation 
  instructions here is also for Fedora 8. Other Linux distributions should be 
  also fine but may need to some expertise to configure your working Linux 
  environment.

  When you install Fedora 8, please select "Customize now" for software
  installation. You could select all packages which should be no harm for GPL
  compilation. Or at least select all packages in Development packages.

* prepare a working environment

  Depend on the model and version and build number of IPCAM, the GPL package will have different
  name. Let's say "GPL_model_version_build.tgz" as the GPL package.
  
    $ cp GPL_model_version_build.tgz ~/
    $ cd ~/
    $ mkdir works
    $ cd works
    $ tar xzf ~/GPL_model_version_build.tgz
  
  Depend on the model and version and build number, the extracted directory will be different.  
  Let's say the extracted directory is "GPL_model_version_build/".
  
* prepare tool chain

  For each machine, you only need to do this procedure once.
  
    $ cd ~/works/GPL_model_version_build/fie8180
    $ pwd
    /home/you/works/GPL_model_version_build/fie8180
    
    $ sudo tar -zxvf FIE8180_toolchain.tgz -C /opt/
	[sudo] password for you: ******

* import compilation environment variables

    $ cd ~/works/GPL_model_version_build/
    $ pwd
    /home/you/works/GPL_model_version_build
    
    $ . env.conf
    
* compile drivers

  First,
	$ cd ~/works/GPL_model_version_build/kernel/linux-2.6.14-fa
	$ pwd
	/home/you/works/GPL_model_version_build/kernel/linux-2.6.14-fa
	$ make modules_prepare
  then,
    $ cd ~/works/GPL_model_version_build/driver
    $ pwd
    /home/you/works/GPL_model_version_build/driver
  For ffmpeg-0.4.8,
	$ cd ffmpeg-0.4.8
	$ pwd
	/home/you/works/GPL_model_version_build/driver/ffmpeg-0.4.8
	$ ./switch.sh 8180_26
  then,
	$ make -r -C libgm
      
* compile open source projects

    $ cd ~/works/GPL_model_version_build/opensources
    $ pwd
    /home/you/works/GPL_model_version_build/opensources
    
  There are many open source projects, you can choose each one you need.
  Simple "make -C theProject dist_install" will do the job.

  if you want to build lighttpd:
    $ make -C pcre dist_install 
    $ make -C lighttpd dist_install 
    
  if you want to build ifplugd:
	$ make -C libdaemon dist_install
	$ make -C ifplugd dist_install
 
  if you want to build port_map:
	$ make -C tcp_wrappers dist_install
	$ make -C portmap dist_install

* compile linux kernel

  First compile module makedevs in opensources:
    $ cd ~/works/GPL_model_version_build/opensources
	$ make -C makedevs dist_install
  second,
    $ cd ~/works/GPL_model_version_build/
	$ pwd
	/home/you/works/GPL_model_version_build
  type command 'fakeroot -- ./fakeroot_cpio.sh' to prepare cpio format initramfs,
  	$ fakeroot -- ./fakeroot_cpio.sh
  then,
    $ cd ~/works/GPL_model_version_build/kernel/linux-2.6.14-fa/
    $ pwd
    /home/you/works/GPL_model_version_build/kernel/linux-2.6.14-fa
    
    $ make oldconfig
  then,
	$ make bootsImage

* checking building open sources

  All daemons, libs, modules of these open sources are installed at a prefix
  directory.

    $ cd ~/works/GPL_model_version_build/prefix
    $ pwd 
    /home/you/works/GPL_model_version_build/prefix

    $ ls -l

