diff --git a/.gitignore b/.gitignore index 58df018..ed4cf92 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /Radicale-0.10.tar.gz +/Radicale-1.0.1.tar.gz diff --git a/radicale-0.10-fix_charset_handling.patch b/radicale-0.10-fix_charset_handling.patch deleted file mode 100644 index 09a3967..0000000 --- a/radicale-0.10-fix_charset_handling.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/radicale/__init__.py.orig 2015-04-09 08:22:04.587670438 +0200 -+++ b/radicale/__init__.py 2015-04-09 08:28:56.241646995 +0200 -@@ -159,7 +159,7 @@ - # First append content charset given in the request - content_type = environ.get("CONTENT_TYPE") - if content_type and "charset=" in content_type: -- charsets.append(content_type.split("charset=")[1].strip()) -+ charsets.append(content_type.split("charset=")[1].split(";")[0].strip()) - # Then append default Radicale charset - charsets.append(self.encoding) - # Then append various fallbacks diff --git a/radicale-0.10-fix_delete_entry.patch b/radicale-0.10-fix_delete_entry.patch deleted file mode 100644 index 4427b51..0000000 --- a/radicale-0.10-fix_delete_entry.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 78e203a2b9a4c5ce605abe20f43efcc69eedcb74 Mon Sep 17 00:00:00 2001 -From: Markus Unterwaditzer -Date: Sun, 22 Mar 2015 12:25:54 +0100 -Subject: [PATCH] Fix another instance of #117 - ---- - radicale/__init__.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/radicale/__init__.py b/radicale/__init__.py -index 55329e5..ad8fbba 100644 ---- a/radicale/__init__.py -+++ b/radicale/__init__.py -@@ -382,8 +382,8 @@ def delete(self, environ, read_collections, write_collections, content, - - if item: - # Evolution bug workaround -- etag = environ.get("HTTP_IF_MATCH", item.etag).replace("\\", "") -- if etag == item.etag: -+ if_match = environ.get("HTTP_IF_MATCH", "*").replace("\\", "") -+ if if_match in ("*", item.etag): - # No ETag precondition or precondition verified, delete item - answer = xmlutils.delete(environ["PATH_INFO"], collection) - return client.OK, {}, answer diff --git a/radicale.spec b/radicale.spec index c0edcb7..3828660 100644 --- a/radicale.spec +++ b/radicale.spec @@ -1,6 +1,9 @@ +%global selinux_types %(%{__awk} '/^#[[:space:]]*SELINUXTYPE=/,/^[^#]/ { if ($3 == "-") printf "%s ", $2 }' /etc/selinux/config 2>/dev/null) +%global selinux_variants %([ -z "%{selinux_types}" ] && echo mls targeted || echo %{selinux_types}) + Name: radicale -Version: 0.10 -Release: 9%{?dist} +Version: 1.0.1 +Release: 2%{?dist} Summary: A simple CalDAV (calendar) and CardDAV (contact) server Group: Applications/Internet License: GPLv3+ @@ -15,36 +18,53 @@ Source6: %{name}.if Source7: %{name}-tmpfiles.conf # Patch0: config adjustments for systemwide installation Patch0: %{name}-0.10-systemwide.patch -# Patch1: https://github.com/Kozea/Radicale/issues/117#issuecomment-84588704 -Patch1: %{name}-0.10-fix_delete_entry.patch -# Patch2: https://github.com/Kozea/Radicale/issues/279 -Patch2: %{name}-0.10-fix_charset_handling.patch # el6, el7 do not have phyton3 %define have_python3 %(echo "%{dist}" | egrep -q '^\.el(6|7)$' && echo 0 || echo 1) %define have_policycoreutils_python_utils %(echo "%{dist}" | egrep -q '^(\.el(6|7)|(fc22))$' && echo 0 || echo 1) %if %{have_python3} -%define radicale_python_version python3 -%define radicale_python_bin %{__python3} -%define radicale_python_sitelib %{python3_sitelib} +%define radicale_python_version python3 +%define radicale_python_sitelib %{python3_sitelib} Requires: python3-pam %else # fallback to python2 (el6, el7) -%define radicale_python_version python2 -%define radicale_python_bin %{__python2} -%define radicale_python_sitelib %{python2_sitelib} +%define radicale_python_version python2 +%define radicale_python_sitelib %{python2_sitelib} Requires: python-pam %endif BuildArch: noarch BuildRequires: %{radicale_python_version}-devel BuildRequires: systemd +BuildRequires: checkpolicy +BuildRequires: selinux-policy-devel +BuildRequires: /usr/share/selinux/devel/policyhelp +%if "%{_selinux_policy_version}" != "" +Requires: selinux-policy >= %{_selinux_policy_version} +%endif Requires(pre): shadow-utils Requires(post): systemd +Requires(post): /usr/sbin/semodule, /sbin/fixfiles Requires(preun): systemd Requires(postun): systemd -Requires: %{name}-selinux = %{version}-%{release} +Requires(postun): /usr/sbin/semodule, /sbin/fixfiles +%if %{have_policycoreutils_python_utils} +Requires(post): policycoreutils-python-utils +Requires(postun): policycoreutils-python-utils +%else +Requires(post): policycoreutils-python +Requires(postun): policycoreutils-python +%endif + +%if %{have_python3} +%else +BuildRequires: python-setuptools +%endif + +# seamless upgrade from 0.10-9 +Provides: radicale-selinux +Obsoletes: radicale-selinux <= 0.10-9 %description The Radicale Project is a CalDAV (calendar) and CardDAV (contact) server. It @@ -69,39 +89,20 @@ Requires: mod_wsgi %description httpd httpd config for Radicale -%package selinux -%global selinux_types %(%{__awk} '/^#[[:space:]]*SELINUXTYPE=/,/^[^#]/ { if ($3 == "-") printf "%s ", $2 }' /etc/selinux/config 2>/dev/null) -%global selinux_variants %([ -z "%{selinux_types}" ] && echo mls targeted || echo %{selinux_types}) - -Summary: Selinux policy for Radicale -Requires: %{name} = %{version}-%{release} -%if "%{_selinux_policy_version}" != "" -Requires: selinux-policy >= %{_selinux_policy_version} -%endif -%if %{have_policycoreutils_python_utils} -Requires(post): policycoreutils-python-utils -Requires(postun): policycoreutils-python-utils -%else -Requires(post): policycoreutils-python -Requires(postun): policycoreutils-python -%endif -Requires(post): /usr/sbin/semodule, /sbin/fixfiles -Requires(postun): /usr/sbin/semodule, /sbin/fixfiles -BuildRequires: checkpolicy, selinux-policy-devel, /usr/share/selinux/devel/policyhelp - -%description selinux -Selinux policy for Radicale %prep -%setup -q -n Radicale-%{version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 +%autosetup -n Radicale-%{version} + mkdir SELinux cp -p %{SOURCE4} %{SOURCE5} %{SOURCE6} SELinux + %build -%{radicale_python_bin} setup.py build +%if %{have_python3} +%py3_build +%else +%{__python2} setup.py build +%endif cd SELinux for selinuxvariant in %{selinux_variants} do @@ -112,7 +113,11 @@ done cd - %install -%{radicale_python_bin} setup.py install --skip-build --root %{buildroot} +%if %{have_python3} +%py3_install +%else +%{__python2} setup.py install --skip-build --root %{buildroot} +%endif # Install configuration files mkdir -p %{buildroot}%{_sysconfdir}/%{name}/ @@ -156,14 +161,6 @@ exit 0 %post %systemd_post %{name}.service - -%preun -%systemd_preun %{name}.service - -%postun -%systemd_postun_with_restart %{name}.service - -%post selinux for selinuxvariant in %{selinux_variants} do /usr/sbin/semodule -s ${selinuxvariant} -i \ @@ -174,7 +171,11 @@ semanage port -a -t radicale_port_t -p tcp 5232 > /dev/null 2>&1 || : /sbin/fixfiles -R %{name} restore > /dev/null 2>&1 || : /sbin/fixfiles -R %{name}-httpd restore > /dev/null 2>&1 || : -%postun selinux +%preun +%systemd_preun %{name}.service + +%postun +%systemd_postun_with_restart %{name}.service if [ $1 -eq 0 ] ; then semanage port -d -p tcp 5232 > /dev/null 2>&1 || : for selinuxvariant in %{selinux_variants} @@ -187,7 +188,7 @@ fi %files -%doc README NEWS.rst TODO.rst +%doc README README.rst NEWS.rst TODO.rst %license COPYING %dir %attr(0755, %{name}, %{name}) %{_sysconfdir}/%{name}/ %config(noreplace) %attr(0640, %{name}, %{name}) %{_sysconfdir}/%{name}/config @@ -205,22 +206,24 @@ fi %dir %{_datadir}/%{name} %{_datadir}/%{name}/%{name}.wsgi %{_datadir}/%{name}/%{name}.fcgi +%doc SELinux/* +%{_datadir}/selinux/*/%{name}.pp %files httpd %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf -%files selinux -%defattr(-,root,root,0755) -%doc SELinux/* -%{_datadir}/selinux/*/%{name}.pp - %changelog -* Tue Sep 22 2015 Peter Bieringer - 0.10-9 -- fix policycore-utils and python-pam dependencies - -* Fri Sep 18 2015 Peter Bieringer - 0.10-8 +* Wed Sep 23 2015 Peter Bieringer - 1.0.1-2 +- Fix policycore-utils and python-pam dependencies on el6/el7/fc22 - Switch conditionally back to python2 to support el6/el7 +* Tue Sep 22 2015 Juan Orti Alcaine - 1.0.1-1 +- Version 1.0.1 + +* Tue Sep 15 2015 Juan Orti Alcaine - 1.0-1 +- Version 1.0 +- Merge SELinux subpackage into the main package + * Mon Sep 07 2015 Juan Orti Alcaine - 0.10-7 - Drop old _selinux_policy_version hack - Require radicale-selinux diff --git a/sources b/sources index 8ff8e00..6690ec0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -32655d8893962956ead0ad690cca6044 Radicale-0.10.tar.gz +e29e51df14bc8ca5a580998d5d592285 Radicale-1.0.1.tar.gz