88573e13382f7d3ee112bed7b1f79eac00f1304bLukas Slebodnik# SSSD is running as root user by default.
88573e13382f7d3ee112bed7b1f79eac00f1304bLukas Slebodnik# Set --with sssd_user or bcond_without to run SSSD as non-root user(sssd).
88573e13382f7d3ee112bed7b1f79eac00f1304bLukas Slebodnik%bcond_with sssd_user
c20a9efbf5da0587fbb6a855a2d366ce19f1abe1Lukas Slebodnik%global rhel6_minor %(%{__grep} -o "6\\.[0-9]*" /etc/redhat-release |%{__sed} -s 's/6.//')
c20a9efbf5da0587fbb6a855a2d366ce19f1abe1Lukas Slebodnik%global rhel7_minor %(%{__grep} -o "7\\.[0-9]*" /etc/redhat-release |%{__sed} -s 's/7.//')
b6840554b4eeda395f5460a56df2eac1f3f97397Lukas Slebodnik%if 0%{?rhel} && 0%{?rhel} <= 6
b6840554b4eeda395f5460a56df2eac1f3f97397Lukas Slebodnik%{!?__python2: %global __python2 /usr/bin/python2}
b6840554b4eeda395f5460a56df2eac1f3f97397Lukas Slebodnik%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
b6840554b4eeda395f5460a56df2eac1f3f97397Lukas Slebodnik%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik%{!?python_provide: %global need_python_provide 1}
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik%if 0%{?need_python_provide}
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik%define python_provide() %{lua:
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik function string.starts(String, Start)
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik return string.sub(String, 1, string.len(Start)) == Start
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik package = rpm.expand("%{?1:%{1}}");
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik if (string.starts(package, "python2-")) then
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik if (rpm.expand("%{?buildarch}") ~= "noarch") then
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik str = "Provides: python-" ..
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik string.sub(package, 9, string.len(package)) ..
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik "%{?_isa} = " .. vr;
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik print("\\nProvides: python-");
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik print(string.sub(package, 9, string.len(package)));
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik print(" = ");
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik --Obsoleting the previous default python package
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik if (rpm.expand("%{?buildarch}") ~= "noarch") then
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik str = "\\nObsoletes: python-" ..
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik string.sub(package, 9, string.len(package)) ..
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik "%{?_isa} < " .. vr;
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik print("\\nObsoletes: python-");
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik print(string.sub(package, 9, string.len(package)));
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik print(" < ");
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik elseif (string.starts(package, "python3-")) then
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik --No unversioned provides as python3 is not default
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik print("%python_provide: ERROR: ");
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik print(package);
705bc4480a68f69d287b1c89fe9463a0191987c8Lukas Slebodnik print(" not recognized.");
1f7573f8c74ff0f488a15969caed13034a95bd0fStephen Gallagher# Fedora and RHEL 6+
1f7573f8c74ff0f488a15969caed13034a95bd0fStephen Gallagher# we don't want to provide private python extension libs
b6840554b4eeda395f5460a56df2eac1f3f97397Lukas Slebodnik%define __provides_exclude_from %{python2_sitearch}/.*\.so$
889706cbc739358c2a0aac2ba6bc054fdc8e048bLukas Slebodnik%define __provides_exclude_from %{python3_sitearch}/.*\.so$
85fe1601d3578eef9d244e860b9881347a112859Lukas Slebodnik# workaround for rpm 4.13
85fe1601d3578eef9d244e860b9881347a112859Lukas Slebodnik%define _empty_manifest_terminate_build 0
2344d7f71dd80618a41745b0818b46895fa61b2cLukas Slebodnik%if (0%{?fedora} || 0%{?rhel} >= 7)
4eafef4572f4e5ff6b589c80db0b9417724f229fJan Cholasta %global use_systemd 1
3be9e26dcd169d44ae105f1b8a0674464c700b77Sumit Bose# on Fedora and RHEL7 p11_child needs a polkit config snippet to be allowed to
346d6d8bf5fdb446921d754c07c8a7d913a048d5René Genz# talk to pcscd if SSSD runs as unprivileged user
88573e13382f7d3ee112bed7b1f79eac00f1304bLukas Slebodnik%if (%{with sssd_user} && (0%{?fedora} || 0%{?rhel} >= 7))
3be9e26dcd169d44ae105f1b8a0674464c700b77Sumit Bose %global install_pcscd_polkit_rule 1
5484044ea7bb632b915f706685fce509f6eacc48Jakub Hrozek %global enable_polkit_rules_option --disable-polkit-rules-path
4eafef4572f4e5ff6b589c80db0b9417724f229fJan Cholasta%if (0%{?use_systemd} == 1)
4eafef4572f4e5ff6b589c80db0b9417724f229fJan Cholasta %global with_initscript --with-initscript=systemd --with-systemdunitdir=%{_unitdir}
b96988a35bfb5f6faf2e364ae966166398afeca3Stephen Gallagher %global with_syslog --with-syslog=journald
4eafef4572f4e5ff6b589c80db0b9417724f229fJan Cholasta %global with_initscript --with-initscript=sysv
a098b26a2a902cfb2968ca44604f61bf000d8413Stephen Gallagher%global enable_experimental 1
78e5b91e6b22efbcd0621144b104ac9dfd487e5bJakub Hrozek%if (0%{?enable_experimental} == 1)
287e76479d68db4134274d4a4fca5fe0fbc9a605Jan Cholasta %global experimental --enable-all-experimental-features
0b52717b76bf306afd30bbeb6d6c619365cfb548Stephen Gallagher# Determine the location of the LDB modules directory
0b52717b76bf306afd30bbeb6d6c619365cfb548Stephen Gallagher%global ldb_modulesdir %(pkg-config --variable=modulesdir ldb)
2344d7f71dd80618a41745b0818b46895fa61b2cLukas Slebodnik%if (0%{?fedora} || 0%{?rhel} >= 7)
12a73062d84fec27536b09fd275ea248d14b93e5Jakub Hrozek%define _hardened_build 1
2344d7f71dd80618a41745b0818b46895fa61b2cLukas Slebodnik%if (0%{?fedora} || 0%{?rhel} >= 7)
c3b1e99007d5f0069fbbd32a3df799d71ea4882eSumit Bose %global with_cifs_utils_plugin 1
c3b1e99007d5f0069fbbd32a3df799d71ea4882eSumit Bose %global with_cifs_utils_plugin_option --disable-cifs-idmap-plugin
fa0d29fe3c5b5fd07ce9e665f18b7aa335d73c9cLukas Slebodnik%if (0%{?fedora} || 0%{?rhel} > 7)
889706cbc739358c2a0aac2ba6bc054fdc8e048bLukas Slebodnik %global with_python3 1
889706cbc739358c2a0aac2ba6bc054fdc8e048bLukas Slebodnik %global with_python3_option --without-python3-bindings
acf7cee13f07b368b0ccae69776309f7f69cbca1Jakub Hrozek%global enable_systemtap 1
acf7cee13f07b368b0ccae69776309f7f69cbca1Jakub Hrozek%if (0%{?enable_systemtap} == 1)
acf7cee13f07b368b0ccae69776309f7f69cbca1Jakub Hrozek %global enable_systemtap_opt --enable-systemtap
08cb2a34402d865c3052f80f5be8f9e653c7812fLukas Slebodnik%if (0%{?fedora} || (0%{?rhel} >= 7 && 0%{rhel7_minor} >= 4))
6698d40512e55e7c2d03e14c227c51b1edc77ffaPavel Březina %global with_secrets 1
6698d40512e55e7c2d03e14c227c51b1edc77ffaPavel Březina %global with_secret_responder --without-secrets
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek%if (0%{?fedora} >= 23 || 0%{?rhel} >= 7)
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek %global with_kcm 1
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek %global with_kcm_option --with-kcm
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek %global with_kcm_option --without-kcm
122830e67472390b41edc73f0cfcd5c5705b726bSumit Bose%if (0%{?fedora} >= 27 || (0%{?rhel} >= 7 && 0%{?rhel7_minor} > 4))
122830e67472390b41edc73f0cfcd5c5705b726bSumit Bose %global with_gdm_pam_extensions 1
122830e67472390b41edc73f0cfcd5c5705b726bSumit Bose %global with_gdm_pam_extensions 0