Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:ecsos:server
Radicale
Radicale.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File Radicale.spec of Package Radicale
# # spec file for package Radicale # # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2012-2018 Ákos Szőts <szotsaki@gmail.com> # Copyright (c) 2011 Marcus Rueckert <darix@opensu.se> # # 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/ # %define pkg_name radicale %define pkg_config %{_sysconfdir}/%{pkg_name} %define pkg_home %{_localstatedir}/lib/%{pkg_name} %define pkg_user %{pkg_name} %define pkg_group %{pkg_name} %define pkg_log %{_localstatedir}/log/%{pkg_name} %define py_min_ver 3.5.2 %define vo_min_ver 0.9.6 %define du_min_ver 2.7.3 Name: Radicale Version: 3.0.2 Release: 0 Summary: A CalDAV calendar and CardDav contact server License: GPL-3.0-or-later Group: Productivity/Office/Other URL: http://www.radicale.org/ Source: https://github.com/Kozea/Radicale/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: radicale.service Source2: Radicale.logrotate Source3: Radicale.firewall BuildRequires: fdupes BuildRequires: pkgconfig BuildRequires: python-rpm-macros BuildRequires: python3-python-dateutil >= %{du_min_ver} BuildRequires: python3-setuptools BuildRequires: python3-vobject >= %{vo_min_ver} BuildRequires: systemd-rpm-macros BuildRequires: pkgconfig(python3) >= %{py_min_ver} Requires: logrotate Requires: python3 >= %{py_min_ver} Requires: python3-python-dateutil >= %{du_min_ver} Requires: python3-vobject >= %{vo_min_ver} Requires(pre): pwdutils Recommends: apache2-utils Recommends: python3-bcrypt Recommends: python3-passlib Recommends: python3-systemd BuildArch: noarch %{?systemd_requires} %description Radicale is a small but powerful CalDAV (calendars, todo-lists) and CardDAV (contacts) server, that: * Shares calendars through CalDAV, WebDAV and HTTP. * Shares contacts through CardDAV, WebDAV and HTTP. * Supports events, todos, journal entries and business cards. * Works out-of-the-box, no installation nor configuration required. * Can warn users on concurrent editing. * Can limit access by authentication. * Can secure connections. * Works with many CalDAV and CardDAV clients. * Is GPLv3-licensed free software. %prep %setup -q %build # TODO: https://en.opensuse.org/openSUSE:Packaging_Python_Singlespec # On Leap <= 15.0 it would default back to Python 2: "rpm -E % python_flavor" # % {python_build} %install # % {python_setup} python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} install -m 0750 -d %{buildroot}%{pkg_config}/ %{buildroot}%{pkg_home}/ install -m 0640 config %{buildroot}%{pkg_config}/config install -m 0755 -d %{buildroot}%{_sbindir}/ install -D -m 444 %{SOURCE1} %{buildroot}%{_unitdir}/%{pkg_name}.service ln -sfv %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{pkg_name} install -m 0644 -D %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} install -m 0644 -D %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name} touch %{buildroot}%{pkg_config}/rights touch %{buildroot}%{pkg_config}/users mkdir %{buildroot}%{_localstatedir}/log/ touch %{buildroot}%{_localstatedir}/log/%{pkg_name} mkdir %{buildroot}%{pkg_home}/collections %fdupes %{buildroot}%{python3_sitelib} touch upgrade-1to2 %{suse_install_update_message upgrade-1to2} %pre getent group %{pkg_group} >/dev/null || groupadd -r %{pkg_group} getent passwd %{pkg_user} >/dev/null || useradd -r -g %{pkg_group} -d %{pkg_home} -s /sbin/nologin -c "Radicale CalDAV server" %{pkg_user} %service_add_pre %{pkg_name}.service # We are upgrading POST_MESSAGE=%{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}-upgrade-1to2.txt if [ -f "$POST_MESSAGE" ]; then truncate -s 0 "$POST_MESSAGE" fi if [ $1 -gt 1 ]; then RADICALE=%{_bindir}/%{pkg_name} OLD_VERSION=$("$RADICALE" --version 2>&1 | tr -d .) touch "$POST_MESSAGE" # Version >= 1.1.3 can export its storage to 2.0 format if [ "$OLD_VERSION" -ge 113 ] && [ "$OLD_VERSION" -lt 200 ]; then EXPORT_DESTDIR=%{pkg_home}/collections if [ -e "$EXPORT_DESTDIR" ]; then EXPORT_DESTDIR="${EXPORT_DESTDIR}_${RANDOM}" fi ERR_CODE=0 if [ "$OLD_VERSION" -eq 113 ]; then # Workaround for bug https://github.com/Kozea/Radicale/issues/651 TMP_EXPORT_DIR=/tmp/radicale-2-collection-export "$RADICALE" --export-storage "$TMP_EXPORT_DIR" ERR_CODE=$? mv "$TMP_EXPORT_DIR" "$EXPORT_DESTDIR" else "$RADICALE" --export-storage "$EXPORT_DESTDIR" ERR_CODE=$? fi if [ "$ERR_CODE" -ne 0 ]; then echo "Converting Radicale 1 calendars to Radicale 2 format failed." | tee -a "$POST_MESSAGE" echo "Please, read http://radicale.org/1to2/ for further information." | tee -a "$POST_MESSAGE" else chown -R %{pkg_user}:%{pkg_group} "$EXPORT_DESTDIR" echo "Your Radicale 1 calendars were converted to Radicale 2 format into $EXPORT_DESTDIR." | tee -a "$POST_MESSAGE" echo "" | tee -a "$POST_MESSAGE" echo "Please, do check your configuration in %{pkg_config}/config[.rpmnew] before starting Radicale 2 for the first time!" | tee -a "$POST_MESSAGE" fi fi if [ "$OLD_VERSION" -lt 113 ]; then echo "Converting Radicale 1 calendars to version 2 format was not possible because your Radicale 1 version had been too old (less than 1.1.3)." | tee -a "$POST_MESSAGE" echo "Please, read http://radicale.org/1to2/ for further information." | tee -a "$POST_MESSAGE" echo "" | tee -a "$POST_MESSAGE" echo "Please, do check your configuration in %{pkg_config}/config[.rpmnew] before starting Radicale 2 for the first time!" | tee -a "$POST_MESSAGE" fi fi exit 0 %post test -e %{pkg_log} || touch %{pkg_log} test -e %{pkg_config}/rights || touch %{pkg_config}/rights test -e %{pkg_config}/users || touch %{pkg_config}/users %service_add_post %{pkg_name}.service %preun %service_del_preun %{pkg_name}.service %postun %service_del_postun %{pkg_name}.service %files %license COPYING %doc NEWS.md README.md %{_bindir}/%{pkg_name} %{python3_sitelib}/%{name}-%{version}-py*.egg-info %{python3_sitelib}/%{pkg_name}/ %{_sbindir}/rc%{pkg_name} %config %{_unitdir}/%{pkg_name}.service %config(noreplace) %attr(-,root,%{pkg_group}) %{pkg_config}/ %config %{_sysconfdir}/logrotate.d/%{name} %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name} %dir %attr(-,%{pkg_user},%{pkg_group}) %{pkg_home}/ # Update message %dir %{_localstatedir}/adm/update-messages %ghost %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}-upgrade-1to2.txt # Create empty files and folders for the user to configure it properly later %dir %attr(-,%{pkg_user},%{pkg_group}) %{pkg_home}/collections %ghost %config(noreplace) %attr(660,%{pkg_user},%{pkg_group}) %{pkg_config}/rights %ghost %config(noreplace) %attr(660,%{pkg_user},%{pkg_group}) %{pkg_config}/users %ghost %config(noreplace) %attr(620,root,%{pkg_group}) %{pkg_log} %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor