Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %define main_release 4
- %define samba4_version 4.1.7
- %define tarball_name samba-%{samba4_version}
- %define samba4_release %{main_release}%{?dist}.1
- %define waf_options --verbose -j 4
- # We need a higher talloc release to address previous releases done as
- # part of the samba3 package.
- %{!?python_sys_pyver: %global python_sys_pyver %(/usr/bin/python -c "import sys; print sys.hexversion")}
- # if hex(sys.hexversion) < 0x02060000
- %if %{python_sys_pyver} < 33947648
- %global __python /usr/bin/python2.6
- %endif
- %{!?python_libdir: %define python_libdir %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1,1)")}
- %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
- %define __arch_install_post %{nil}
- # Licensing Note: Some of the libraries are GPLv3+, others are LGPLv3+.
- # The rest of the code is GPLv3+. Library licensing is still volatile,
- # and subject to change.
- Name: samba4
- Version: %{samba4_version}
- Release: %{samba4_release}
- Group: System Environment/Daemons
- Summary: The Samba4 CIFS and AD client and server suite
- License: GPLv3+ and LGPLv3+
- URL: http://www.samba.org/
- Source: http://download.samba.org/samba/ftp/samba4/%{tarball_name}.tar.gz
- BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
- AutoReqProv: 0
- # Red Hat specific replacement-files
- Source1: %{name}.log
- Source4: %{name}.sysconfig
- Source5: %{name}.init
- #Patch0: %{name}-tdb_jenkins_hash.diff
- #Patch1: %{name}-beta-ndr-fixes.diff
- Requires(pre): /usr/sbin/groupadd
- Requires(post): /sbin/chkconfig, /sbin/service
- Requires(preun): /sbin/chkconfig, /sbin/service
- # Requires(pre): %{name}-common = %{version}-%{release}
- Requires: logrotate
- Requires: pam
- Requires: perl(Parse::Yapp)
- BuildRequires: pkgconfig
- BuildRequires: e2fsprogs-devel
- BuildRequires: libacl-devel
- BuildRequires: libaio-devel
- BuildRequires: libattr-devel
- # BuildRequires: ncurses-devel
- BuildRequires: pam-devel
- BuildRequires: perl(ExtUtils::MakeMaker)
- # BuildRequires: perl(Parse::Yapp)
- BuildRequires: readline-devel
- BuildRequires: sed
- # BuildRequires: autoconf
- BuildRequires: openldap-devel
- BuildRequires: libxslt
- BuildRequires: docbook-style-xsl
- BuildRequires: zlib-devel
- %if 0%{?el5}
- # no popt-devel pkg on el5
- BuildRequires: popt
- %else
- BuildRequires: popt-devel
- %endif
- %if %{python_sys_pyver} < 33947648
- BuildRequires: python26-devel
- %else
- BuildRequires: python-devel
- %endif
- %description
- Samba 4 is the ambitious next version of the Samba suite that is being
- developed in parallel to the stable 3.0 series. The main emphasis in
- this branch is support for the Active Directory logon protocols used
- by Windows 2000 and above.
- %prep
- %setup -q -n %{tarball_name}
- #%patch0 -p1
- #%patch1 -p0
- # copy Red Hat specific scripts
- mv VERSION VERSION.orig
- sed -e 's/SAMBA_VERSION_VENDOR_SUFFIX=$/&%{release}/' < VERSION.orig > VERSION
- #cd source4
- #script/mkversion.sh
- #cd ..
- # make sure the python script use 2.6
- %if %{python_sys_pyver} < 33947648
- for pyscript in source4/scripting/bin/*; do
- mv $pyscript $pyscript.orig
- sed -e 's!/usr/bin/env python!/usr/bin/env python2.6!' <$pyscript.orig >$pyscript
- rm $pyscript.orig
- done
- %endif
- %build
- # originally in install stage
- rm -rf $RPM_BUILD_ROOT
- mkdir tmpbin
- ln -s %{__python} $PWD/tmpbin/python
- export PATH=$PWD/tmpbin:$RPM_BUILD_ROOT/usr/bin:$PATH
- export PKG_CONFIG_PATH=$RPM_BUILD_ROOT%{_libdir}/pkgconfig
- export CPPFLAGS=-I$RPM_BUILD_ROOT/usr/include
- export LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}
- export LDFLAGS=-L$RPM_BUILD_ROOT%{_libdir}
- export PYTHON=%{__python}
- # talloc
- pushd ./lib/talloc
- %configure \
- -C \
- --bundled-libraries=NONE \
- --prefix=/usr \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --disable-rpath-install
- make -j 4 WAF_BINARY="../buildtools/bin/waf %{waf_options}"
- make install DESTDIR=$RPM_BUILD_ROOT
- popd
- # tdb
- pushd ./lib/tdb
- %configure \
- -C \
- --bundled-libraries=NONE \
- --prefix=/usr \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --with-modulesdir=%{_libdir}/modules/samba \
- --disable-rpath-install
- make -j 4 WAF_BINARY="../buildtools/bin/waf %{waf_options}"
- make install DESTDIR=$RPM_BUILD_ROOT
- popd
- # tevent
- pushd ./lib/tevent
- %configure \
- -C \
- --bundled-libraries=NONE \
- --prefix=/usr \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --disable-rpath-install
- make -j 4 WAF_BINARY="../buildtools/bin/waf %{waf_options}"
- make install DESTDIR=$RPM_BUILD_ROOT
- popd
- export PYTHONPATH=$(/bin/ls -d $RPM_BUILD_ROOT%{_libdir}/python2.*/site-packages)
- # ldb
- pushd ./lib/ldb
- %configure \
- -C \
- --bundled-libraries=NONE \
- --prefix=/usr \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --with-modulesdir=%{_libdir}/modules/samba \
- --disable-rpath
- make -j 4 WAF_BINARY="../buildtools/bin/waf %{waf_options}"
- make install DESTDIR=$RPM_BUILD_ROOT
- popd
- # samba
- ./configure \
- -C \
- --enable-fhs \
- --program-prefix= \
- --prefix=/usr \
- --exec-prefix=/usr \
- --bindir=/usr/bin \
- --sbindir=/usr/sbin \
- --sysconfdir=/etc \
- --datadir=/usr/share \
- --includedir=/usr/include \
- --libdir=%{_libdir} \
- --libexecdir=/usr/libexec \
- --localstatedir=/var \
- --mandir=/usr/share/man \
- --infodir=/usr/share/info \
- --enable-socket-wrapper \
- --enable-nss-wrapper \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --with-modulesdir=%{_libdir}/samba4/modules \
- --with-cachedir=/var/cache/samba4 \
- --with-logfilebase=/var/log/samba4 \
- --with-lockdir=/var/lock/samba4 \
- --with-privileged-socket-dir=/var/run/samba4 \
- --with-statedir=/var/lib/samba4 \
- --with-pammodulesdir=/lib/security \
- --with-privatedir=/var/lib/samba4/private \
- --with-piddir=/var/run/samba4 \
- --with-sockets-dir=/var/run/samba4 \
- --with-configdir=/etc/samba4 \
- --disable-rpath-install \
- --enable-debug --enable-selftest
- # Build PIDL for installation into vendor directories before
- # 'make proto' gets to it.
- (cd pidl && %{__perl} Makefile.PL INSTALLDIRS=vendor )
- # Builds using PIDL the IDL and many other things.
- #make proto
- #make everything
- make -j 4 WAF_BINARY="./buildtools/bin/waf %{waf_options}"
- %install
- # Don't call 'make install' as we want to call out to the PIDL
- # install manually.
- pushd ./lib/talloc
- make -j 4 WAF_BINARY="../buildtools/bin/waf %{waf_options}" DESTDIR=$RPM_BUILD_ROOT install
- popd
- pushd ./lib/tdb
- make -j 4 WAF_BINARY="../buildtools/bin/waf %{waf_options}" DESTDIR=$RPM_BUILD_ROOT install
- popd
- pushd ./lib/tevent
- make -j 4 WAF_BINARY="../buildtools/bin/waf %{waf_options}" DESTDIR=$RPM_BUILD_ROOT install
- popd
- pushd ./lib/ldb
- make -j 4 WAF_BINARY="../buildtools/bin/waf %{waf_options}" DESTDIR=$RPM_BUILD_ROOT install
- popd
- make -j 4 WAF_BINARY="./buildtools/bin/waf %{waf_options}" DESTDIR=$RPM_BUILD_ROOT install
- # Undo the PIDL install, we want to try again with the right options.
- rm -rf $RPM_BUILD_ROOT%{_libdir}/perl5
- rm -rf $RPM_BUILD_ROOT%{_datadir}/perl5
- # Install PIDL.
- ( cd pidl && make install_vendor DESTDIR=$RPM_BUILD_ROOT )
- # Clean out crap left behind by the PIDL install.
- find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
- find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;
- # tevent is installed in the wrong libdir, both by the tevent and samba makes
- if [ -d $RPM_BUILD_ROOT/usr/lib64 ]; \
- then \
- rm -rf $RPM_BUILD_ROOT/usr/lib/python*; \
- fi
- # ldb tools load the modules from its own dir and won't find samba4 modules without this
- (cd $RPM_BUILD_ROOT/%{_libdir}/modules/samba/ldb; ln -s ../../../samba4/modules/ldb/ samba)
- mkdir -p $RPM_BUILD_ROOT%{_initrddir}
- mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
- mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
- mkdir -p $RPM_BUILD_ROOT/var/run/%{name}
- mkdir -p $RPM_BUILD_ROOT/var/run/winbindd
- mkdir -p $RPM_BUILD_ROOT/var/run/ntp_signd
- mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}
- mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/winbindd_privileged
- mkdir -p $RPM_BUILD_ROOT/var/log/%{name}/
- mkdir -p $RPM_BUILD_ROOT/var/log/%{name}/old
- mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}
- mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/private
- mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/sysvol
- mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/samba
- # Install other stuff.
- install -m755 %{SOURCE5} $RPM_BUILD_ROOT%{_initrddir}/%{name}
- install -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}
- install -m644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
- mkdir -p $RPM_BUILD_ROOT/%{_lib}
- mv $RPM_BUILD_ROOT%{_libdir}/libnss_winbind.so.2 $RPM_BUILD_ROOT/%{_lib}/
- # libs {
- mkdir -p $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_includedir}
- # }
- # Clean out some stuff we don't want in the Fedora package.
- # Avoids a file conflict with perl-Parse-Yapp.
- rm -rf $RPM_BUILD_ROOT%{perl_vendorlib}/Parse/Yapp
- # ld.so.conf
- mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
- echo %{_libdir}/samba > $RPM_BUILD_ROOT/etc/ld.so.conf.d/samba4.conf
- echo %{_libdir}/libsmb >> $RPM_BUILD_ROOT/etc/ld.so.conf.d/samba4.conf
- # This makes the right links, as rpmlint requires that
- # the ldconfig-created links be recorded in the RPM.
- /sbin/ldconfig -N -n $RPM_BUILD_ROOT%{_libdir}
- /sbin/ldconfig -N -n $RPM_BUILD_ROOT%{_libdir}/samba
- /sbin/ldconfig -N -n $RPM_BUILD_ROOT%{_libdir}/libsmb
- # Fix up permission on perl install.
- %{_fixperms} $RPM_BUILD_ROOT%{perl_vendorlib}
- # Fix up permissions in source tree, for debuginfo.
- find source4/heimdal -type f | xargs chmod -x
- %clean
- rm -rf $RPM_BUILD_ROOT
- %pre
- getent group wbpriv >/dev/null || groupadd -g 88 wbpriv
- exit 0
- %post
- /sbin/ldconfig
- /sbin/chkconfig --add %{name}
- if [ "$1" -ge "1" ]; then
- /sbin/service %{name} condrestart >/dev/null 2>&1 || :
- fi
- exit 0
- %preun
- if [ $1 = 0 ] ; then
- /sbin/service %{name} stop >/dev/null 2>&1 || :
- /sbin/chkconfig --del %{name}
- fi
- exit 0
- %postun
- /sbin/ldconfig
- %files
- %defattr(-,root,root,-)
- %doc COPYING MAINTAINERS.txt README README.Coding README.cifs-utils README.packaging4 Roadmap VERSION WHATSNEW.txt PFIF.txt
- %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
- %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
- %config %{_sysconfdir}/ld.so.conf.d/samba4.conf
- %attr(0755,root,root) %{_initrddir}/%{name}
- %attr(0700,root,root) %dir /var/log/%{name}
- %attr(0700,root,root) %dir /var/log/%{name}/old
- %attr(750,root,wbpriv) %dir /var/lib/%{name}/winbindd_privileged
- %attr(755,root,root) %{_bindir}/*
- %attr(755,root,root) %{_sbindir}/*
- %attr(755,root,root) /var/*
- %{_includedir}/*
- %{_libdir}/*
- %{_datadir}/*
- %attr(700,root,root) %dir /var/lib/%{name}/private
- /lib/security/*
- /%{_lib}/*
- %{perl_vendorlib}/*
- %changelog
- * Fri May 09 2014 Mihamina Rakotomandimby <mihamina.rakotomandimby@rktmb.org> 4.1.7-1
- - Build for upstream 4.1.7
- * Mon Sep 24 2012 Jean Raby <jraby@inverse.ca> 4.0.0-4.beta5.1
- - Add dependency on zlib-devel
- * Tue Aug 15 2012 Jean Raby <jraby@inverse.ca> 4.0.0-3.beta5.1
- - re-added build dependencies libacl-devel, libaio-devel, popt-devel and readline-devel
- - Fixed libnss_winbind.so.2 install path
- - override __arch_install_post to avoid calling check-buildroot in mock builds
- This is suboptimal but will have to do for now.
- - fix popt dependency on el5
- * Tue Aug 14 2012 Jean Raby <jraby@inverse.ca> 4.0.0-2.beta5.1
- - added symlink for samba ldb modules
- - sed replace python -> python2.6 on distro using 2.4 by default
- * Mon Aug 06 2012 Jean Raby <jraby@inverse.ca> 4.0.0-1.beta5.1
- - Update package to beta5
- - enabled tdb2 since --disable-tdb2 has been removed
- - drop --enable-developer
- - merge spec files for rhel6 and rhel5 (python deps)
- - tevent is now installed under python_libdir, remove workaround
- * Wed Oct 12 2011 Wolfgang Sourdeau <wsourdeau@inverse.ca> 4.0.0-25.alpha17.1
- - Update package to alpha17
- - Buid everything unconditionnally
- * Mon Aug 29 2011 Stephen Gallagher <sgallagh@redhat.com> - 4.0.0-25.alpha11.5
- - Rebuild against fixed libtalloc version
- * Mon Aug 29 2011 Stephen Gallagher <sgallagh@redhat.com> - 4.0.0-25.alpha11.4
- - Rebuild against fixed libtevent version
- * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.0-25.alpha11.1
- - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
- * Sun Aug 01 2010 Matthew Barnes <mbarnes@redhat.com> - 4.0.0-25.alpha11
- - Fix typo (RH bug #619946).
- * Mon Jun 28 2010 Ralf Corsépius <corsepiu@fedoraproject.org> - 4.0.0-24.alpha11
- - Revert changes to %%Release, use %%main_release instead.
- - Rebuild for perl-5.12.x.
- * Mon Jun 28 2010 Ralf Corsépius <corsepiu@fedoraproject.org> - 4.0.0-23.alpha11.2
- - Once again rebuild for perl-5.12.x.
- * Wed Jun 02 2010 Marcela Maslanova <mmaslano@redhat.com> - 4.0.0-23.alpha11.1
- - Mass rebuild with perl-5.12.0
- * Wed Feb 24 2010 Stephen Gallagher <sgallagh@redhat.com> - 4.0.0-23.alpha11
- - Rebuild against newer libtevent
- * Sun Jan 24 2010 Matthew Barnes <mbarnes@redhat.com> - 4.0.0-22.alpha11
- - Upgrade to alpha11
- * Fri Jan 08 2010 Matthew Barnes <mbarnes@redhat.com> - 4.0.0-21.alpha10
- - Bump ldb_version to 0.9.10.
- * Fri Jan 08 2010 Matthew Barnes <mbarnes@redhat.com> - 4.0.0-20.alpha10
- - Only install new command-line utilities if enable_samba4 is non-zero.
- * Wed Jan 06 2010 Matthew Barnes <mbarnes@redhat.com> - 4.0.0-19.alpha10
- - Upgrade to alpha10
- * Thu Sep 17 2009 Simo Sorce <ssorce@redhat.com> - 4.0.0-18.1.alpha8_git20090916
- - Need docbook stuff to build man pages
- * Thu Sep 17 2009 Simo Sorce <ssorce@redhat.com> - 4.0.0-18.alpha8_git20090916
- - Fix broken dependencies
- * Wed Sep 16 2009 Simo Sorce <ssorce@redhat.com> - 4.0.0-17.alpha8_git20090916
- - Upgrade to alpha8-git20090916
- * Wed Sep 16 2009 Simo Sorce <ssorce@redhat.com> - 4.0.0-16.alpha7
- - Stop building libtevent, it is now an external package
- * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.0-15.2alpha7.1
- - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
- * Fri May 22 2009 Simo Sorce <ssorce@redhat.com> - 4.0.0-15.2alpha7
- - Fix dependency
- * Sat May 09 2009 Simo Sorce <ssorce@redhat.com> - 4.0.0-15.1alpha7
- - Don't build talloc and tdb, they are now separate packages
- * Mon Apr 06 2009 Matthew Barnes <mbarnes@redhat.com> - 4.0.0-14alpha7
- - Fix a build issue in samba4-common (RH bug #494243).
- * Wed Mar 25 2009 Simo Sorce <ssorce@redhat.com> - 4.0.0-13alpha7
- - rebuild with correct CFLAGS (also fixes debuginfo)
- * Tue Mar 10 2009 Simo Sorce <ssorce@redhat.com> - 4.0.0-12alpha7
- - Second part of fix for the ldb segfault problem from upstream
- * Mon Mar 09 2009 Simo Sorce <ssorce@redhat.com> - 4.0.0-11alpha7
- - Add upstream patch to fix a problem within ldb
- * Sun Mar 08 2009 Matthew Barnes <mbarnes@redhat.com> - 4.0.0-10alpha7
- - Remove ldb.pc from samba4-devel (RH bug #489186).
- * Wed Mar 4 2009 Simo Sorce <ssorce@redhat.com> - 4.0.0-9alpha7
- - Make talloc,tdb,tevent,ldb easy to exclude using defines
- - Fix package for non-mock "dirty" systems by deleting additional
- files we are not interested in atm
- * Wed Mar 4 2009 Simo Sorce <ssorce@redhat.com> - 4.0.0-8alpha7
- - Fix typo in Requires
- * Mon Mar 2 2009 Simo Sorce <ssorce@redhat.com> - 4.0.0-7alpha7
- - Compile and have separate packages for additional samba libraries
- Package in their own packages: talloc, tdb, tevent, ldb
- * Fri Feb 27 2009 Matthew Barnes <mbarnes@redhat.com> - 4.0.0-4.alpha7
- - Update to 4.0.0alpha7
- * Wed Feb 25 2009 Matthew Barnes <mbarnes@redhat.com> - 4.0.0-3.alpha6
- - Formal package review cleanups.
- * Mon Feb 23 2009 Matthew Barnes <mbarnes@redhat.com> - 4.0.0-2.alpha6
- - Disable subpackages not needed by OpenChange.
- - Incorporate package review feedback.
- * Mon Jan 19 2009 Matthew Barnes <mbarnes@redhat.com> - 4.0.0-1.alpha6
- - Update to 4.0.0alpha6
- * Wed Dec 17 2008 Matthew Barnes <mbarnes@redhat.com> - 4.0.0-0.8.alpha6.GIT.3508a66
- - Fix another file conflict: smbstatus
- * Fri Dec 12 2008 Matthew Barnes <mbarnes@redhat.com> - 4.0.0-0.7.alpha6.GIT.3508a66
- - Disable the winbind subpackage because it conflicts with samba-winbind
- and isn't needed to support OpenChange.
- * Fri Dec 12 2008 Matthew Barnes <mbarnes@redhat.com> - 4.0.0-0.6.alpha6.GIT.3508a66
- - Update to the GIT revision OpenChange is now requiring.
- * Fri Aug 29 2008 Andrew Bartlett <abartlet@samba.org> - 0:4.0.0-0.5.alpha5.fc10
- - Fix licence tag (the binaries are built into a GPLv3 whole, so the BSD licence need not be mentioned)
- * Fri Jul 25 2008 Andrew Bartlett <abartlet@samba.org> - 0:4.0.0-0.4.alpha5.fc10
- - Remove talloc and tdb dependency (per https://bugzilla.redhat.com/show_bug.cgi?id=453083)
- - Fix deps on chkconfig and service to main pkg (not -common)
- (per https://bugzilla.redhat.com/show_bug.cgi?id=453083)
- * Mon Jul 21 2008 Brad Hards <bradh@frogmouth.ent> - 0:4.0.0-0.3.alpha5.fc10
- - Use --sysconfdir instead of --with-configdir
- - Add patch for C++ header compatibility
- * Mon Jun 30 2008 Andrew Bartlett <abartlet@samba.org> - 0:4.0.0-0.2.alpha5.fc9
- - Update per review feedback
- - Update for alpha5
- * Thu Jun 26 2008 Andrew Bartlett <abartlet@samba.org> - 0:4.0.0-0.1.alpha4.fc9
- - Rework Fedora's Samba 3.2.0-1.rc2.16 spec file for Samba4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement