2073 lines
70 KiB
RPMSpec
2073 lines
70 KiB
RPMSpec
|
#
|
||
|
# spec file for package samba
|
||
|
#
|
||
|
# Copyright (c) 2022 SUSE LLC
|
||
|
#
|
||
|
# All modifications and additions to the file contributed by third parties
|
||
|
# remain the property of their copyright owners, unless otherwise agreed
|
||
|
# upon. The license for this file, and modifications and additions to the
|
||
|
# file, is the same license as for the pristine package itself (unless the
|
||
|
# license for the pristine package is not an Open Source License, in which
|
||
|
# case the license is the MIT License). An "Open Source License" is a
|
||
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||
|
# published by the Open Source Initiative.
|
||
|
|
||
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||
|
#
|
||
|
|
||
|
|
||
|
%{!?py3_soflags: %global py3_soflags cpython-%{python3_version_nodots}m}
|
||
|
%{!?py3_soflags_dash: %global py3_soflags_dash %(echo %{py3_soflags} | sed "s/_/-/g")}
|
||
|
|
||
|
%{!?_fillupdir:%global _fillupdir /var/adm/fillup-templates}
|
||
|
%{!?_tmpfilesdir:%global _tmpfilesdir /usr/lib/tmpfiles.d}
|
||
|
%{!?_pam_moduledir:%global _pam_moduledir /%{_lib}/security}
|
||
|
%if 0%{?suse_version} > 1500
|
||
|
%{!?_pam_vendordir:%global _pam_vendordir %{_prefix}/lib/pam.d}
|
||
|
%global samba_pamdir %_pam_vendordir
|
||
|
%else
|
||
|
%{!?_pam_confdir:%global _pam_confdir %{_sysconfdir}/pam.d}
|
||
|
%global samba_pamdir %_pam_confdir
|
||
|
%endif
|
||
|
%{!?_pam_secconfdir:%global _pam_secconfdir %{_sysconfdir}/security}
|
||
|
|
||
|
%define with_mscat 1
|
||
|
%define build_ctdb_pmda 1
|
||
|
|
||
|
%ifarch aarch64 x86_64
|
||
|
%define build_ceph 1
|
||
|
%endif
|
||
|
|
||
|
%define talloc_version 2.4.2
|
||
|
%define tevent_version 0.16.1
|
||
|
%define tdb_version 1.4.12
|
||
|
|
||
|
# This table represents the possible combinations of build macros.
|
||
|
# They are defined only if not already defined in the build service
|
||
|
# project configuration:
|
||
|
# https://openbuildservice.org/help/manuals/obs-user-guide/cha.obs.prjconfig.html#sec.prjconfig.macros
|
||
|
#
|
||
|
# %with_dc %with_mit_dc %with_mitkrb5
|
||
|
#---------------------------------------------------------
|
||
|
# Heimdal 1 0 0
|
||
|
# With DC
|
||
|
# MIT 1 1 1
|
||
|
#---------------------------------------------------------
|
||
|
# MIT 0 0 1
|
||
|
# No DC
|
||
|
# Heimdal 0 0 0
|
||
|
#---------------------------------------------------------
|
||
|
%{!?with_mitkrb5: %define with_mitkrb5 1}
|
||
|
%{!?with_mit_dc: %define with_mit_dc 1}
|
||
|
# if factory/tw default with_dc to 1 (if not already defined in project config)
|
||
|
%if 0%{?suse_version} > 1500
|
||
|
%{!?with_dc: %define with_dc 1}
|
||
|
%else
|
||
|
%{!?with_dc: %define with_dc 0}
|
||
|
%endif
|
||
|
|
||
|
%global with_lmdb 0
|
||
|
# LMDB only available on 64bit archs
|
||
|
%ifarch x86_64 ppc64le aarch64
|
||
|
# lmdb is only built when ad_dc is configured
|
||
|
%if %{with_dc}
|
||
|
%global with_lmdb 1
|
||
|
%endif
|
||
|
%endif
|
||
|
|
||
|
# Define whether smbd is built with SMB1 disabled
|
||
|
%{!?without_smb1_server: %define without_smb1_server 1}
|
||
|
|
||
|
Name: samba
|
||
|
BuildRequires: autoconf
|
||
|
BuildRequires: cups-devel
|
||
|
BuildRequires: cyrus-sasl-devel
|
||
|
BuildRequires: e2fsprogs-devel
|
||
|
BuildRequires: gcc
|
||
|
BuildRequires: make
|
||
|
BuildRequires: patch
|
||
|
BuildRequires: perl-Parse-Yapp
|
||
|
BuildRequires: libarchive-devel
|
||
|
BuildRequires: libacl-devel
|
||
|
BuildRequires: libattr-devel
|
||
|
BuildRequires: libcmocka-devel
|
||
|
BuildRequires: libuuid-devel
|
||
|
BuildRequires: cracklib-devel
|
||
|
BuildRequires: gdbm-devel
|
||
|
BuildRequires: keyutils-devel
|
||
|
BuildRequires: flex
|
||
|
BuildRequires: bison
|
||
|
BuildRequires: libnscd-devel
|
||
|
BuildRequires: libopenssl-devel
|
||
|
BuildRequires: zlib-devel
|
||
|
BuildRequires: libtirpc-devel
|
||
|
BuildRequires: ncurses-devel
|
||
|
BuildRequires: openldap2-devel
|
||
|
BuildRequires: pam-devel
|
||
|
BuildRequires: popt-devel
|
||
|
BuildRequires: python-rpm-macros
|
||
|
BuildRequires: python3-Markdown
|
||
|
BuildRequires: python3-devel
|
||
|
BuildRequires: python3-dnspython
|
||
|
BuildRequires: python3-xml
|
||
|
BuildRequires: readline-devel
|
||
|
BuildRequires: rpcgen
|
||
|
BuildRequires: fdupes
|
||
|
%define pkgconfig_req pkg-config
|
||
|
BuildRequires: %{pkgconfig_req}
|
||
|
BuildRequires: libtalloc-devel >= %{talloc_version}
|
||
|
BuildRequires: libtdb-devel >= %{tdb_version}
|
||
|
BuildRequires: libtevent-devel >= %{tevent_version}
|
||
|
BuildRequires: python3-talloc-devel
|
||
|
BuildRequires: python3-tdb
|
||
|
BuildRequires: python3-tevent
|
||
|
# to generate the man pages
|
||
|
BuildRequires: docbook-xsl-stylesheets
|
||
|
BuildRequires: libxslt
|
||
|
BuildRequires: dbus-1-devel
|
||
|
BuildRequires: libxslt-tools
|
||
|
BuildRequires: libavahi-devel
|
||
|
# To only BuildRequire systemd-rpm-macros leads to broken binaries
|
||
|
BuildRequires: pkgconfig(libsystemd)
|
||
|
BuildRequires: pkgconfig(systemd)
|
||
|
%if 0%{?build_ctdb_pmda}
|
||
|
BuildRequires: libpcp-devel
|
||
|
%endif
|
||
|
%if 0%{?build_ceph}
|
||
|
BuildRequires: libcephfs-devel
|
||
|
BuildRequires: librados-devel
|
||
|
%endif
|
||
|
BuildRequires: libgnutls-devel >= 3.4.7
|
||
|
%if %{with_dc}
|
||
|
BuildRequires: gpgme-devel
|
||
|
BuildRequires: libjansson-devel
|
||
|
BuildRequires: python3-gpg
|
||
|
BuildRequires: lmdb-devel >= 0.9.16
|
||
|
BuildRequires: lmdb
|
||
|
%if %{with_mit_dc}
|
||
|
BuildRequires: krb5-devel >= 1.15.1
|
||
|
BuildRequires: krb5-server >= 1.15.1
|
||
|
%endif
|
||
|
%else
|
||
|
BuildRequires: krb5-devel
|
||
|
%endif
|
||
|
%if ! %{with_mitkrb5}
|
||
|
BuildRequires: bison
|
||
|
BuildRequires: flex
|
||
|
BuildRequires: perl-JSON
|
||
|
%endif
|
||
|
%if %{with_mscat}
|
||
|
BuildRequires: libgnutls-devel >= 3.5.6
|
||
|
BuildRequires: libtasn1-devel >= 3.8
|
||
|
%if 0%{?suse_version} > 1500
|
||
|
BuildRequires: libtasn1-tools
|
||
|
%endif
|
||
|
%endif
|
||
|
# liburing not yet available for all Factory architectures
|
||
|
%ifnarch ppc armv6l armv7l
|
||
|
BuildRequires: liburing-devel
|
||
|
%endif
|
||
|
BuildRequires: sysuser-tools
|
||
|
|
||
|
Version: 4.21.3+git.385.dab50f14578
|
||
|
Release: 0
|
||
|
URL: https://www.samba.org/
|
||
|
Obsoletes: samba-32bit < %{version}
|
||
|
Obsoletes: samba-gplv3 < %{version}
|
||
|
Recommends: cron
|
||
|
Recommends: logrotate
|
||
|
Summary: A SMB/CIFS File, Print, and Authentication Server
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Productivity/Networking/Samba
|
||
|
Source: samba-%{version}.tar.bz2
|
||
|
Source4: baselibs.conf
|
||
|
Source100: samba-client-rpmlintrc
|
||
|
Requires: /usr/bin/grep
|
||
|
Requires: coreutils
|
||
|
Requires: system-user-nobody
|
||
|
Requires: %{fillup_prereq}
|
||
|
Requires: samba-client >= %{version}
|
||
|
Requires: samba-dcerpc = %{version}
|
||
|
Requires: sysuser-shadow
|
||
|
Provides: group(ntadmin)
|
||
|
|
||
|
%{?systemd_ordering}
|
||
|
%sysusers_requires
|
||
|
|
||
|
# Define some global directories
|
||
|
################################
|
||
|
%define DOCDIR %{_defaultdocdir}/samba
|
||
|
%define DOCBOOKDIR %{_defaultdocdir}/samba/docbook
|
||
|
%define LOGDIR %{_localstatedir}/log/samba
|
||
|
%define LOCKDIR %{_localstatedir}/lib/samba
|
||
|
%define CONFIGDIR %{_sysconfdir}/samba
|
||
|
%define INITDIR %{_sysconfdir}/init.d
|
||
|
%define PIDDIR /run/samba
|
||
|
%define auth_modules auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4
|
||
|
%define idmap_modules idmap_ad,idmap_adex,idmap_hash,idmap_ldap,idmap_rfc2307,idmap_rid,idmap_tdb2
|
||
|
%define pdb_modules pdb_tdbsam,pdb_ldapsam,pdb_smbpasswd,pdb_samba_dsdb
|
||
|
%define vfs_modules vfs_cacheprime,vfs_readahead
|
||
|
%define VENDOR SUSE
|
||
|
%define cups_lib_dir %{_prefix}/lib/cups
|
||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||
|
|
||
|
%description
|
||
|
Samba is a suite of programs that allows SMB/CIFS clients to use the
|
||
|
Unix file space, printers, and authentication subsystem.
|
||
|
|
||
|
The package named samba contains all programs that are needed to act as
|
||
|
a server. The binaries expect the configuration file to be found in
|
||
|
/etc/samba/smb.conf
|
||
|
|
||
|
For a more detailed description of Samba, check the samba-doc package
|
||
|
or the Samba.org Web page at https://www.Samba.org/
|
||
|
|
||
|
Please check https://en.openSUSE.org/Samba for general information on
|
||
|
Samba as part of SUSE Linux Enterprise or openSUSE products, links to
|
||
|
binary packages of the most current Samba version, and a bug reporting
|
||
|
how to.
|
||
|
|
||
|
%package client
|
||
|
Summary: Samba Client Utilities
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Productivity/Networking/Samba
|
||
|
Provides: smbfs
|
||
|
Obsoletes: samba-client-gplv2 < %{version}
|
||
|
Obsoletes: samba-gplv3-client < %{version}
|
||
|
Requires(post): /sbin/ldconfig
|
||
|
Requires(postun):/sbin/ldconfig
|
||
|
Recommends: cifs-utils
|
||
|
Requires: coreutils
|
||
|
|
||
|
%description client
|
||
|
Samba is a suite of programs that allows SMB/CIFS clients to use the
|
||
|
Unix file space, printers, and authentication subsystem.
|
||
|
|
||
|
The package named samba-client contains all programs that are needed to
|
||
|
act as a Samba client. The binaries expect the configuration file to
|
||
|
be found in /etc/samba/smb.conf
|
||
|
|
||
|
For a more detailed description of Samba, check the samba-doc package
|
||
|
or the Samba.org Web page at https://www.Samba.org/
|
||
|
|
||
|
Please check https://en.openSUSE.org/Samba for general information on
|
||
|
Samba as part of SUSE Linux Enterprise or openSUSE products, links to
|
||
|
binary packages of the most current Samba version, and a bug reporting
|
||
|
how to.
|
||
|
|
||
|
%package devel
|
||
|
Summary: Development files shared by Samba subpackages
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Development/Libraries/C and C++
|
||
|
Requires: samba-client-libs
|
||
|
Requires: samba-libs
|
||
|
Requires: samba-winbind-libs
|
||
|
%if %{with_dc}
|
||
|
Requires: samba-ad-dc-libs
|
||
|
%if %{with_mit_dc}
|
||
|
Requires: pkgconfig(krb5)
|
||
|
%endif
|
||
|
%endif
|
||
|
Provides: samba-core-devel = %{version}
|
||
|
Obsoletes: samba-core-devel < %{version}
|
||
|
Provides: libwbclient0-devel = %{version}
|
||
|
Obsoletes: libwbclient0-devel < %{version}
|
||
|
Provides: libdcerpc-samr-devel = %{version}
|
||
|
Obsoletes: libdcerpc-samr-devel < %{version}
|
||
|
Provides: libdcerpc-devel = %{version}
|
||
|
Obsoletes: libdcerpc-devel < %{version}
|
||
|
Provides: libndr-krb5pac-devel = %{version}
|
||
|
Obsoletes: libndr-krb5pac-devel < %{version}
|
||
|
Provides: libndr-nbt-devel = %{version}
|
||
|
Obsoletes: libndr-nbt-devel < %{version}
|
||
|
Provides: libndr-standard-devel = %{version}
|
||
|
Obsoletes: libndr-standard-devel < %{version}
|
||
|
Provides: libndr-devel = %{version}
|
||
|
Obsoletes: libndr-devel < %{version}
|
||
|
Provides: libsamba-credentials-devel = %{version}
|
||
|
Obsoletes: libsamba-credentials-devel < %{version}
|
||
|
Provides: libsamba-errors-devel = %{version}
|
||
|
Obsoletes: libsamba-errors-devel < %{version}
|
||
|
Provides: libsamba-hostconfig-devel = %{version}
|
||
|
Obsoletes: libsamba-hostconfig-devel < %{version}
|
||
|
Provides: libsamba-passdb-devel = %{version}
|
||
|
Obsoletes: libsamba-passdb-devel < %{version}
|
||
|
Provides: libsamba-util-devel = %{version}
|
||
|
Obsoletes: libsamba-util-devel < %{version}
|
||
|
Provides: libsamdb-devel = %{version}
|
||
|
Obsoletes: libsamdb-devel < %{version}
|
||
|
Provides: libsmbconf-devel = %{version}
|
||
|
Obsoletes: libsmbconf-devel < %{version}
|
||
|
Provides: libsmbldap-devel = %{version}
|
||
|
Obsoletes: libsmbldap-devel < %{version}
|
||
|
Provides: libtevent-util-devel = %{version}
|
||
|
Obsoletes: libtevent-util-devel < %{version}
|
||
|
Provides: libsmbclient-devel = %{version}
|
||
|
Obsoletes: libsmbclient-devel < %{version}
|
||
|
Provides: libnetapi-devel = %{version}
|
||
|
Obsoletes: libnetapi-devel < %{version}
|
||
|
Provides: libwbclient-devel = %{version}
|
||
|
Obsoletes: libwbclient-devel < %{version}
|
||
|
Provides: libsamba-policy-devel = %{version}
|
||
|
Obsoletes: libsamba-policy-devel < %{version}
|
||
|
Obsoletes: libsamba-policy-python3-devel < %{version}
|
||
|
|
||
|
%description devel
|
||
|
This package contains the libraries and header files needed to
|
||
|
develop programs which make use of Samba.
|
||
|
|
||
|
%package doc
|
||
|
Summary: Samba Documentation
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Documentation/Other
|
||
|
Requires: coreutils
|
||
|
Requires: findutils
|
||
|
Obsoletes: samba-doc-gplv2 < %{version}
|
||
|
Obsoletes: samba-gplv3-doc < %{version}
|
||
|
BuildArch: noarch
|
||
|
|
||
|
%description doc
|
||
|
This package contains all the Samba documentation as it is not part of
|
||
|
the man pages.
|
||
|
|
||
|
%package client-libs
|
||
|
Summary: Samba client libraries
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Development/Libraries/C and C++
|
||
|
Provides: libsmbclient0 = %{version}
|
||
|
Obsoletes: libsmbclient0 < %{version}
|
||
|
Provides: libndr2 = %{version}
|
||
|
Obsoletes: libndr0 < %{version}
|
||
|
Obsoletes: libndr1 < %{version}
|
||
|
Obsoletes: libndr2 < %{version}
|
||
|
Provides: libsmbldap2 = %{version}
|
||
|
Obsoletes: libsmbldap0 < %{version}
|
||
|
Obsoletes: libsmbldap2 < %{version}
|
||
|
Provides: libsamba-credentials1 = %{version}
|
||
|
Obsoletes: libsamba-credentials0 < %{version}
|
||
|
Obsoletes: libsamba-credentials1 < %{version}
|
||
|
Provides: libdcerpc-binding0 = %{version}
|
||
|
Obsoletes: libdcerpc-binding0 < %{version}
|
||
|
Provides: libndr-krb5pac0 = %{version}
|
||
|
Obsoletes: libndr-krb5pac0 < %{version}
|
||
|
Provides: libndr-nbt0 = %{version}
|
||
|
Obsoletes: libndr-nbt0 < %{version}
|
||
|
Provides: libndr-standard0 = %{version}
|
||
|
Obsoletes: libndr-standard0 < %{version}
|
||
|
Provides: libsamba-util0 = %{version}
|
||
|
Obsoletes: libsamba-util0 < %{version}
|
||
|
Provides: libsamba-errors0 = %{version}
|
||
|
Obsoletes: libsamba-errors0 < %{version}
|
||
|
Provides: libsamba-hostconfig0 = %{version}
|
||
|
Obsoletes: libsamba-hostconfig0 < %{version}
|
||
|
Provides: libtevent-util0 = %{version}
|
||
|
Obsoletes: libtevent-util0 < %{version}
|
||
|
Provides: libnetapi0 = %{version}
|
||
|
Obsoletes: libnetapi0 < %{version}
|
||
|
Provides: libsamba-passdb0 = %{version}
|
||
|
Obsoletes: libsamba-passdb0 < %{version}
|
||
|
Provides: libsamdb0 = %{version}
|
||
|
Obsoletes: libsamdb0 < %{version}
|
||
|
Provides: libwbclient0 = %{version}
|
||
|
Obsoletes: libwbclient0 < %{version}
|
||
|
Provides: libsmbconf0 = %{version}
|
||
|
Obsoletes: libsmbconf0 < %{version}
|
||
|
Provides: libdcerpc0 = %{version}
|
||
|
Obsoletes: libdcerpc0 < %{version}
|
||
|
Obsoletes: libsamba-policy0-python3 < %{version}
|
||
|
|
||
|
%description client-libs
|
||
|
The samba-libs package contains the libraries needed by samba client
|
||
|
programs.
|
||
|
|
||
|
%package libs
|
||
|
Summary: Samba libraries
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Development/Libraries/C and C++
|
||
|
Requires: samba-client-libs = %{version}
|
||
|
Recommends: samba-libs-python3 = %{version}
|
||
|
Provides: libdcerpc-samr0 = %{version}
|
||
|
Obsoletes: libdcerpc-samr0 < %{version}
|
||
|
|
||
|
%description libs
|
||
|
The samba-libs package contains the libraries needed by programs that
|
||
|
link against the SMB, RPC and other protocols provided by the Samba suite.
|
||
|
|
||
|
%package libs-python3
|
||
|
Summary: Python3 dependencies of samba-libs
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Development/Libraries/C and C++
|
||
|
Requires: python3
|
||
|
|
||
|
%description libs-python3
|
||
|
Dependencies of samba-libs that require python3.
|
||
|
|
||
|
%package python3
|
||
|
Summary: Samba Python3 libraries
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Development/Libraries/Python
|
||
|
Requires: %{name} = %{version}
|
||
|
Requires: python3-ldb
|
||
|
Requires: python3-talloc
|
||
|
Requires: python3-tdb
|
||
|
Requires: python3-tevent
|
||
|
|
||
|
%description python3
|
||
|
The samba-python3 package contains the Python libraries needed by programs
|
||
|
that use SMB, RPC and other Samba provided protocols in Python3 programs.
|
||
|
|
||
|
%package gpupdate
|
||
|
Summary: Samba Group Policy
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Productivity/Networking/Samba
|
||
|
Requires: cepces
|
||
|
Requires: certmonger
|
||
|
Requires: samba-ldb-ldap = %{version}
|
||
|
Requires: samba-python3 = %{version}
|
||
|
Requires: sscep
|
||
|
|
||
|
%description gpupdate
|
||
|
The samba-gpupdate package provides the samba-gpupdate tool for applying
|
||
|
Group Policies on a Samba client.
|
||
|
|
||
|
%package ldb-ldap
|
||
|
Summary: Samba Ldb Ldap Modules
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Productivity/Networking/Samba
|
||
|
|
||
|
%description ldb-ldap
|
||
|
samba-ldb-ldap contains the ldb ldap module required by samba-tool and
|
||
|
samba-gpupdate.
|
||
|
|
||
|
%package test
|
||
|
Summary: Testing tools for Samba servers and clients
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Applications/System
|
||
|
Requires: samba = %{version}
|
||
|
Requires: samba-winbind = %{version}
|
||
|
|
||
|
%description test
|
||
|
samba-test provides testing tools for both the server and client
|
||
|
packages of Samba.
|
||
|
|
||
|
%package winbind
|
||
|
Summary: Winbind Daemon and Tool
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Productivity/Networking/Samba
|
||
|
Obsoletes: samba-gplv3-winbind < %{version}
|
||
|
Provides: samba-client:/usr/sbin/winbindd
|
||
|
Provides: group(winbind)
|
||
|
Requires: pam-config
|
||
|
Recommends: /usr/sbin/nscd
|
||
|
Recommends: cron
|
||
|
Recommends: logrotate
|
||
|
Requires: coreutils
|
||
|
Requires: samba-client = %{version}
|
||
|
Requires: samba-winbind-libs = %{version}
|
||
|
Requires: samba-dcerpc = %{version}
|
||
|
Recommends: samba-gpupdate = %{version}
|
||
|
Requires: sysuser-shadow
|
||
|
|
||
|
Requires(post): /sbin/ldconfig
|
||
|
Requires(postun):/sbin/ldconfig
|
||
|
|
||
|
%description winbind
|
||
|
This is the winbind-daemon and the wbinfo-tool.
|
||
|
|
||
|
%package winbind-libs
|
||
|
Summary: Winbind Daemon libraries
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Development/Libraries/C and C++
|
||
|
Requires: samba-client-libs = %{version}
|
||
|
|
||
|
Requires(post): /sbin/ldconfig
|
||
|
Requires(postun):/sbin/ldconfig
|
||
|
|
||
|
%description winbind-libs
|
||
|
This package contains the libraries required by the Winbind daemon.
|
||
|
|
||
|
%package dcerpc
|
||
|
Summary: Samba dcerpc service binaries
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: System/Daemons
|
||
|
|
||
|
%description dcerpc
|
||
|
This packages contains the binaries for the DCE/RPC endpoint servers.
|
||
|
|
||
|
%package -n ctdb
|
||
|
Summary: Clustered TDB
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: System/Daemons
|
||
|
Requires(pre): %{?fillup_prereq}
|
||
|
BuildRequires: systemd-rpm-macros
|
||
|
# bnc886095: The CTDB resource agent could be split out into a separate rpm,
|
||
|
# with corresponding ctdb and tdb-tools requirements. Until then, just add the
|
||
|
# tdb-tools requirement to ctdb.
|
||
|
Requires: tdb-tools
|
||
|
Requires(pre): coreutils
|
||
|
Requires(pre): /bin/mktemp
|
||
|
Requires(pre): /usr/bin/killall
|
||
|
Requires(pre): /usr/bin/sed
|
||
|
Provides: ctdb-tests = %{version}
|
||
|
Obsoletes: ctdb-tests <= %{version}
|
||
|
|
||
|
%description -n ctdb
|
||
|
ctdb is the clustered database used by Samba
|
||
|
|
||
|
%package -n ctdb-pcp-pmda
|
||
|
Summary: Performance Co-Pilot (PCP) monitoring agent
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: System/Monitoring
|
||
|
|
||
|
%description -n ctdb-pcp-pmda
|
||
|
The CTDB Performance Co-Pilot (PCP) monitoring agent allows remote PCP
|
||
|
clients to view and capture detailed real-time performance metrics for
|
||
|
one or more cluster nodes.
|
||
|
|
||
|
%package ceph
|
||
|
Summary: Ceph specific add-ons for Samba
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Productivity/Networking/Samba
|
||
|
Requires: samba = %{version}
|
||
|
|
||
|
%description ceph
|
||
|
The Ceph VFS module for Samba allows shares to be backed by the Ceph
|
||
|
distributed file system. A Ceph CTDB lock helper binary is included so
|
||
|
that RADOS locks can be used for CTDB split-brain avoidance.
|
||
|
|
||
|
%package -n samba-tool
|
||
|
Summary: Main Samba administration tool
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Productivity/Networking/Samba
|
||
|
Requires: samba = %{version}
|
||
|
Requires: samba-ldb-ldap = %{version}
|
||
|
Requires: samba-python3 = %{version}
|
||
|
%if %{with_dc}
|
||
|
Requires: python3-Markdown
|
||
|
%endif
|
||
|
|
||
|
%description -n samba-tool
|
||
|
The package contains samba-tool, the main tool for Samba Administration.
|
||
|
|
||
|
%package ad-dc
|
||
|
Summary: Samba Active Directory-compatible Domain Controller
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Productivity/Networking/Samba
|
||
|
Requires: samba = %{version}
|
||
|
Requires: samba-dsdb-modules = %{version}
|
||
|
%if %{with_mit_dc}
|
||
|
Recommends: krb5-server >= 1.15.1
|
||
|
%endif
|
||
|
Requires: samba-python3 = %{version}
|
||
|
Requires: samba-tool = %{version}
|
||
|
Recommends: samba-winbind = %{version}
|
||
|
Recommends: tdb-tools >= %{tdb_version}
|
||
|
Recommends: python3-dnspython
|
||
|
Provides: samba-kdc = %{version}
|
||
|
Obsoletes: samba-kdc < %{version}
|
||
|
|
||
|
%description ad-dc
|
||
|
This package contains the Active Directory-compatible Domain Controller
|
||
|
|
||
|
%package ad-dc-libs
|
||
|
Summary: Samba Active Directory Domain Controller libraries
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Development/Libraries/C and C++
|
||
|
Requires: samba-client-libs = %{version}
|
||
|
Requires: samba-libs = %{version}
|
||
|
|
||
|
%description ad-dc-libs
|
||
|
This package contains the Active Directory-compatible Domain Controller
|
||
|
libraries.
|
||
|
|
||
|
%package dsdb-modules
|
||
|
Summary: Samba LDB modules
|
||
|
License: GPL-3.0-or-later
|
||
|
Group: Productivity/Networking/Samba
|
||
|
# The ldb modules provided by this package check their own version matches
|
||
|
# the libldb2 version. If the version do not match (e.g. libldb2 version
|
||
|
# is updated and samba-dsdb-modules is not rebuilt against it) programs using
|
||
|
# libldb2 won't start. The requires_eq macro will require the libldb2 version
|
||
|
# available at build time without having to manually maintain the global
|
||
|
# ldb_version variable in this spec file (bsc#1118508, bsc#1199362)
|
||
|
# NOTE 4.21 update. If ldb is built from this spec, this problem goes away and
|
||
|
# it is enough with requiring libldb2 = %{version}
|
||
|
Requires: libldb2 = %{version}
|
||
|
Requires: samba-ldb-ldap = %{version}
|
||
|
Requires(post): /sbin/ldconfig
|
||
|
Requires(postun):/sbin/ldconfig
|
||
|
|
||
|
%description dsdb-modules
|
||
|
This package contains plugins which add Active Directory features to the
|
||
|
LDB library.
|
||
|
|
||
|
|
||
|
%package -n libldb2
|
||
|
Summary: An LDAP-like embedded database
|
||
|
License: LGPL-3.0-or-later
|
||
|
Obsoletes: libldb1 < %{version}
|
||
|
|
||
|
%description -n libldb2
|
||
|
LDB is an LDAP-like embedded database.
|
||
|
|
||
|
%package -n libldb-devel
|
||
|
Summary: Libraries and Header Files to Develop Programs with ldb2 Support
|
||
|
Group: Development/Libraries/C and C++
|
||
|
Requires: libldb2 = %{version}
|
||
|
Requires: pkg-config
|
||
|
|
||
|
%description -n libldb-devel
|
||
|
LDB is an LDAP-like embedded database.
|
||
|
|
||
|
Libraries and Header Files to Develop Programs with ldb2 Support.
|
||
|
|
||
|
%package -n ldb-tools
|
||
|
Summary: Tools to manipulate LDB files
|
||
|
Group: Development/Libraries/C and C++
|
||
|
|
||
|
%description -n ldb-tools
|
||
|
Tools to manipulate LDB files.
|
||
|
|
||
|
%package -n python3-ldb
|
||
|
Summary: Python3 bindings for the LDB library
|
||
|
Group: Development/Libraries/Python
|
||
|
Requires: libldb2 = %{version}
|
||
|
Obsoletes: python-ldb < %{version}
|
||
|
Obsoletes: python3-ldb-devel < %{version}
|
||
|
|
||
|
%description -n python3-ldb
|
||
|
This package contains the python3 bindings for the LDB library.
|
||
|
|
||
|
|
||
|
%prep
|
||
|
%setup -n samba-%{version} -q
|
||
|
# Create and add vendor suffix
|
||
|
if test "%{_project}" != "openSUSE:Factory"; then
|
||
|
vendor_tag_release="%{release}"
|
||
|
else
|
||
|
vendor_tag_release=""
|
||
|
fi
|
||
|
# ensure Git commit portion of version string is retained
|
||
|
vendor_tag=$(echo -n %{version} | sed "s/.*+git/git/"; \
|
||
|
echo -n "${vendor_tag_release}" )
|
||
|
# Create product suffix
|
||
|
test 0%{?centos_version} -gt 0 && product_version=%{?centos_version}
|
||
|
test 0%{?fedora_version} -gt 0 && product_version=%{?fedora_version}
|
||
|
test 0%{?mandriva_version} -gt 0 && product_version=%{?mandriva_version}
|
||
|
test 0%{?rhel_version} -gt 0 && product_version=%{?rhel_version}
|
||
|
test 0%{?suse_version} -gt 0 && product_version=%{?suse_version}
|
||
|
major_version=$((${product_version}/100))
|
||
|
minor_version=$((${product_version}/10))
|
||
|
minor_version="${minor_version#$major_version}"
|
||
|
product_version="${major_version}.${minor_version}"
|
||
|
case "%{suse_version}" in
|
||
|
1010) product_suffix="-SLE_10" ;;
|
||
|
1110) product_suffix="-SLE_11" ;;
|
||
|
1315) product_suffix="-SLE_12" ;;
|
||
|
*) product_suffix="-oS${product_version}" ;;
|
||
|
esac
|
||
|
# Add the build architecture
|
||
|
test "%{_build_arch}" != "" && \
|
||
|
product_suffix="${product_suffix}-%{_build_arch}"
|
||
|
# Set SAMBA_VERSION_VENDOR_SUFFIX in the VERSION file
|
||
|
mv VERSION VERSION.orig
|
||
|
sed -e "s/^SAMBA_VERSION_VENDOR_SUFFIX=$/SAMBA_VERSION_VENDOR_SUFFIX=${vendor_tag}%{VENDOR}${product_suffix}/" VERSION.orig >VERSION
|
||
|
|
||
|
%build
|
||
|
if command -v ncurses6-config &> /dev/null; then
|
||
|
export NCURSES_CONFIG="$(command -v ncurses6-config)"
|
||
|
fi
|
||
|
|
||
|
export CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -DIDMAP_RID_SUPPORT_TRUSTED_DOMAINS -I/usr/include/tirpc"
|
||
|
export LDFLAGS="-ltirpc"
|
||
|
|
||
|
bundled_libraries="NONE"
|
||
|
%if ! 0%{?with_mscat}
|
||
|
bundled_libraries+=",libtasn1"
|
||
|
%endif
|
||
|
|
||
|
private_libraries="!ldb"
|
||
|
|
||
|
CONFIGURE_OPTIONS="\
|
||
|
--prefix=%{_prefix} \
|
||
|
--localstatedir=%{_localstatedir} \
|
||
|
--sysconfdir=%{_sysconfdir} \
|
||
|
--libdir=%{_libdir} \
|
||
|
--libexecdir=%{_libdir} \
|
||
|
--with-cachedir=%{LOCKDIR} \
|
||
|
--with-lockdir=%{LOCKDIR}/lock \
|
||
|
--with-logfilebase=%{LOGDIR} \
|
||
|
--with-modulesdir=%{_libdir}/samba \
|
||
|
--disable-rpath \
|
||
|
--disable-rpath-install \
|
||
|
--enable-debug \
|
||
|
--with-profiling-data \
|
||
|
--private-libraries=${private_libraries} \
|
||
|
%if !%{with_lmdb}
|
||
|
--without-ldb-lmdb \
|
||
|
%endif
|
||
|
%if 0%{?build_ctdb_pmda}
|
||
|
--enable-pmda \
|
||
|
%endif
|
||
|
--enable-fhs \
|
||
|
--with-cluster-support \
|
||
|
--with-socketpath=%{_localstatedir}/lib/ctdb/ctdb.socket \
|
||
|
%if 0%{?build_ceph}
|
||
|
--enable-ceph-reclock \
|
||
|
%endif
|
||
|
--with-pam \
|
||
|
--with-pammodulesdir=%_pam_moduledir\
|
||
|
--with-piddir=%{PIDDIR} \
|
||
|
--with-relro \
|
||
|
--enable-avahi \
|
||
|
--with-systemd \
|
||
|
--with-systemddir=%{_unitdir} \
|
||
|
--systemd-install-services \
|
||
|
--with-shared-modules=%{auth_modules},%{vfs_modules},%{pdb_modules},%{idmap_modules} \
|
||
|
%if %with_mitkrb5
|
||
|
--with-system-mitkrb5 \
|
||
|
%endif
|
||
|
%if ! %{with_dc}
|
||
|
--without-ad-dc \
|
||
|
--without-json \
|
||
|
--without-gpgme \
|
||
|
%else
|
||
|
%if %{with_dc} && %{with_mit_dc}
|
||
|
--with-experimental-mit-ad-dc \
|
||
|
%endif
|
||
|
%endif
|
||
|
--bundled-libraries=NONE,${bundled_libraries} \
|
||
|
--without-fam \
|
||
|
%if 0%{?suse_version} > 1500
|
||
|
%if %{without_smb1_server}
|
||
|
--without-smb1-server \
|
||
|
%endif
|
||
|
%endif
|
||
|
"
|
||
|
|
||
|
./configure ${CONFIGURE_OPTIONS}
|
||
|
make %{?_smp_mflags}
|
||
|
|
||
|
pushd docs-xml
|
||
|
autoconf && ./configure
|
||
|
XML_CATALOG_FILES="file:///etc/xml/catalog file://$(pwd)/build/catalog.xml" make htmlman
|
||
|
popd
|
||
|
|
||
|
pushd ctdb
|
||
|
XML_CATALOG_FILES="file:///etc/xml/catalog file://$(pwd)/build/catalog.xml" make %{?_smp_mflags} manpages
|
||
|
popd
|
||
|
|
||
|
%sysusers_generate_pre packaging/SuSE/systemd/sysusers.samba-winbind winbind samba-winbind.conf
|
||
|
%sysusers_generate_pre packaging/SuSE/systemd/sysusers.samba samba samba.conf
|
||
|
|
||
|
%install
|
||
|
|
||
|
install -d -m 0755 -p \
|
||
|
%{buildroot}/%samba_pamdir
|
||
|
|
||
|
install -d -m 0755 -p \
|
||
|
%{buildroot}/%{_sysconfdir}/{xinetd.d,logrotate.d} \
|
||
|
%{buildroot}/%{_sysconfdir}/openldap/schema \
|
||
|
%{buildroot}/%{_sysconfdir}/security \
|
||
|
%{buildroot}/%{CONFIGDIR} \
|
||
|
%{buildroot}/%{_unitdir} \
|
||
|
%{buildroot}/%{_lib}/security \
|
||
|
%{buildroot}/sbin \
|
||
|
%{buildroot}/%{_includedir} \
|
||
|
%{buildroot}/%{_libdir}/pkgconfig \
|
||
|
%{buildroot}/%{_libdir}/python/lib-dynload \
|
||
|
%{buildroot}/%{_libdir}/samba/{config,vfs,rpc,auth,charset,idmap} \
|
||
|
%{buildroot}/%{_datadir}/omc/svcinfo.d \
|
||
|
%{buildroot}/%{_datadir}/samba/{LDAP,templates} \
|
||
|
%{buildroot}/%{_localstatedir}/adm \
|
||
|
%{buildroot}/%{_localstatedir}/lib/ctdb/persistent \
|
||
|
%{buildroot}/%{LOCKDIR}/{drivers/{WIN40,W32X86,W32MIPS,W32ALPHA,W32PPC,IA64,x64},netlogon,lock/msg.lock,printing,private/msg.sock,profiles,winbindd_privileged} \
|
||
|
%{buildroot}/%{LOGDIR} \
|
||
|
%{buildroot}/%{PIDDIR} \
|
||
|
%{buildroot}/%{_fillupdir} \
|
||
|
%{buildroot}/%{_var}/cache/krb5rcache \
|
||
|
%{buildroot}/%{_var}/log/ctdb \
|
||
|
%{buildroot}/%{DOCDIR} \
|
||
|
%{buildroot}/%{DOCBOOKDIR} \
|
||
|
%{buildroot}/%{_datadir}/susehelp/meta/Administration/System
|
||
|
|
||
|
make %{?_smp_mflags} install \
|
||
|
DESTDIR=%{buildroot} \
|
||
|
CONFIGDIR=%{CONFIGDIR}
|
||
|
|
||
|
# debug symbols are created and installed if the files are excluded only
|
||
|
%if ! %{with_dc}
|
||
|
rm \
|
||
|
%{buildroot}/%{_mandir}/man8/samba.8* \
|
||
|
%{buildroot}/%{_mandir}/man8/samba_downgrade_db.8* \
|
||
|
%{buildroot}/%{_unitdir}/samba-ad-dc.service
|
||
|
%endif
|
||
|
|
||
|
# CTDB
|
||
|
install -m 0644 packaging/SuSE/config/sysconfig.ctdb %{buildroot}/%{_fillupdir}
|
||
|
ln -s service %{buildroot}/%{_sbindir}/rcctdb
|
||
|
# create tmpfile conf
|
||
|
install -d -m 0755 %{buildroot}/%{_tmpfilesdir}
|
||
|
echo "d /run/ctdbd 0755 root root" >%{buildroot}/%{_tmpfilesdir}/ctdb.conf
|
||
|
mkdir %{buildroot}/%{_defaultdocdir}/ctdb
|
||
|
for file in README COPYING doc/examples doc/*.html doc/readonlyrecords.txt ; do
|
||
|
cp -a ctdb/${file} %{buildroot}/%{_defaultdocdir}/ctdb
|
||
|
done
|
||
|
touch %{buildroot}/%{_sysconfdir}/ctdb/nodes
|
||
|
# install the config_migrate.sh script to move to new 4.9+ ctdb configuration
|
||
|
install -m 0744 ctdb/doc/examples/config_migrate.sh %{buildroot}/%{_sysconfdir}/ctdb/config_migrate.sh
|
||
|
|
||
|
# utility scripts
|
||
|
scripts="creategroup mksmbpasswd.sh"
|
||
|
install -d -m 0755 examples/scripts
|
||
|
for i in $scripts; do
|
||
|
install -m 0755 "source3/script/${i}" examples/scripts/${i}
|
||
|
done
|
||
|
# configuration files
|
||
|
pushd packaging/SuSE/
|
||
|
echo "# smb.conf is the main Samba configuration file. see man smb.conf " >config/smb.conf
|
||
|
echo "# for full details." >>config/smb.conf
|
||
|
grep -v "\(^#\|^;\|^$\)" config/smb.conf.vendor >>config/smb.conf
|
||
|
install -p -m 0644 config/smb.conf.vendor ../../examples/smb.conf.%{VENDOR}
|
||
|
for file in smb.conf lmhosts smbusers smbpasswd smbusers; do
|
||
|
install -m 0644 "config/${file}" %{buildroot}/%{CONFIGDIR}/${file}
|
||
|
done
|
||
|
section_names=$( sed -ne 's/^\[\(.*\)\]$/\1/p' config/smb.conf)
|
||
|
for section in $section_names; do
|
||
|
../source3/bin/testparm -s --section-name "${section}" config/smb.conf >"%{buildroot}/%{_datadir}/samba/templates/default-${section}" || :
|
||
|
done
|
||
|
for file in config/templates/*; do
|
||
|
cp -a "${file}" "%{buildroot}/%{_datadir}/samba/templates/"
|
||
|
done
|
||
|
# start scripts
|
||
|
startScripts="smb nmb winbind"
|
||
|
for srv_name in ${startScripts}; do
|
||
|
ln -s service %{buildroot}/%{_sbindir}/rc${srv_name}
|
||
|
done
|
||
|
%if %{with_dc}
|
||
|
ln -s service %{buildroot}/%{_sbindir}/rcsamba-ad-dc
|
||
|
install -m 0644 systemd/sysconfig.samba-ad-dc %{buildroot}%{_fillupdir}
|
||
|
# Drop-in file for named to allow r/w access to dlz dir (bsc#1201689)
|
||
|
install -d -m 0755 -p %{buildroot}%{_unitdir}/named.service.d
|
||
|
install -m 0644 systemd/named-override.conf %{buildroot}%{_unitdir}/named.service.d/26-samba-dlz.conf
|
||
|
%endif
|
||
|
rm %{buildroot}/%{_sysconfdir}/sysconfig/samba
|
||
|
install -m 0644 systemd/sysconfig.samba %{buildroot}%{_fillupdir}
|
||
|
install -m 0644 systemd/sysconfig.samba-winbind %{buildroot}%{_fillupdir}
|
||
|
install -m 0644 -Dp systemd/sysusers.samba %{buildroot}%{_sysusersdir}/samba.conf
|
||
|
install -m 0644 -Dp systemd/sysusers.samba-winbind %{buildroot}%{_sysusersdir}/samba-winbind.conf
|
||
|
install -m 0644 -p ../systemd/samba.conf.tmp %{buildroot}/%{_tmpfilesdir}/samba.conf
|
||
|
|
||
|
for script in ${startScripts}; do
|
||
|
SERVICE_NAME=$( echo "${script}" | tr [:lower:] [:upper:])
|
||
|
sed \
|
||
|
-e "s#__SERVICE_NAME#${SERVICE_NAME}#g" \
|
||
|
-e "s#__SERVICE_SCRIPT_NAME#${script}#g" \
|
||
|
init/template.xml \
|
||
|
>"%{buildroot}/%{_datadir}/omc/svcinfo.d/${script}.xml"
|
||
|
done
|
||
|
install -m 0755 tools/nmbstatus %{buildroot}/%{_bindir}/nmbstatus
|
||
|
pod2man tools/nmbstatus >%{buildroot}/%{_mandir}/man1/nmbstatus.1
|
||
|
install -m 0755 tools/update-apparmor-samba-profile \
|
||
|
%{buildroot}/%{_datadir}/samba/
|
||
|
# PDF generator
|
||
|
install -p -m 0755 tools/smbprngenpdf %{buildroot}/%{_bindir}/smbprngenpdf
|
||
|
install -m 0644 config/samba.pamd-common %{buildroot}/%samba_pamdir/samba
|
||
|
install -m 0644 config/dhcp.conf %{buildroot}/%{_fillupdir}/samba-client-dhcp.conf
|
||
|
install -m 0644 config/sysconfig.dhcp-samba-client %{buildroot}/%{_fillupdir}/sysconfig.dhcp-samba-client
|
||
|
|
||
|
# Add logrotate settings for nmbd and smbd only on systems newer than 8.1.
|
||
|
%if 0%{?suse_version} > 1500
|
||
|
mkdir -p %{buildroot}%{_distconfdir}/logrotate.d
|
||
|
%endif
|
||
|
LOGROTATE_FILES="samba samba-winbind"
|
||
|
for file in ${LOGROTATE_FILES}; do
|
||
|
rm -f "%{_builddir}/samba-%{version}/filelist-${file}"
|
||
|
touch "%{_builddir}/samba-%{version}/filelist-${file}"
|
||
|
%if 0%{?suse_version} > 1500
|
||
|
install -m 0644 logrotate/${file} %{buildroot}/%{_distconfdir}/logrotate.d/${file}
|
||
|
echo "%{_distconfdir}/logrotate.d/${file}" >>%{_builddir}/samba-%{version}/filelist-${file}
|
||
|
%else
|
||
|
install -m 0644 logrotate/${file} %{buildroot}/%{_sysconfdir}/logrotate.d/${file}
|
||
|
echo "%config(noreplace) %{_sysconfdir}/logrotate.d/${file}" >>%{_builddir}/samba-%{version}/filelist-${file}
|
||
|
%endif
|
||
|
done
|
||
|
install -m 0644 docu/README.SUSE %{buildroot}/%{DOCDIR}/
|
||
|
# SUSEhelp files
|
||
|
install -m 0644 docu/Samba.desktop %{buildroot}/%{_datadir}/susehelp/meta/Administration/System/Samba.desktop
|
||
|
install -d -m 0755 -p ../../docs/htmldocs
|
||
|
install -m 0644 docu/manpages.html ../../docs/htmldocs/manpages.html
|
||
|
install -m 0644 ../../docs-xml/output/htmldocs/manpages/* ../../docs/htmldocs/
|
||
|
popd
|
||
|
# winbind stuff
|
||
|
install -m 0644 examples/pam_winbind/pam_winbind.conf %{buildroot}/%_pam_secconfdir/pam_winbind.conf
|
||
|
# install nsswitch-headers (for squid, etc. #FIXME)
|
||
|
install -d -m 0755 \
|
||
|
%{buildroot}/%{_includedir}/samba/nsswitch \
|
||
|
%{buildroot}/%{_includedir}/samba/winbindd
|
||
|
for file in winbind_client.h winbind_nss_config.h winbind_nss_linux.h; do
|
||
|
install -m 0644 "nsswitch/${file}" %{buildroot}/%{_includedir}/samba/nsswitch/${file}
|
||
|
done
|
||
|
for file in winbindd.h winbindd_proto.h; do
|
||
|
install -m 0644 "source3/winbindd/${file}" %{buildroot}/%{_includedir}/samba/winbindd/${file}
|
||
|
done
|
||
|
# cups SMB support
|
||
|
mkdir -p %{buildroot}/%{cups_lib_dir}/backend/
|
||
|
touch %{buildroot}/%{cups_lib_dir}/backend/smb
|
||
|
mv COPYING README.md WHATSNEW.txt %{buildroot}/%{DOCDIR}/
|
||
|
cp -a docs/* %{buildroot}/%{DOCDIR}
|
||
|
rmdir "%{buildroot}/%{DOCBOOKDIR}"
|
||
|
cp -a examples/ %{buildroot}/%{DOCDIR}
|
||
|
# finally build filelist-samba-doc
|
||
|
for file in $( find %{buildroot}%{DOCDIR} -maxdepth 1); do
|
||
|
# exclude %{DOCDIR}, README, and docbook
|
||
|
case "${file#%{buildroot}}" in
|
||
|
%{DOCDIR}|%{DOCDIR}/README.%{VENDOR}|%{DOCDIR}/docbook) continue ;;
|
||
|
esac
|
||
|
echo "%doc ${file#%{buildroot}}" >>"%{_builddir}/samba-%{version}/filelist-samba-doc"
|
||
|
done
|
||
|
for file in $( find %{buildroot}%{_libdir}/samba/vfs/ -mindepth 1 ); do
|
||
|
# if built we don't want ceph VFS modules in the base package
|
||
|
case "${file#%{buildroot}}" in
|
||
|
%{_libdir}/samba/vfs/ceph.so) continue ;;
|
||
|
%{_libdir}/samba/vfs/ceph_new.so) continue ;;
|
||
|
%{_libdir}/samba/vfs/ceph_snapshots.so) continue ;;
|
||
|
esac
|
||
|
echo "${file#%{buildroot}}" >>%{_builddir}/samba-%{version}/filelist-samba
|
||
|
done
|
||
|
# only package Man pages for VFS modules that we ship
|
||
|
for file in %{buildroot}%{_mandir}/man8/vfs_*; do
|
||
|
case "${file#%{buildroot}}" in
|
||
|
%{_mandir}/man8/vfs_ceph.8)
|
||
|
%if 0%{?build_ceph} == 0
|
||
|
rm ${file}
|
||
|
%endif
|
||
|
continue
|
||
|
;;
|
||
|
%{_mandir}/man8/vfs_ceph_new.8)
|
||
|
%if 0%{?build_ceph} == 0
|
||
|
rm ${file}
|
||
|
%endif
|
||
|
continue
|
||
|
;;
|
||
|
%{_mandir}/man8/vfs_ceph_snapshots.8)
|
||
|
%if 0%{?build_ceph} == 0
|
||
|
rm ${file}
|
||
|
%endif
|
||
|
continue
|
||
|
;;
|
||
|
%{_mandir}/man8/vfs_glusterfs.8)
|
||
|
rm ${file}
|
||
|
continue
|
||
|
;;
|
||
|
%{_mandir}/man8/vfs_gpfs.8)
|
||
|
rm ${file}
|
||
|
continue
|
||
|
;;
|
||
|
%{_mandir}/man8/vfs_tsmsm.8)
|
||
|
rm ${file}
|
||
|
continue
|
||
|
;;
|
||
|
esac
|
||
|
# wildcard suffix to account for subsequent gzip
|
||
|
echo "${file#%{buildroot}}*" >>%{_builddir}/samba-%{version}/filelist-samba
|
||
|
done
|
||
|
# copy the schema
|
||
|
install -m 0644 examples/LDAP/samba.schema %{buildroot}/%{_sysconfdir}/openldap/schema/samba3.schema
|
||
|
install -m 0644 examples/LDAP/samba-nds.schema %{buildroot}/%{_datadir}/samba/LDAP/samba-nds.schema
|
||
|
# Hardlink duplicate files
|
||
|
%fdupes %{buildroot}
|
||
|
%python3_fix_shebang
|
||
|
|
||
|
%pre -f samba.pre
|
||
|
%service_add_pre nmb.service smb.service samba-bgqd.service
|
||
|
%if 0%{?suse_version} > 1500
|
||
|
# Prepare for migration to /usr/etc; save any old .rpmsave
|
||
|
for i in logrotate.d/samba pam.d/samba; do
|
||
|
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||:
|
||
|
done
|
||
|
%endif
|
||
|
|
||
|
%if 0%{?suse_version} > 1500
|
||
|
%posttrans
|
||
|
# Migration to /usr/etc, restore just created .rpmsave
|
||
|
for i in logrotate.d/samba pam.d/samba; do
|
||
|
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||:
|
||
|
done
|
||
|
%endif
|
||
|
|
||
|
%if %{with_dc}
|
||
|
%pre ad-dc
|
||
|
%service_add_pre samba-ad-dc.service
|
||
|
%endif
|
||
|
|
||
|
%preun
|
||
|
%service_del_preun nmb.service smb.service samba-bgqd.service
|
||
|
|
||
|
%if %{with_dc}
|
||
|
%preun ad-dc
|
||
|
%service_del_preun samba-ad-dc.service
|
||
|
%endif
|
||
|
|
||
|
%post
|
||
|
if testparm -s 2>&1 | grep "server schannel =" | grep -E "Auto|No"
|
||
|
then
|
||
|
echo "CVE-2020-1472(ZeroLogon):"
|
||
|
echo "Please configure 'server schannel = yes'"
|
||
|
echo "See https://bugzilla.samba.org/show_bug.cgi?id=14497"
|
||
|
fi
|
||
|
|
||
|
# bsc#1088574; bsc#1071090; bsc#1065551
|
||
|
if [ -f %{_unitdir}/smb.service ] && \
|
||
|
grep -qE '^ExecStart=.*smbd.*foreground.*no-process-group' %{_unitdir}/smb.service && \
|
||
|
[ -f %{_sysconfdir}/sysconfig/samba ] && \
|
||
|
grep -q -- '-D' %{_sysconfdir}/sysconfig/samba
|
||
|
then
|
||
|
echo using foreground execution for samba systemd units
|
||
|
echo overwriting samba sysconfig to remove daemon related flags...
|
||
|
sed -i 's/-D *//g' %{_sysconfdir}/sysconfig/samba
|
||
|
sed -i 's/-F *//g' %{_sysconfdir}/sysconfig/samba
|
||
|
fi
|
||
|
|
||
|
%service_add_post nmb.service smb.service samba-bgqd.service
|
||
|
%tmpfiles_create samba.conf
|
||
|
%fillup_only
|
||
|
|
||
|
%postun
|
||
|
%service_del_postun nmb.service smb.service samba-bgqd.service
|
||
|
|
||
|
%post client
|
||
|
/sbin/ldconfig
|
||
|
for fn in MACHINE.SID idmap2.tdb idmap_test.tdb netlogon_creds_cli.tdb passdb.tdb secrets.tdb smbpasswd; do
|
||
|
test ! -e %{LOCKDIR}/private/$fn && test -e %{CONFIGDIR}/$fn && \
|
||
|
mv %{CONFIGDIR}/$fn %{LOCKDIR}/private/
|
||
|
done
|
||
|
for fn in brlock.tdb connections.tdb dbwrap_watchers.tdb gencache_notrans.tdb g_lock.tdb leases.tdb locking.tdb mutex.tdb names.tdb printer_list.tdb serverid.tdb smbXsrv_client_global.tdb smbXsrv_open_global.tdb smbXsrv_session_global.tdb smbXsrv_tcon_global.tdb smbXsrv_version_global.tdb srv_fss.tdb; do
|
||
|
test ! -e %{LOCKDIR}/lock/$fn && test -e %{LOCKDIR}/$fn && \
|
||
|
mv %{LOCKDIR}/$fn %{LOCKDIR}/lock/
|
||
|
done
|
||
|
if ! test -e %{_bindir}/get_printing_ticket; then
|
||
|
ln -fs %{_bindir}/smbspool %{cups_lib_dir}/backend/smb
|
||
|
fi
|
||
|
%{?fillup_only:%{fillup_only -nsd dhcp samba-client network}}
|
||
|
|
||
|
%postun client
|
||
|
/sbin/ldconfig
|
||
|
|
||
|
%post client-libs -p /sbin/ldconfig
|
||
|
%postun client-libs -p /sbin/ldconfig
|
||
|
%post libs -p /sbin/ldconfig
|
||
|
%postun libs -p /sbin/ldconfig
|
||
|
%post ad-dc-libs -p /sbin/ldconfig
|
||
|
%postun ad-dc-libs -p /sbin/ldconfig
|
||
|
%post winbind-libs -p /sbin/ldconfig
|
||
|
%postun winbind-libs -p /sbin/ldconfig
|
||
|
%post test -p /sbin/ldconfig
|
||
|
%postun test -p /sbin/ldconfig
|
||
|
|
||
|
%if %{with_dc}
|
||
|
%post ad-dc
|
||
|
/sbin/ldconfig
|
||
|
%service_add_post samba-ad-dc.service
|
||
|
%{fillup_only -ans samba ad-dc}
|
||
|
|
||
|
%postun ad-dc
|
||
|
/sbin/ldconfig
|
||
|
%service_del_postun samba-ad-dc.service
|
||
|
%endif
|
||
|
|
||
|
%post dsdb-modules
|
||
|
rm -f %{_libdir}/ldb/samba
|
||
|
/sbin/ldconfig
|
||
|
|
||
|
%postun dsdb-modules -p /sbin/ldconfig
|
||
|
|
||
|
%pre winbind -f winbind.pre
|
||
|
%service_add_pre winbind.service
|
||
|
%if 0%{?suse_version} > 1500
|
||
|
# Prepare for migration to /usr/etc; save any old .rpmsave
|
||
|
for i in logrotate.d/samba-winbind ; do
|
||
|
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||:
|
||
|
done
|
||
|
%endif
|
||
|
|
||
|
%if 0%{?suse_version} > 1500
|
||
|
%posttrans winbind
|
||
|
# Migration to /usr/etc, restore just created .rpmsave
|
||
|
for i in logrotate.d/samba-winbind ; do
|
||
|
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||:
|
||
|
done
|
||
|
%endif
|
||
|
|
||
|
%post winbind
|
||
|
/sbin/ldconfig
|
||
|
%service_add_post winbind.service
|
||
|
%tmpfiles_create samba.conf
|
||
|
%{fillup_only -ans samba winbind}
|
||
|
|
||
|
%preun winbind
|
||
|
%service_del_preun winbind.service
|
||
|
|
||
|
%postun winbind
|
||
|
/sbin/ldconfig
|
||
|
if [ $1 -eq 0 ]; then
|
||
|
%{_sbindir}/pam-config --delete --winbind
|
||
|
if [ -x %{_sbindir}/nscd ]; then
|
||
|
%{_sbindir}/nscd -i passwd
|
||
|
%{_sbindir}/nscd -i group
|
||
|
fi
|
||
|
fi
|
||
|
%service_del_postun winbind.service
|
||
|
|
||
|