<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/2036/1/7/_/styles/combined.css?spaceKey=TOP&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://wiki.asterisk.org/wiki/display/TOP/Installation+Structure">Installation Structure</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://wiki.asterisk.org/wiki/display/~dlee">David M. Lee</a>
    </h4>
        <br/>
                         <h4>Changes (10)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >The installation performed by {{make install}} or {{nmake install}} will follow a set of reasonable defaults.  The exceptions listed below are established by the packaging script, not by the cmake scripts. <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >The Asterisk SCF cmake scripts provides several configuration variables, which function very similarly to [autoconf&#39;s installation directory variables|http://www.gnu.org/software/autoconf/manual/autoconf.html#Installation-Directory-Variables].  The names are similar, except the are cmake-ified.  (They have the prefix {{INSTALL_}}, are all caps, and use underscores for word separators.)  The directories are relative to <span class="diff-changed-words">{{<span class="diff-added-chars"style="background-color: #dfd;">CMAKE_</span>INSTALL_PREFIX}}.</span>  Except, of course, <span class="diff-changed-words">{{<span class="diff-added-chars"style="background-color: #dfd;">CMAKE_</span>INSTALL_PREFIX}}</span> itself, which would be needlessly recursive. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" >| <span class="diff-changed-words">{{<span class="diff-added-chars"style="background-color: #dfd;">CMAKE_</span>INSTALL_PREFIX}}</span> | {{/usr/local}} | <br></td></tr>
            <tr><td class="diff-unchanged" >| {{INSTALL_SYS_CONF_DIR}} | {{etc}} | <br>| {{INSTALL_BIN_DIR}} | {{bin}} | <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >| {{INSTALL_LOCAL_STATE_DIR}} | {{var}} | <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Overriding a default requires specifying the value in the cmake invocation. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Overriding a default requires specifying the value in the cmake invocation using the {{-D}} option.  This can be done with either cmake directly, or with the {{init-cmake.sh}} wrapper script. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>{code:bash} <br></td></tr>
            <tr><td class="diff-changed-lines" >$ ./cmake/init-cmake.sh <span class="diff-changed-words"><span class="diff-added-chars"style="background-color: #dfd;">-DCMAKE_</span>INSTALL_PREFIX=~/my-asterisk-scf</span> <br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h2. User installed (defaults) <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">{{<span class="diff-added-chars"style="background-color: #dfd;">CMAKE_</span>INSTALL_PREFIX=/usr/local}}</span> (default) <br></td></tr>
            <tr><td class="diff-unchanged" > <br>Of course, the user can override anything they may wish. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h2. Digium provided package <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">{{<span class="diff-added-chars"style="background-color: #dfd;">CMAKE_</span>INSTALL_PREFIX=/opt/AsteriskSCF}}</span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br>With the following exceptions: <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h2. System package <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">{{<span class="diff-added-chars"style="background-color: #dfd;">CMAKE_</span>INSTALL_PREFIX=/usr}}</span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br>With the following exceptions: <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h2. User installed (defaults) <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">{{<span class="diff-added-chars"style="background-color: #dfd;">CMAKE_</span>INSTALL_PREFIX=c:\AsteriskSCF-$\{VERSION\}}}</span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h2. Digium provided installer <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">{{<span class="diff-added-chars"style="background-color: #dfd;">CMAKE_</span>INSTALL_PREFIX=Program</span> Files\AsteriskSCF}} or <span class="diff-changed-words">{{<span class="diff-added-chars"style="background-color: #dfd;">CMAKE_</span>INSTALL_PREFIX=Program</span> Files (x86)\AsteriskSCF}}, as appropriate <br></td></tr>
            <tr><td class="diff-unchanged" >{numberedheadings} <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>Work in progress.</td></tr></table></div>

<p>This page describes the installation structure for Asterisk SCF.  It is intended to follow the <a href="http://www.pathname.com/fhs/pub/fhs-2.3.html" class="external-link" rel="nofollow">Filesystem Hierarchy Standard</a> as closely as possible.</p>

<div>
<ul>
    <li><a href='#InstallationStructure-Defaults'>1. Defaults</a></li>
<ul>
    <li><a href='#InstallationStructure-Othernotes'>1.1. Other notes</a></li>
</ul>
    <li><a href='#InstallationStructure-NUX'>2. *NUX</a></li>
<ul>
    <li><a href='#InstallationStructure-Userinstalled%28defaults%29'>2.1. User installed (defaults)</a></li>
    <li><a href='#InstallationStructure-Digiumprovidedpackage'>2.2. Digium provided package</a></li>
    <li><a href='#InstallationStructure-Systempackage'>2.3. System package</a></li>
</ul>
    <li><a href='#InstallationStructure-Windows'>3. Windows</a></li>
<ul>
    <li><a href='#InstallationStructure-Userinstalled%28defaults%29'>3.1. User installed (defaults)</a></li>
    <li><a href='#InstallationStructure-Digiumprovidedinstaller'>3.2. Digium provided installer</a></li>
</ul>
</ul></div>

<h1><a name="InstallationStructure-Defaults"></a>1. Defaults</h1>

<p>The installation performed by <tt>make install</tt> or <tt>nmake install</tt> will follow a set of reasonable defaults.  The exceptions listed below are established by the packaging script, not by the cmake scripts.</p>

<p>The Asterisk SCF cmake scripts provides several configuration variables, which function very similarly to <a href="http://www.gnu.org/software/autoconf/manual/autoconf.html#Installation-Directory-Variables" class="external-link" rel="nofollow">autoconf's installation directory variables</a>.  The names are similar, except the are cmake-ified.  (They have the prefix <tt>INSTALL_</tt>, are all caps, and use underscores for word separators.)  The directories are relative to <tt>CMAKE_INSTALL_PREFIX</tt>.  Except, of course, <tt>CMAKE_INSTALL_PREFIX</tt> itself, which would be needlessly recursive.</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> <tt>CMAKE_INSTALL_PREFIX</tt> </td>
<td class='confluenceTd'> <tt>/usr/local</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>INSTALL_SYS_CONF_DIR</tt> </td>
<td class='confluenceTd'> <tt>etc</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>INSTALL_BIN_DIR</tt> </td>
<td class='confluenceTd'> <tt>bin</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>INSTALL_LIB_DIR</tt> </td>
<td class='confluenceTd'> <tt>lib</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>INSTALL_DATA_ROOT_DIR</tt> </td>
<td class='confluenceTd'> <tt>share</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>INSTALL_DATA_DIR</tt> </td>
<td class='confluenceTd'> <tt>share</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>INSTALL_INCLUDE_DIR</tt> </td>
<td class='confluenceTd'> <tt>include</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>INSTALL_LOCAL_STATE_DIR</tt> </td>
<td class='confluenceTd'> <tt>var</tt> </td>
</tr>
</tbody></table>
</div>


<p>Overriding a default requires specifying the value in the cmake invocation using the <tt>-D</tt> option.  This can be done with either cmake directly, or with the <tt>init-cmake.sh</tt> wrapper script.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: bash; gutter: false"><![CDATA[
$ ./cmake/init-cmake.sh -DCMAKE_INSTALL_PREFIX=~/my-asterisk-scf
]]></script>
</div></div>


<p>In addition to the generic variables intended for use by configuration, the cmake scripts provide several variables intended for use within the scripts, which allow cleaner specification of which subdirectories we use within the system directories.</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Configuration </td>
<td class='confluenceTd'> <tt>ASTERISK_SCF_INSTALL_CONF_DIR</tt> </td>
<td class='confluenceTd'> <tt>${INSTALL_SYS_CONF_DIR}/asterisk-scf</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Executables </td>
<td class='confluenceTd'> <tt>ASTERISK_SCF_INSTALL_BIN_DIR</tt> </td>
<td class='confluenceTd'> <tt>${INSTALL_BIN_DIR</tt>} </td>
</tr>
<tr>
<td class='confluenceTd'> Libraries </td>
<td class='confluenceTd'> <tt>ASTERISK_SCF_INSTALL_LIB_DIR</tt> </td>
<td class='confluenceTd'> <tt>${INSTALL_LIB_DIR</tt>} </td>
</tr>
<tr>
<td class='confluenceTd'> Icebox modules </td>
<td class='confluenceTd'> <tt>ASTERISK_SCF_INSTALL_ICEBOX_DIR</tt> </td>
<td class='confluenceTd'> <tt>${INSTALL_LIB_DIR}/asterisk-scf/icebox</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Runtime data directory </td>
<td class='confluenceTd'> <tt>ASTERISK_SCF_INSTALL_LOCAL_STATE_DIR</tt> </td>
<td class='confluenceTd'> <tt>${INSTALL_LOCAL_STATE_DIR}/lib/asterisk-scf</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Logfile </td>
<td class='confluenceTd'> <tt>ASTERISK_SCF_INSTALL_LOG_FILE</tt> </td>
<td class='confluenceTd'> <tt>${INSTALL_LOCAL_STATE_DIR}/log/asterisk-scf.log</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Headers </td>
<td class='confluenceTd'> <tt>ASTERISK_SCF_INSTALL_INCLUDE_DIR</tt> </td>
<td class='confluenceTd'> <tt>${INSTALL_INCLUDE_DIR</tt>}<sup>*</sup> </td>
</tr>
<tr>
<td class='confluenceTd'> Slices </td>
<td class='confluenceTd'> <tt>ASTERISK_SCF_INSTALL_SLICE_DIR</tt> </td>
<td class='confluenceTd'> <tt>${INSTALL_DATA_DIR}/asterisk-scf/slice</tt><sup>*</sup> </td>
</tr>
</tbody></table>
</div>


<p><sup>*</sup> All Asterisk SCF include and slice files must go in an <tt>AsteriskSCF</tt> subdirectory.  But that's driven by the project structure, not the installation structure.</p>

<h2><a name="InstallationStructure-Othernotes"></a>1.1. Other notes</h2>

<ol>
        <li>Files associated with unit and integration tests (executables, icebox modules, configuration files) are not installed.</li>
        <li>The configuration files that get installed are merely sample configuration files, and as such have a <tt>.conf.sample</tt> file extension.</li>
        <li>Only include files necessary for integration shall be installed.  For example, include files used within an Icebox module do not need to be installed, since the interface to the icebox module is described by its <tt>.ice</tt> files.</li>
</ol>


<h1><a name="InstallationStructure-NUX"></a>2. *NUX</h1>

<h2><a name="InstallationStructure-Userinstalled%28defaults%29"></a>2.1. User installed (defaults)</h2>

<p><tt>CMAKE_INSTALL_PREFIX=/usr/local</tt> (default)</p>

<p>Of course, the user can override anything they may wish.</p>

<h2><a name="InstallationStructure-Digiumprovidedpackage"></a>2.2. Digium provided package</h2>

<p><tt>CMAKE_INSTALL_PREFIX=/opt/AsteriskSCF</tt></p>

<p>With the following exceptions:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Configuration samples </td>
<td class='confluenceTd'> <tt>/etc/opt/AsteriskSCF</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Runtime data directory </td>
<td class='confluenceTd'> <tt>/var/opt/AsteriskSCF/lib/asterisk-scf</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Logfile </td>
<td class='confluenceTd'> <tt>/var/opt/AsteriskSCF/log/asterisk-scf.log</tt> </td>
</tr>
</tbody></table>
</div>


<h2><a name="InstallationStructure-Systempackage"></a>2.3. System package</h2>

<p><tt>CMAKE_INSTALL_PREFIX=/usr</tt></p>

<p>With the following exceptions:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Configuration samples </td>
<td class='confluenceTd'> <tt>/etc/asterisk-scf</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Runtime data directory </td>
<td class='confluenceTd'> <tt>/var/lib/asterisk-scf</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Logfile </td>
<td class='confluenceTd'> <tt>/var/log/asterisk-scf.log</tt> </td>
</tr>
</tbody></table>
</div>


<h1><a name="InstallationStructure-Windows"></a>3. Windows</h1>

<h2><a name="InstallationStructure-Userinstalled%28defaults%29"></a>3.1. User installed (defaults)</h2>

<p><tt>CMAKE_INSTALL_PREFIX=c:\AsteriskSCF-${VERSION</tt>}</p>

<h2><a name="InstallationStructure-Digiumprovidedinstaller"></a>3.2. Digium provided installer</h2>

<p><tt>CMAKE_INSTALL_PREFIX=Program Files\AsteriskSCF</tt> or <tt>CMAKE_INSTALL_PREFIX=Program Files (x86)\AsteriskSCF</tt>, as appropriate</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://wiki.asterisk.org/wiki/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://wiki.asterisk.org/wiki/display/TOP/Installation+Structure">View Online</a>
        |
        <a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=10650198&revisedVersion=6&originalVersion=5">View Changes</a>
                |
        <a href="https://wiki.asterisk.org/wiki/display/TOP/Installation+Structure?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>