1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter38.How to Compile Samba</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.66.1"><link rel="start" href="index.html" title="The Official Samba-3 HOWTO and Reference Guide"><link rel="up" href="Appendix.html" title="PartVI.Appendixes"><link rel="prev" href="Appendix.html" title="PartVI.Appendixes"><link rel="next" href="Portability.html" title="Chapter39.Portability"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter38.How to Compile Samba</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="Appendix.html">Prev</a></td><th width="60%" align="center">PartVI.Appendixes</th><td width="20%" align="right"><a accesskey="n" href="Portability.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="compiling"></a>Chapter38.How to Compile Samba</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="othername">R.</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">The Samba Team<br></span><div class="address"><p><tt class="email"><<a href="mailto:jelmer@samba.org">jelmer@samba.org</a>></tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email"><<a href="mailto:jht@samba.org">jht@samba.org</a>></tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Andrew</span> <span class="surname">Tridgell</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email"><<a href="mailto:tridge@samba.org">tridge@samba.org</a>></tt></p></div></div></div></div><div><p class="pubdate"> 22 May 2001 </p></div><div><p class="pubdate"> 18 March 2003 </p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="compiling.html#id2618614">Access Samba Source Code via Subversion</a></span></dt><dd><dl><dt><span class="sect2"><a href="compiling.html#id2618620">Introduction</a></span></dt><dt><span class="sect2"><a href="compiling.html#id2618662">Subversion Access to samba.org</a></span></dt></dl></dd><dt><span class="sect1"><a href="compiling.html#id2618836">Accessing the Samba Sources via rsync and ftp</a></span></dt><dt><span class="sect1"><a href="compiling.html#id2618902">Verifying Samba's PGP Signature</a></span></dt><dt><span class="sect1"><a href="compiling.html#id2619040">Building the Binaries</a></span></dt><dd><dl><dt><span class="sect2"><a href="compiling.html#id2619266">Compiling Samba with Active Directory Support</a></span></dt></dl></dd><dt><span class="sect1"><a href="compiling.html#id2619428">Starting the <span class="application">smbd</span> and <span class="application">nmbd</span></a></span></dt><dd><dl><dt><span class="sect2"><a href="compiling.html#id2619521">Starting from inetd.conf</a></span></dt><dt><span class="sect2"><a href="compiling.html#id2619726">Alternative: Starting <span class="application">smbd</span> as a Daemon</a></span></dt></dl></dd></dl></div><p>
You can obtain the Samba source from the
<a href="http://samba.org/" target="_top">Samba Website.</a> To obtain a development version,
you can download Samba from Subversion or using <span><b class="command">rsync</b></span>.
</p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2618614"></a>Access Samba Source Code via Subversion</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2618620"></a>Introduction</h3></div></div></div><p>
<a class="indexterm" name="id2618628"></a>
Samba is developed in an open environment. Developers use a
Subversion to “<span class="quote"><span class="emphasis"><em>checkin</em></span></span>” (also known as
“<span class="quote"><span class="emphasis"><em>commit</em></span></span>”) new source code. Samba's various Subversion branches can
be accessed via anonymous Subversion using the instructions
detailed in this chapter.
</p><p>
This chapter is a modified version of the instructions found at the
<a href="http://samba.org/samba/subversion.html" target="_top">Samba</a> web site.
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2618662"></a>Subversion Access to samba.org</h3></div></div></div><p>
The machine samba.org runs a publicly accessible Subversion
repository for access to the source code of several packages,
including Samba, rsync, distcc, ccache, and jitterbug. There are two main ways
of accessing the Subversion server on this host:
</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2618675"></a>Access via SVNweb</h4></div></div></div><p>
<a class="indexterm" name="id2618683"></a>
You can access the source code via your favorite WWW browser. This allows you to access
the contents of individual files in the repository and also to look at the revision
history and commit logs of individual files. You can also ask for a diff
listing between any two versions on the repository.
</p><p>
Use the URL:
<a href="http://svnweb.samba.org/" target="_top">http://svnweb.samba.org/</a>
</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2618709"></a>Access via Subversion</h4></div></div></div><p>
You can also access the source code via a
normal Subversion client. This gives you much more control over what you can
do with the repository and allows you to checkout whole source trees
and keep them up-to-date via normal Subversion commands. This is the
preferred method of access if you are a developer and not
just a casual browser.
</p><p>In order to be able to download the Samba sources off Subversion, you need
a Subversion client. Your distribution might include one, or you can download the
sources from <a href="http://subversion.tigris.org/" target="_top">http://subversion.tigris.org/</a>.
</p><p>
To gain access via anonymous Subversion, use the following steps.
</p><div class="procedure"><a name="id2618742"></a><p class="title"><b>Procedure38.1.Retrieving Samba using Subversion</b></p><ol type="1"><li><p>
Install a recent copy of Subversion. All you really need is a
copy of the Subversion client binary.
</p></li><li><p>
Run the command
</p><p>
<b class="userinput"><tt>svn co svn://svnanon.samba.org/samba/trunk samba</tt></b>.
</p><p>
This will create a directory called <tt class="filename">samba</tt> containing the
latest Samba source code (usually the branch that is going to be the next major release). This
currently corresponds to the 3.1 development tree.
</p><p>
Subversion branches other then trunk can be obtained by adding branches/BRANCH_NAME
to the URL you check out. A list of branch names
can be found on the “<span class="quote"><span class="emphasis"><em>Development</em></span></span>” page of the Samba Web site. A common
request is to obtain the latest 3.0 release code. This could be done by
using the following command:
</p><p>
<b class="userinput"><tt>svn co svn://svnanon.samba.org/samba/branches/SAMBA_3_0 samba_3</tt></b>.
</p></li><li><p>
Whenever you want to merge in the latest code changes, use
the following command from within the Samba directory:
</p><p>
<b class="userinput"><tt>svn update</tt></b>
</p></li></ol></div></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2618836"></a>Accessing the Samba Sources via rsync and ftp</h2></div></div></div><p>
<a class="indexterm" name="id2618845"></a>
<a class="indexterm" name="id2618852"></a>
<i class="parameter"><tt>pserver.samba.org</tt></i> also exports unpacked copies of most parts of the Subversion
tree at the Samba <a href="ftp://pserver.samba.org/pub/unpacked" target="_top">pserver</a>
location and also via anonymous rsync at the Samba
<a href="rsync://pserver.samba.org/ftp/unpacked/" target="_top">rsync</a> server location.
I recommend using rsync rather than ftp.
See <a href="http://rsync.samba.org/" target="_top">the rsync home-page</a> for more info on rsync.
</p><p>
The disadvantage of the unpacked trees is that they do not support automatic
merging of local changes like Subversion does. <span><b class="command">rsync</b></span> access is most convenient
for an initial install.
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2618902"></a>Verifying Samba's PGP Signature</h2></div></div></div><p>
<a class="indexterm" name="id2618910"></a>
It is strongly recommended that you verify the PGP signature for any source file before
installing it. Even if you're not downloading from a mirror site, verifying PGP signatures
should be a standard reflex. Many people today use the GNU GPG tool-set in place of PGP.
GPG can substitute for PGP.
</p><p>
With that said, go ahead and download the following files:
</p><pre class="screen">
<tt class="prompt">$ </tt><b class="userinput"><tt>wget http://us1.samba.org/samba/ftp/samba-3.0.0.tar.asc</tt></b>
<tt class="prompt">$ </tt><b class="userinput"><tt>wget http://us1.samba.org/samba/ftp/samba-pubkey.asc</tt></b>
</pre><p>
<a class="indexterm" name="id2618958"></a>
The first file is the PGP signature for the Samba source file; the other is the Samba public
PGP key itself. Import the public PGP key with:
</p><pre class="screen">
<tt class="prompt">$ </tt><b class="userinput"><tt>gpg --import samba-pubkey.asc</tt></b>
</pre><p>
and verify the Samba source code integrity with:
</p><pre class="screen">
<tt class="prompt">$ </tt><b class="userinput"><tt>gzip -d samba-3.0.0.tar.gz</tt></b>
<tt class="prompt">$ </tt><b class="userinput"><tt>gpg --verify samba-3.0.0.tar.asc</tt></b>
</pre><p>
If you receive a message like, “<span class="quote"><span class="emphasis"><em>Good signature from Samba Distribution Verification Key...</em></span></span>”
then all is well. The warnings about trust relationships can be ignored. An
example of what you would not want to see would be:
</p><pre class="screen">
gpg: BAD signature from “<span class="quote"><span class="emphasis"><em>Samba Distribution Verification Key</em></span></span>”
</pre></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2619040"></a>Building the Binaries</h2></div></div></div><p>
<a class="indexterm" name="id2619048"></a>
After the source tarball has been unpacked, the next step involves
configuration to match Samba to your operating system platform.
If your source directory does not contain the <span><b class="command">configure</b></span> script
it is necessary to build it before you can continue. Building of
the configure script requires the correct version of the autoconf
tool kit. Where the necessary version of autoconf is present,
the configure script can be generated by executing the following:
</p><pre class="screen">
<tt class="prompt">root# </tt> cd samba-3.0.0
<tt class="prompt">root# </tt> ./autogen.sh
</pre><p>
</p><p>
<a class="indexterm" name="id2619090"></a>
To build the binaries, run the program <b class="userinput"><tt>./configure
</tt></b> in the source directory. This should automatically
configure Samba for your operating system. If you have unusual
needs, then you may wish to run</p><pre class="screen"><tt class="prompt">root# </tt><b class="userinput"><tt>./configure --help
</tt></b></pre><p>first to see what special options you can enable. Now execute <b class="userinput"><tt>./configure</tt></b> with any arguments it might need:</p><pre class="screen"><tt class="prompt">root# </tt><b class="userinput"><tt>./configure <i class="replaceable"><tt>[... arguments ...]</tt></i></tt></b></pre><p>Executing</p><p>
<a class="indexterm" name="id2619156"></a>
</p><pre class="screen"><tt class="prompt">root# </tt><b class="userinput"><tt>make</tt></b></pre><p>will create the binaries. Once it is successfully
compiled you can use</p><pre class="screen"><tt class="prompt">root# </tt><b class="userinput"><tt>make install</tt></b></pre><p>to install the binaries and manual pages. You can
separately install the binaries and/or man pages using</p><pre class="screen"><tt class="prompt">root# </tt><b class="userinput"><tt>make installbin
</tt></b></pre><p>and</p><pre class="screen"><tt class="prompt">root# </tt><b class="userinput"><tt>make installman
</tt></b></pre><p>Note that if you are upgrading from a previous version
of Samba you might like to know that the old versions of
the binaries will be renamed with an “<span class="quote"><span class="emphasis"><em>.old</em></span></span>” extension. You
can go back to the previous version with</p><pre class="screen"><tt class="prompt">root# </tt><b class="userinput"><tt>make revert
</tt></b></pre><p>if you find this version a disaster!</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2619266"></a>Compiling Samba with Active Directory Support</h3></div></div></div><p>In order to compile Samba with ADS support, you need to have installed
on your system:</p><div class="itemizedlist"><ul type="disc"><li><p>The MIT or Heimdal Kerberos development libraries
(either install from the sources or use a package).</p></li><li><p>The OpenLDAP development libraries.</p></li></ul></div><p>If your Kerberos libraries are in a non-standard location, then
remember to add the configure option
<tt class="option">--with-krb5=<i class="replaceable"><tt>DIR</tt></i></tt>.</p><p>After you run configure, make sure that
<tt class="filename">include/config.h</tt> it generates contain lines like
this:</p><pre class="programlisting">
#define HAVE_KRB5 1
#define HAVE_LDAP 1
</pre><p>If it does not, configure did not find your KRB5 libraries or
your LDAP libraries. Look in <tt class="filename">config.log</tt> to figure
out why and fix it.</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2619332"></a>Installing the Required Packages for Debian</h4></div></div></div><p>On Debian, you need to install the following packages:</p><p>
</p><div class="itemizedlist"><ul type="disc"><li><p>libkrb5-dev</p></li><li><p>krb5-user</p></li></ul></div><p>
</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2619358"></a>Installing the Required Packages for Red Hat Linux</h4></div></div></div><p>On Red Hat Linux, this means you should have at least: </p><p>
</p><div class="itemizedlist"><ul type="disc"><li><p>krb5-workstation (for kinit)</p></li><li><p>krb5-libs (for linking with)</p></li><li><p>krb5-devel (because you are compiling from source)</p></li></ul></div><p>
</p><p>in addition to the standard development environment.</p><p>If these files are not installed on your system, you should check the installation
CDs to find which has them and install the files using your tool of choice. If in doubt
about what tool to use, refer to the Red Hat Linux documentation.</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2619403"></a>SuSE Linux Package Requirements</h4></div></div></div><p>SuSE Linux installs Heimdal packages that may be required to allow you to build
binary packages. You should verify that the development libraries have been installed on
your system.
</p><p>SuSE Linux Samba RPMs support Kerberos. Please refer to the documentation for
your SuSE Linux system for information regarding SuSE Linux specific configuration.
Additionally, SuSE are very active in the maintenance of Samba packages that provide
the maximum capabilities that are available. You should consider using SuSE provided
packages where they are available.
</p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2619428"></a>Starting the <span class="application">smbd</span> and <span class="application">nmbd</span></h2></div></div></div><p>
<a class="indexterm" name="id2619447"></a>
You must choose to start <span class="application">smbd</span> and <span class="application">nmbd</span> either
as daemons or from <span class="application">inetd</span>. Don't try
to do both! Either you can put them in <tt class="filename">
inetd.conf</tt> and have them started on demand
by <span class="application">inetd</span> or <span class="application">xinetd</span>,
or you can start them as
daemons either from the command line or in <tt class="filename">
/etc/rc.local</tt>. See the man pages for details
on the command line options. Take particular care to read
the bit about what user you need to have to start
Samba. In many cases, you must be root.</p><p>The main advantage of starting <span class="application">smbd</span>
and <span class="application">nmbd</span> using the recommended daemon method
is that they will respond slightly more quickly to an initial connection
request.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2619521"></a>Starting from inetd.conf</h3></div></div></div><a class="indexterm" name="id2619527"></a><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The following will be different if
you use NIS, NIS+ or LDAP to distribute services maps.</p></div><p>Look at your <tt class="filename">/etc/services</tt>.
What is defined at port 139/tcp? If nothing is defined,
then add a line like this:</p><pre class="programlisting">netbios-ssn 139/tcp</pre><p>Similarly for 137/udp, you should have an entry like:</p><pre class="programlisting">netbios-ns 137/udp</pre><p>Next, edit your <tt class="filename">/etc/inetd.conf</tt>
and add two lines like this:</p><pre class="programlisting">
netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd
netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd
</pre><p>The exact syntax of <tt class="filename">/etc/inetd.conf</tt>
varies between UNIXes. Look at the other entries in inetd.conf
for a guide. </p><p>
<a class="indexterm" name="id2619604"></a>
Some distributions use xinetd instead of inetd. Consult the
xinetd manual for configuration information.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>Some UNIXes already have entries like netbios_ns
(note the underscore) in <tt class="filename">/etc/services</tt>.
You must edit <tt class="filename">/etc/services</tt> or
<tt class="filename">/etc/inetd.conf</tt> to make them consistent.
</p></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
<a class="indexterm" name="id2619642"></a>
On many systems you may need to use the
<a class="indexterm" name="id2619649"></a>interfaces option in <tt class="filename">smb.conf</tt> to specify the IP
address and netmask of your interfaces. Run
<span class="application">ifconfig</span>
as root if you do not know what the broadcast is for your
net. <span class="application">nmbd</span> tries to determine it at run
time, but fails on some UNIXes.
</p></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Many UNIXes only accept around five
parameters on the command line in <tt class="filename">inetd.conf</tt>.
This means you shouldn't use spaces between the options and
arguments, or you should use a script and start the script
from <span><b class="command">inetd</b></span>.</p></div><p>Restart <span class="application">inetd</span>, perhaps just send
it a HUP. </p><pre class="screen">
<tt class="prompt">root# </tt><b class="userinput"><tt>killall -HUP inetd</tt></b>
</pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2619726"></a>Alternative: Starting <span class="application">smbd</span> as a Daemon</h3></div></div></div><p>
<a class="indexterm" name="id2619740"></a>
To start the server as a daemon, you should create
a script something like this one, perhaps calling
it <tt class="filename">startsmb</tt>.</p><pre class="programlisting">
#!/bin/sh
/usr/local/samba/bin/smbd -D
/usr/local/samba/bin/nmbd -D
</pre><p>Make it executable with <span><b class="command">chmod
+x startsmb</b></span></p><p>You can then run <span><b class="command">startsmb</b></span> by
hand or execute it from <tt class="filename">/etc/rc.local</tt>.
</p><p>To kill it, send a kill signal to the processes
<span class="application">nmbd</span> and <span class="application">smbd</span>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>If you use the SVR4 style init system,
you may like to look at the <tt class="filename">examples/svr4-startup</tt>
script to make Samba fit into that system.</p></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="Appendix.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="Appendix.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="Portability.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">PartVI.Appendixes</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">Chapter39.Portability</td></tr></table></div></body></html>
|