aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-05-17 15:20:36 -0400
committerB. Stack <bgstack15@gmail.com>2022-05-17 15:22:25 -0400
commitc83b25ec5571b0f0444ad14a58a7bc60960dbccf (patch)
treecebaff11d5bbe21d8e88a64e816642706fc31ce6
parentadd selinux notes (diff)
downloadradicale_auth_ldap-c83b25ec5571b0f0444ad14a58a7bc60960dbccf.tar.gz
radicale_auth_ldap-c83b25ec5571b0f0444ad14a58a7bc60960dbccf.tar.bz2
radicale_auth_ldap-c83b25ec5571b0f0444ad14a58a7bc60960dbccf.zip
add rpm spec file
-rw-r--r--radicale_auth_ldap.spec92
1 files changed, 92 insertions, 0 deletions
diff --git a/radicale_auth_ldap.spec b/radicale_auth_ldap.spec
new file mode 100644
index 0000000..6e5b1f1
--- /dev/null
+++ b/radicale_auth_ldap.spec
@@ -0,0 +1,92 @@
+%define branch 3
+%define with_selinux 1
+%define pname radicale-auth-ldap
+%define pname_und %( echo %{pname} | tr '-' '_' )
+
+%define pyver python3
+%if 0%{?centos}
+%define pyver python36
+%endif
+Name: radicale3-auth-ldap
+Version: 0.3
+Release: 1%{?dist}
+Summary: Ldap auth plugin for radicale3
+
+License: GPL 3.0
+URL: https://gitlab.com/bgstack15/radicale_auth_ldap
+Source0: %{url}/-/archive/%{branch}/radicale_auth_ldap-%{branch}.tar.gz
+BuildArch: noarch
+
+%if with_selinux
+%package selinux
+Summary: Selinux rules for radicale3-auth-ldap
+
+%if 0%{?centos} == 7
+BuildRequires: policycoreutils-python
+%endif
+BuildRequires: policycoreutils
+BuildRequires: checkpolicy
+BuildRequires: selinux-policy-devel
+Requires(post): selinux-policy-base
+%endif
+Requires: %{pyver}-ldap3
+
+%description
+Provides ldap authentication support for radicale3,
+including multi-server support and anonymous bind.
+
+%if 0%{?with_selinux}
+%description selinux
+Includes selinux rule for radicale3 ldap auth plugin.
+Tested with httpd.
+%endif
+%prep
+%setup -n radicale_auth_ldap-%{branch}
+
+%build
+%py3_build
+%if 0%{?with_selinux}
+make -f /usr/share/selinux/devel/Makefile %{pname}.pp
+%endif
+
+%install
+%py3_install
+%if 0%{?with_selinux}
+%{__install} -d %{buildroot}%{_datadir}/selinux/packages
+%{__install} -m0644 %{pname}.pp %{buildroot}%{_datadir}/selinux/packages
+find %{buildroot}%{_datadir}/selinux ! -type d -exec ls -altrdF {} +
+%endif
+
+%post selinux
+#
+# Install all modules in a single transaction
+#
+%_format MODULES %{_datadir}/selinux/packages/$x.pp
+%{_sbindir}/semodule -n -s %{selinuxtype} -i $MODULES
+if %{_sbindir}/selinuxenabled ; then
+ %{_sbindir}/load_policy
+ %relabel_files
+fi
+
+%postun selinux
+if [ $1 -eq 0 ]; then
+ %{_sbindir}/semodule -n -r %{modulenames} &> /dev/null || :
+ if %{_sbindir}/selinuxenabled ; then
+ %{_sbindir}/load_policy
+ # no file contexts are defined in this policy.
+ #%%relabel_files
+ fi
+fi
+
+%files
+%{python3_sitelib}/%{pname_und}
+%{python3_sitelib}/%{pname_und}-*.egg-info
+%if 0%{?with_selinux}
+%files selinux
+%{_datadir}/selinux/packages/*.pp
+%endif
+
+%doc
+
+%changelog
+
bgstack15