[Samba] Building Samba RPMs on CentOS 7 as an alternative to Sernet packages

John Mulligan phlogistonjohn at asynchrono.us
Sat Jul 9 14:39:26 UTC 2016

On Friday, July 08, 2016 10:22:52 AM Darren Bowen wrote:
> Hi there.
> I'm new to Samba 4 and looking to use it as an alternative to a Microsoft
> Active Directory domain controller. We run on CentOS 7 and I've read that
> the Samba packages for this distro don't support AD due to using MIT
> Kerberos instead of Heimdal. This lead me to trying the Sernet pacakges,
> which work great, but they are restricted to 7.2 for the free version. I'm
> keen not to end up on an unsupported version so have been looking at
> building Samba from source instead.
> I managed to build and install Samba from source without too much trouble,
> it works great but it takes a long time to build and isn't overly suitable
> for our configuration management system (Puppet). I'd prefer to be able to
> build RPMS and install them on any machine (running the same version of
> CentOS), but I'm not sure how to do this or whether it may be beyond my
> level of experise as I don't have any experience building RPM packages.
> I'm looking for some advice on how to build RPMs from source, can I use the
> various packaging scripts which are included with the release (I couldn't
> find any details on how to use these) or do I need to configure the
> packaging system from scratch?

Hi Darren,

I sometimes need to build custom RPM packages of Samba as well as a few other 
things. Generally, what I do is to start with an existing source rpm, either 
from CentOS/RHEL or Fedora and get that rpm building from source (rpmbuild -ba 
path/to/spec). Then depending on how extensively I need to tweak the build 
I'll either be able to get away with just changing arguments to the configure 
script or maybe I'll do that and change some of the %files section. If its 
really extensive there may be some patches that are not part of the original 
source rpm.

In your case you can probably change the configure script arguments to require 
the built-in kerberos and enable ad dc support. Then rpmbuild and see what 
files get generated that are not currently listed in the spec file and add 
them to the appropriate %files sections.

Hope that was useful,
--John M.

More information about the samba mailing list