File samba-tng.spec of Package samba-tng
%define initdir %(for i in /etc/init.d/ /etc/rc.d/init.d/; do if [ -d $i ]; then ( cd $i; /bin/pwd ); break; fi; done)
#%define auth %(test -f /etc/pam.d/system-auth && echo /etc/pam.d/system-auth || echo)
%define SED %(which sed || echo "/bin/sed")
Summary: The Samba-Tng SMB server.
Name: samba-tng
Version: 0.4.99cvs
Release: 1
License: GNU GPL Version 2
Group: System Environment/Daemons
URL: http://www.samba-tng.org/
Packager: Samba-TNG Team <packaging@samba-tng.org>
Source: %{name}_%{version}.orig.tar.gz
Requires: %{initdir} samba-tng-common = %{version}
Requires: logrotate >= 3.4
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Prereq: /sbin/chkconfig /bin/mktemp /usr/bin/killall %{SED}
Prereq: fileutils
####################
# opensuse, suse and sles (see http://en.opensuse.org/Build_Service/cross_distribution_package_how_to)
%if 0%{?suse_version}
BuildRequires: readline-devel, ncurses-devel, fileutils, openldap2-devel, tcpd-devel, db-devel, glib2-devel, automake, autoconf, pam-devel
%if 0%{?suse_version} > 1030
# this matches for 930-1030, others are not tested
BuildRequires: yodl
%endif
#suse if
%endif
####################
# fedora
%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version}
BuildRequires: readline-devel, ncurses-devel, coreutils, openldap-devel, openssl-devel, tcp_wrappers, db4-devel, glib2-devel, automake17, autoconf, pam-devel, gcc-c++
%endif
# newer versions of Fedora must have the devel Package for tcpwrapper
%if 0%{?fedora_version} > 6
BuildRequires: tcp_wrappers-devel
%endif
####################
# mandriva
%if 0%{?mandriva_version}
BuildRequires: libreadline5-devel, libncurses5-devel, coreutils, libldap2.3_0-devel, libglib2.0_0-devel, automake, autoconf, gcc-c++
%if 0%{?mandriva_version} == 2006
BuildRequires: libopenssl0.9.7-devel, tcp_wrappers-devel, libdb4.3-devel, libpam0-devel
%endif
%if 0%{?mandriva_version} == 2007
BuildRequires: libopenssl0.9.8-devel, libwrap0-devel, libdb4.2-devel, libpam0-devel
%endif
%if 0%{?mandriva_version} == 2008
BuildRequires: libpam-devel, libwrap0-devel, libopenssl0.9.8-devel, libdb4.2-devel
%endif
%endif
# Disable autostripping
%define __os_install_post /usr/lib/rpm/brp-compress
%description
Samba-TNG is a fork of the Samba codebase whose goal is to provide the complete functionality of a Windows NT domain controller.
Like Samba, Samba-TNG can also act as a file and print server for LanManager clients such as MS-DOS, OS/2, MS-Windows, Windows NT and Windows 2000, and as a WINS (Windows Internet Name Service) server.
%package client
Summary: Samba (SMB) client programs.
Group: Applications/System
Requires: samba-tng-common = %{version}
Provides: samba-client
%description client
The samba-tng-client package provides some SMB clients to compliment the
built-in SMB filesystem in Linux. These clients allow access of SMB
shares and printing to SMB printers.
#%package winbind
#Summary: Samba (SMB) winbind programs.
#Group: Applications/System
#Requires: samba-tng-common = %{version}
#
#%description winbind
#Winbind unifies UNIX and Windows NT account management by allowing a
#UNIX box to become a full member of a NT domain. Once this is done the
#UNIX box will see NT users and groups as if they were native UNIX
#users and groups, allowing the NT domain to be used in much the same
#manner that NIS+ is used within UNIX-only environments.
#
#The end result is that whenever any program on the UNIX machine asks
#the operating system to lookup a user or group name, the query will be
#resolved by asking the NT domain controller for the specified domain to
#do the lookup. Because Winbind hooks into the operating system at a low
#level (via the NSS name resolution modules in the C library) this redirection
#to the NT domain controller is completely transparent.
#
#Users on the UNIX machine can then use NT user and group names as they
#would use "native" UNIX names. They can chown files so that they are owned
#by NT domain users or even login to the UNIX machine and run a UNIX X-Window
#session as a domain user.
#
#The only obvious indication that Winbind is being used is that user and group
#names take the form DOMAIN\user and DOMAIN\group. This is necessary as it
#allows Winbind to determine that redirection to a domain controller is
#wanted for a particular lookup and which trusted domain is being referenced.
#
#Additionally, Winbind provides an authentication service that hooks into
#the Pluggable Authentication Modules (PAM) system to provide authentication
#via a NT domain to any PAM enabled applications. This capability solves
#the problem of synchronizing passwords between systems since all passwords
#are stored in a single location (on the domain controller).
%package common
Summary: Files used by both Samba servers and clients.
Group: Applications/System
%description common
Samba-tng-common provides files necessary for both the server, client
and windbind packages of Samba.
%prep
%setup -q
%build
%ifarch i386 sparc
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
%endif
PWD=`pwd`
SOURCE=$PWD/source
BUILD=$PWD/build
echo 0%{?centos_version}
[ -f $SOURCE/configure ] || (cd $SOURCE; ./autogen.sh)
mkdir -p $BUILD; cd $BUILD
CFLAGS="$RPM_OPT_FLAGS -Wall -ggdb" $SOURCE/configure \
--prefix=%{_prefix} \
--libdir=%{_libdir}/samba-tng \
--datadir=%{_datadir}/samba-tng \
--mandir=%{_mandir} \
--sysconfdir=%{_sysconfdir}/samba-tng \
--with-privatedir=%{_sysconfdir}/samba-tng \
--localstatedir=%{_localstatedir}/lib/samba-tng \
--with-tmpdir=%{_localstatedir}/run/samba-tng \
--with-logdir=%{_localstatedir}/log/samba-tng \
--with-syslog --with-utmp \
--with-passdb=ldap,smbpass --with-tcpwrappers \
%ifos aix
--disable-shared \
%endif
--without-cups || cat config.log
make all bin/tdbtool # nsswitch smbtorture rpctorture debug2html
%install
rm -rf $RPM_BUILD_ROOT
PWD=`pwd`
SOURCE=$PWD/source
BUILD=$PWD/build
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/samba-tng \
$RPM_BUILD_ROOT/%{_sysconfdir}/samba-tng/netlogon \
$RPM_BUILD_ROOT/%{_sysconfdir}/pam.d \
$RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily \
$RPM_BUILD_ROOT/%{_sysconfdir}/cron.weekly \
$RPM_BUILD_ROOT/%{_sysconfdir}/openldap/schema \
$RPM_BUILD_ROOT/%{initdir} \
$RPM_BUILD_ROOT/lib/security
make -C $BUILD DESTDIR="$RPM_BUILD_ROOT" install
# Install other stuff not installed by "make install"
install -m 0755 $SOURCE/script/mksmbpasswd.sh $RPM_BUILD_ROOT/%{_sbindir}/mksmbpasswd
#install -m 0755 $SOURCE/smbadduser $RPM_BUILD_ROOT/%{_sbindir}/smbadduser
#install -m 0755 examples/printing/smbprint $RPM_BUILD_ROOT/%{_bindir}/smbprint
install -m 0644 ldap/sambatng.schema-v3 $RPM_BUILD_ROOT/%{_sysconfdir}/openldap/schema/samba-tng.schema
#install -m 0755 $BUILD/bin/smbtorture $RPM_BUILD_ROOT/%{_bindir}/
# Install man pages for files without man pages in the upstream dist.
install -m 0644 debian/man/addtosmbpass.8 $RPM_BUILD_ROOT/%{_mandir}/man8/addtosmbpass.8
install -m 0644 debian/man/mksmbpasswd.8 $RPM_BUILD_ROOT/%{_mandir}/man8/mksmbpasswd.8
# Install some basic winbind things
#install -m 0755 $BUILD/bin/winbindd $RPM_BUILD_ROOT/%{_sbindir}/
#install -m 0755 $BUILD/bin/wbinfo $RPM_BUILD_ROOT/%{_bindir}/
#install -m 0755 $BUILD/nsswitch/libnss_winbind.so $RPM_BUILD_ROOT/lib/
#install -m 0755 $BUILD/nsswitch/pam_winbind.so $RPM_BUILD_ROOT/lib/security/
##ln -s libnss_winbind.so $RPM_BUILD_ROOT/lib/libnss_winbind.so.2
# Install conffiles
install -m 0644 examples/smb.conf.example $RPM_BUILD_ROOT/%{_sysconfdir}/samba-tng/smb.conf
install -m 0644 examples/smb.conf.example $RPM_BUILD_ROOT/%{_sysconfdir}/samba-tng/smb.conf.example
#install -m 0644 debian/etc/pam.d $RPM_BUILD_ROOT/%{_sysconfdir}/pam.d/samba-tng
#install -m 0755 debian/etc/cron.daily $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily/samba-tng
#install -m 0755 debian/etc/cron.weekly $RPM_BUILD_ROOT/%{_sysconfdir}/cron.weekly/samba-tng
install -m 0755 $BUILD/script/samba-init.d $RPM_BUILD_ROOT/%{initdir}/samba-tng
echo 127.0.0.1 localhost > $RPM_BUILD_ROOT/%{_sysconfdir}/samba-tng/lmhosts
# remove this or it ends up in %doc
rm -rf docs/{manpages,yodldocs}
rm -rf docs/faq/*sgml
# remove html'ized man pages:
#rm -rf docs/htmldocs/*.[0-9].*
# q+d fix for rpm4
rm $RPM_BUILD_ROOT/%{_bindir}/regedit
rm $RPM_BUILD_ROOT/%{_mandir}/man1/debug2html.1*
rm $RPM_BUILD_ROOT/%{_mandir}/man1/regedit.1*
rm $RPM_BUILD_ROOT/%{_mandir}/man1/smbrun*
# rm $RPM_BUILD_ROOT/%{_mandir}/man1/testprns.1*
#rm $RPM_BUILD_ROOT/%{_mandir}/man1/make_smbcodepage.1*
rm $RPM_BUILD_ROOT/%{_mandir}/man1/wbinfo.1*
rm $RPM_BUILD_ROOT/%{_mandir}/man8/smbmnt.8*
rm $RPM_BUILD_ROOT/%{_mandir}/man8/smbmount.8*
rm $RPM_BUILD_ROOT/%{_mandir}/man8/smbpasswd.8*
rm $RPM_BUILD_ROOT/%{_mandir}/man8/smbspool.8*
rm $RPM_BUILD_ROOT/%{_mandir}/man8/smbumount.8*
rm $RPM_BUILD_ROOT/%{_mandir}/man8/swat.8*
rm $RPM_BUILD_ROOT/%{_mandir}/man8/winbindd.8*
%clean
rm -rf $RPM_BUILD_ROOT
%post
/sbin/chkconfig --add samba-tng
%preun
if [ $1 = 0 ] ; then
%{initdir}/samba-tng stop
/sbin/chkconfig --del samba-tng
rm -rf \
%{_localstatedir}/log/samba-tng/* \
%{_localstatedir}/run/samba-tng/*
fi
exit 0
%postun
if [ "$1" -ge "1" ]; then
%{initdir}/samba-tng restart
fi
#%post winbind
##/sbin/chkconfig --add winbind
#
#%preun winbind
##if [ $1 = 0 ] ; then
## /sbin/chkconfig --del winbind
## /sbin/service winbind stop >/dev/null 2>&1
##fi
#exit 0
%files
%defattr(-,root,root)
%{_sbindir}/smbd
%{_mandir}/man8/smbd.8*
%{_sbindir}/lsarpcd
%{_mandir}/man8/lsarpcd.8*
%{_sbindir}/samrd
%{_mandir}/man8/samrd.8*
%{_sbindir}/netlogond
%{_mandir}/man8/netlogond.8*
%{_sbindir}/srvsvcd
%{_mandir}/man8/srvsvcd.8*
%{_sbindir}/wkssvcd
%{_mandir}/man8/wkssvcd.8*
%{_sbindir}/browserd
%{_mandir}/man8/browserd.8*
%{_sbindir}/winregd
%{_mandir}/man8/winregd.8*
%{_sbindir}/svcctld
%{_mandir}/man8/svcctld.8*
%{_sbindir}/spoolssd
%{_mandir}/man8/spoolssd.8*
%{_sbindir}/nmbd
%{_mandir}/man8/nmbd.8*
%config(noreplace) %{initdir}/samba-tng
#%config(noreplace) %{_sysconfdir}/pam.d/samba-tng
#%config(noreplace) %{_sysconfdir}/cron.daily/samba-tng
#%config(noreplace) %{_sysconfdir}/cron.weekly/samba-tng
%config(noreplace) %{_sysconfdir}/openldap/schema/samba-tng.schema
%{_bindir}/smbstatus
%{_mandir}/man1/smbstatus.1*
%{_bindir}/testparm
%{_mandir}/man1/testparm.1*
# %{_bindir}/testprns
# %{_mandir}/man1/testprns.1*
%{_sbindir}/mksmbpasswd
%{_mandir}/man8/mksmbpasswd.8*
#%{_sbindir}/smbadduser
# missing man for smbadduser
%{_bindir}/addtosmbpass
%{_mandir}/man8/addtosmbpass.8*
#%{_mandir}/man1/debug2html.1*
%{_bindir}/tdbimport
%{_bindir}/tdbexport
%{_bindir}/tdbbackup
%{_bindir}/tdbtool
%dir %{_localstatedir}/log/samba-tng
%dir %{_localstatedir}/run/samba-tng
#%files winbind
#%defattr(-,root,root)
#/lib/security/pam_winbind.so
#/lib/libnss_winbind.so
#%{_sbindir}/winbindd
#%{_bindir}/wbinfo
##%{initdir}/winbind
#%{_mandir}/man8/winbindd.8*
#%{_mandir}/man1/wbinfo.1*
%files client
%defattr(-,root,root)
%{_bindir}/cmdat
# manpage missing for cmdat
# %{_bindir}/net
# manpage missing for net
%{_bindir}/nmblookup
%{_mandir}/man1/nmblookup.1*
%{_bindir}/ntspool
# Missing manpage maybe %{_mandir}/man8/smbspool.8*
#%{_bindir}/regedit
#%{_mandir}/man1/regedit.1*
%{_bindir}/rpcclient
%{_mandir}/man8/rpcclient.8*
%{_bindir}/samedit
%{_mandir}/man8/samedit.8*
%{_bindir}/smbclient
%{_mandir}/man1/smbclient.1*
%{_bindir}/smbtar
%{_mandir}/man1/smbtar.1*
%{_bindir}/smbsend
%{_mandir}/man1/smbsend.1*
%{_bindir}/svccontrol
# manpage missing for svccontrol
#%{_bindir}/smbprint
#%{_mandir}/man8/smbmnt.8*
#%{_mandir}/man8/smbmount.8*
#%{_mandir}/man8/smbumount.8*
%files common
%defattr(-,root,root)
%doc COPYING INSTALL Manifest NEWS README ROADMAP
%doc docs
%doc examples
%doc ldap/basic-users.ldif
%doc ldap/slapd.conf.example
%doc ldap/ldap.conf.example
%doc docs/textdocs/SETUP-with-ldap.txt
%dir %{_libdir}/samba-tng
%{_libdir}/samba-tng/*.so*
%{_libdir}/samba-tng/*.la
%{_mandir}/man7/samba.7*
#%{_mandir}/man8/smbpasswd.8*
#%{_mandir}/man8/swat.8*
#%{_mandir}/man1/smbrun.1*
%{_mandir}/man5/*
%dir %{_sysconfdir}/samba-tng
%dir %{_sysconfdir}/samba-tng/netlogon
%config(noreplace) %{_sysconfdir}/samba-tng/smb.conf
%{_sysconfdir}/samba-tng/smb.conf.example
%config(noreplace) %{_sysconfdir}/samba-tng/lmhosts
# %{_bindir}/make_smbcodepage
# %{_mandir}/man1/make_smbcodepage.1*
# %{_bindir}/make_unicodemap
%{_bindir}/make_printerdef
%dir %{_datadir}/samba-tng/codepages
%{_datadir}/samba-tng/codepages/*
%changelog
* Wed Sep 14 2005 Elrond <elrond@samba-tng.org>
- replace Packager by generic adress
* Wed Apr 20 2005 Elrond <elrond@samba-tng.org>
- init-script fixup
* Thu Jan 22 2003 Joachim Falk <joachim.falk@gmx.de>
- First official samba-tng beta rpm release
* Sun Aug 4 2002 Joachim Falk <joachim.falk@gmx.de>
- Made an rpm for todays cvs version of samba-tng