diff options
| author | Andreas Schneider <asn@cryptomilk.org> | 2012-03-15 14:47:51 +0100 |
|---|---|---|
| committer | Andreas Schneider <asn@cryptomilk.org> | 2012-03-15 14:47:51 +0100 |
| commit | aaa218e6c13ab0783ec5fa4ab7c66b68eade5041 (patch) | |
| tree | 699671dfb8df751d37079672a8701bb86b7cfbe8 | |
| parent | 892ac17395178b871b8d8e19adb1106e484c7950 (diff) | |
| download | samba4-aaa218e6c13ab0783ec5fa4ab7c66b68eade5041.tar.gz samba4-aaa218e6c13ab0783ec5fa4ab7c66b68eade5041.tar.xz samba4-aaa218e6c13ab0783ec5fa4ab7c66b68eade5041.zip | |
More fixes for RHEL6.
| -rw-r--r-- | samba4.spec | 67 |
1 files changed, 61 insertions, 6 deletions
diff --git a/samba4.spec b/samba4.spec index a94512f..777ac30 100644 --- a/samba4.spec +++ b/samba4.spec @@ -12,6 +12,7 @@ %define with_pam_smbpass 0 %define with_talloc 1 %define with_tevent 1 +%define with_tdb 1 %define with_ldb 1 %define with_usrmove 0 @@ -19,6 +20,7 @@ %if 0%{?fedora} > 15 || 0%{?rhel} > 6 %define with_talloc 0 %define with_tevent 0 +%define with_tdb 0 %define with_ldb 0 %endif @@ -97,8 +99,6 @@ BuildRequires: readline-devel BuildRequires: sed BuildRequires: zlib-devel >= 1.2.3 -BuildRequires: libtdb-devel >= %{tdb_version} - %if ! %with_talloc %define libtalloc_version 2.0.6 @@ -119,6 +119,12 @@ BuildRequires: libldb-devel >= %{libldb_version} BuildRequires: pyldb-devel >= %{libldb_version} %endif +%if ! %with_tdb +%define libtdb_version 1.2.9 + +BuildRequires: libtdb-devel >= %{libtdb_version} +%endif + %description Samba is the standard Windows interoperability suite of programs for Linux and Unix. @@ -306,9 +312,10 @@ link against the SMB, RPC and other protocols. %patch2 -p1 -b .session_key %build -%define talloc_lib %nil -%define tevent_lib %nil -%define ldb_lib %nil +%define talloc_lib "" +%define tevent_lib "" +%define tdb_lib "" +%define ldb_lib "" %if ! %with_talloc %define _talloc_lib ,!talloc @@ -318,11 +325,15 @@ link against the SMB, RPC and other protocols. %define _tevent_lib ,!tevent %endif +%if ! %with_tdb +%define _tdb_lib ,!tdb +%endif + %if ! %with_ldb %define _ldb_lib ,!ldb %endif -%define _samba4_libraries heimdal,!tdb,!zlib,!popt%{_talloc_lib}%{_tevent_lib}%{_ldb_lib} +%define _samba4_libraries heimdal,!zlib,!popt%{_talloc_lib}%{_tevent_lib}%{_tdb_lib}%{_ldb_lib} %define _samba4_idmap_modules idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2 %define _samba4_pdb_modules pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4 @@ -417,10 +428,12 @@ install -m644 %{SOURCE7} %{buildroot}%{_sysconfdir}/tmpfiles.d/samba.conf install -d -m 0755 %{buildroot}%{_sysconfdir}/sysconfig install -m 0644 packaging/systemd/samba.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/samba +%if 0%{?rhel} > 6 install -d -m 0755 %{buildroot}%{_unitdir} install -m 0644 packaging/systemd/nmb.service %{buildroot}%{_unitdir}/nmb.service install -m 0644 packaging/systemd/smb.service %{buildroot}%{_unitdir}/smb.service install -m 0644 packaging/systemd/winbind.service %{buildroot}%{_unitdir}/winbind.service +%endif %if 0%{?rhel} == 6 install -d -m 0755 %{buildroot}%{_initrddir} @@ -455,12 +468,32 @@ rm -f %{buildroot}/%{smb_lib}/security/pam_smbpass.so rm -f %{buildroot}%{python_sitelib}/tevent.py %post +%if 0%{?rhel} == 6 +/sbin/chkconfig --add smb +/sbin/chkconfig --add nmb +if [ "$1" -ge "1" ]; then + /sbin/service smb condrestart >/dev/null 2>&1 || : + /sbin/service nmb condrestart >/dev/null 2>&1 || : +fi +exit 0 +%endif + if [ $1 -eq 1 ] ; then # Initial installation /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi %preun +%if 0%{?rhel} == 6 +if [ $1 = 0 ] ; then + /sbin/service smb stop >/dev/null 2>&1 || : + /sbin/service nmb stop >/dev/null 2>&1 || : + /sbin/chkconfig --del smb + /sbin/chkconfig --del nmb +fi +exit 0 +%endif + if [ $1 -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl --no-reload disable smb.service > /dev/null 2>&1 || : @@ -470,12 +503,14 @@ if [ $1 -eq 0 ] ; then fi %postun +%if 0%{?fedora} > 15 || 0%{?rhel} > 6 /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall /bin/systemctl try-restart smb.service >/dev/null 2>&1 || : /bin/systemctl try-restart nmb.service >/dev/null 2>&1 || : fi +%endif %post -n libsmbclient4 -p /sbin/ldconfig @@ -497,11 +532,27 @@ fi /usr/sbin/groupadd -g 88 wbpriv >/dev/null 2>&1 || : %post winbind +%if 0%{?rhel} == 6 +/sbin/chkconfig --add winbind +if [ "$1" -ge "1" ]; then + /sbin/service winbind condrestart >/dev/null 2>&1 || : +fi +exit 0 +%endif + if [ "$1" -ge "1" ]; then /bin/systemctl try-restart winbind.service >/dev/null 2>&1 || : fi %preun winbind +%if 0%{?rhel} == 6 +if [ $1 = 0 ] ; then + /sbin/service winbind stop >/dev/null 2>&1 || : + /sbin/chkconfig --del winbind +fi +exit 0 +%endif + if [ $1 = 0 ] ; then /bin/systemctl stop winbind.service >/dev/null 2>&1 || : /bin/systemctl disable winbind.service @@ -533,8 +584,10 @@ rm -rf %{buildroot} %{_libdir}/samba/auth %{_libdir}/samba/idmap %{_libdir}/samba/vfs +%if 0%{?rhel} > 6 %{_unitdir}/nmb.service %{_unitdir}/smb.service +%endif %config(noreplace) %{_sysconfdir}/logrotate.d/samba %config(noreplace) %{_sysconfdir}/pam.d/samba %attr(0700,root,root) %dir /var/log/samba @@ -737,7 +790,9 @@ rm -rf %{buildroot} %ghost %dir /var/run/winbindd %attr(750,root,wbpriv) %dir /var/lib/samba/winbindd_privileged %config(noreplace) %{_sysconfdir}/security/pam_winbind.conf +%if 0%{?rhel} > 6 %{_unitdir}/winbind.service +%endif #%{_mandir}/man1/ntlm_auth.1* #%{_mandir}/man1/wbinfo.1* #%{_mandir}/man5/pam_winbind.conf.5* |
