3.2.2. Extracting the Source Code

The packages you downloaded from the FTP server are compressed archives containing the source code, thus you will need to extract it before compiling. If you didn't download the packages to /usr/src/, either move them there now, or specify the full path to their location. We will be using the GNU tar application to extract the source code from the compressed archive. This is a simple process that can be achieved through the use of the following commands:

    # cd /usr/src/
    # tar zxvf zaptel-1.4-current.tar.gz
    # tar zxvf libpri-1.4-current.tar.gz
    # tar zxvf asterisk-1.4-current.tar.gz
[Tip] Tip

In Bash (and other shell systems which support it) you can use an extremely handy feature called Tab completion. This will allow you to type part of a filename, and have the rest of it completed automatically. For example, if you type tar zxvf zap<tab> that will complete the full zaptel filename for you. If more than one filename matches the pattern and you hit Tab twice, it will list the files matching that pattern.

These commands will extract the packages and source code to their respective directories. When you extract the asterisk-1.4-current.tar.gz file, you will find that the file will extract to the current version of Asterisk, i.e. asterisk-1.4.4.

[Tip] Tip

It's always a good idea to keep the source code of the most recently working version of a package incase you have to "rollback" out of a new bug introduced, or some other strange behavior you can't solve immediately.