radicale-vl.spec 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. %bcond_with systemd
  2. Summary: A simple CalDAV (calendar) and CardDAV (contact) server
  3. Name: radicale
  4. Version: 2.1.12
  5. Release: 1%{?_dist_release}%{?with_systemd:.systemd}
  6. Group: servers
  7. Vendor: Project Vine
  8. Distribution: Vine Linux
  9. License: GPLv3+
  10. URL: https://radicale.org
  11. Source0: https://github.com/Kozea/Radicale/archive/%{version}/%{name}-%{version}.tar.gz
  12. Source1: %{name}.service
  13. Source2: %{name}-logrotate
  14. Source7: %{name}-tmpfiles.conf
  15. Source1000: %{name}.init
  16. BuildArch: noarch
  17. BuildRequires: python3-rpm-macros
  18. BuildRequires: python3-devel
  19. BuildRequires: python3-setuptools
  20. Requires: python3-%{name} = %{version}-%{release}
  21. Requires(pre): shadow-utils
  22. %if %{with systemd}
  23. BuildRequires: systemd
  24. %{?systemd_requires}
  25. %else
  26. Requires(post): chkconfig
  27. Requires(preun): chkconfig
  28. Requires(preun): /sbin/service
  29. Requires(postun): /sbin/service
  30. %endif
  31. %description
  32. The Radicale Project is a CalDAV (calendar) and CardDAV (contact) server. It
  33. aims to be a light solution, easy to use, easy to install, easy to configure.
  34. As a consequence, it requires few software dependencies and is pre-configured
  35. to work out-of-the-box.
  36. The Radicale Project runs on most of the UNIX-like platforms (Linux, BSD,
  37. MacOS X) and Windows. It is known to work with Evolution, Lightning, iPhone
  38. and Android clients. It is free and open-source software, released under GPL
  39. version 3.
  40. %package -n python3-%{name}
  41. Summary: A simple CalDAV (calendar) and CardDAV (contact) server
  42. Group: programming
  43. Requires: python3-vobject
  44. Recommends: python3-bcrypt
  45. Recommends: python3-passlib
  46. %{?python_provide:%python_provide python3-%{name}}
  47. %description -n python3-%{name}
  48. The Radicale Project is a CalDAV (calendar) and CardDAV (contact) server. It
  49. aims to be a light solution, easy to use, easy to install, easy to configure.
  50. As a consequence, it requires few software dependencies and is pre-configured
  51. to work out-of-the-box.
  52. The Radicale Project runs on most of the UNIX-like platforms (Linux, BSD,
  53. MacOS X) and Windows. It is known to work with Evolution, Lightning, iPhone
  54. and Android clients. It is free and open-source software, released under GPL
  55. version 3.
  56. %prep
  57. %autosetup -n Radicale-%{version}
  58. %build
  59. %py3_build
  60. %install
  61. %py3_install
  62. # Install configuration files
  63. mkdir -p %{buildroot}%{_sysconfdir}/%{name}/
  64. install -p -m 640 config %{buildroot}%{_sysconfdir}/%{name}/
  65. install -p -m 644 logging %{buildroot}%{_sysconfdir}/%{name}/
  66. install -p -m 644 rights %{buildroot}%{_sysconfdir}/%{name}/
  67. # Install wsgi file
  68. mkdir -p %{buildroot}%{_datadir}/%{name}
  69. sed -i 's|^#!/usr/bin/env python3$|#!/usr/bin/python3|' radicale.wsgi
  70. sed -i 's|^#!/usr/bin/env python3$|#!/usr/bin/python3|' radicale.fcgi
  71. install -p -m 755 radicale.wsgi %{buildroot}%{_datadir}/%{name}/
  72. install -p -m 755 radicale.fcgi %{buildroot}%{_datadir}/%{name}/
  73. # Create folder where the calendar will be stored
  74. mkdir -p %{buildroot}%{_sharedstatedir}/%{name}/
  75. %if %{with systemd}
  76. install -D -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
  77. install -D -p -m 644 %{SOURCE7} %{buildroot}%{_tmpfilesdir}/%{name}.conf
  78. %else
  79. install -D -p -m 755 %{SOURCE1000} %{buildroot}%{_initdir}/%{name}
  80. %endif
  81. install -D -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
  82. mkdir -p %{buildroot}/run/%{name}
  83. mkdir -p %{buildroot}%{_localstatedir}/log/%{name}
  84. %pre
  85. getent group %{name} >/dev/null || groupadd -r %{name}
  86. getent passwd %{name} >/dev/null || \
  87. useradd -r -g %{name} -d %{_sharedstatedir}/%{name} -s /sbin/nologin \
  88. -c "Radicale service account" %{name}
  89. exit 0
  90. %post
  91. %if %{with systemd}
  92. %systemd_post %{name}.service
  93. %else
  94. if [ $1 -eq 1 ]; then
  95. /sbin/chkconfig --add radicale
  96. fi
  97. %endif
  98. %preun
  99. %if %{with systemd}
  100. %systemd_preun %{name}.service
  101. %else
  102. if [ $1 -eq 0 -o /bin/systemctl ]; then
  103. /sbin/service radicale status >/dev/null 2>&1 && \
  104. /sbin/service radicale stop ||:
  105. /sbin/chkconfig --del radicale
  106. fi
  107. %endif
  108. %postun
  109. %if %{with systemd}
  110. %systemd_postun_with_restart %{name}.service
  111. %else
  112. if [ $1 -gt 0 ]; then
  113. /sbin/service radicale condrestart ||:
  114. fi
  115. %endif
  116. %files
  117. %license COPYING
  118. %doc README.md NEWS.md
  119. %{_bindir}/%{name}
  120. %dir %{_sysconfdir}/%{name}/
  121. %config(noreplace) %attr(0640, root, %{name}) %{_sysconfdir}/%{name}/config
  122. %config(noreplace) %{_sysconfdir}/%{name}/logging
  123. %config(noreplace) %{_sysconfdir}/%{name}/rights
  124. %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
  125. %if %{with systemd}
  126. %{_unitdir}/%{name}.service
  127. %{_tmpfilesdir}/%{name}.conf
  128. %else
  129. %{_initdir}/%{name}
  130. %endif
  131. %dir %attr(750, %{name}, %{name}) %{_localstatedir}/log/%{name}
  132. %dir %attr(750, %{name}, %{name}) %{_sharedstatedir}/%{name}/
  133. %{_datadir}/%{name}/*
  134. %ghost %dir %attr(755, %{name}, %{name}) /run/%{name}
  135. %files -n python3-%{name}
  136. %license COPYING
  137. %{python3_sitelib}/%{name}
  138. %{python3_sitelib}/Radicale-*.egg-info
  139. %changelog
  140. * Sat Aug 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.1.12-1
  141. - new upstream release.
  142. * Tue May 05 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.1.11-2
  143. - added systemd support (disabled as default).
  144. * Thu Feb 14 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.1.11-1
  145. - new upstream release.
  146. * Wed Jan 31 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.1.8-1
  147. - new upstream release.
  148. * Thu Oct 22 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.0.1-1
  149. - new upstream release.
  150. * Thu Apr 03 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.9-1.beta1
  151. - new upstream release.
  152. * Sun Aug 11 2013 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.8-1
  153. - new upstream release.
  154. * Thu Oct 13 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.6.2-1
  155. - new upstream release.
  156. * Tue Aug 23 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.6-1
  157. - new upstream release.
  158. * Sun May 22 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.5-1
  159. - initial build.