1

Topic: Installing Radicale with OpenRC

Hello together,

I was missing Radicale as server for CalDAV and CardDAV, so I had done some research resulting in building my own package. Perhaps this could be helpful for others interested.

First things first: I'm using the official package from Arch Linux: https://git.archlinux.org/svntogit/comm … s/radicale

As to view under the source link this package is using systemd-architecture, so I had to modify the package-build and create compatible scripts with OpenRC.

The PKGBUILD-file from the concurrent version on my homeserver:

# Maintainer: Moritz Lipp <mlq@pwmt.org>
# Co-Maintainer: fordprefect <fordprefect@dukun.de>
# Contributor: Thor77 <thor77@thor77.org>

pkgname=radicale
_name=Radicale
pkgver=2.1.9
pkgrel=2
pkgdesc='Simple calendar (CalDAV) and contact (CardDAV) server'
arch=('any')
url="http://www.radicale.org/"
license=('GPL3')
depends=('python-bcrypt' 'python-passlib' 'python-setuptools' 'python-vobject')
checkdepends=('python-bcrypt' 'python-pytest-cov' 'python-pytest-flake8' 'python-pytest-isort' 'python-pytest-runner')
backup=('etc/radicale/config')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/Kozea/${pkgname}/archive/${pkgver}.tar.gz"
        "${pkgname}-sysusers.conf"
        "${pkgname}-tmpfiles.conf"
        "${pkgname}.initd")
sha512sums=('30df36772f4dd38c9c79ecd9669da8b40c7284afa9e2949c174c159838c33a66edec1a49adf7c110017dc83c592415be6fa43e2de6007d7e154b8707773c4a44'
            '444489ba929680490884e338acc311fb61d81f9d9f0282c92c40a80317af9e61123e4764e803d1698876417170efd40bfe7f56408570891c4e426de3be17c302'
            '4570ed393b73bc5a3fd571947acae78b96b5e17f659e3169f542b9c481635680c724d5c6c0952661fae063caf04c786afe7043c5052945e7a00bb66326dec016'
            '8c6155b8184e406ecd62201edffd34ff4b6c56e8a1f7e6eef45e86ff03ce55a6f1d35876ea020f46f2542707e60e70a215d42a054f374e56a26030b64c4e499c')

prepare() {
  mv -v ${_name}-${pkgver} ${pkgname}-${pkgver}
  cd ${pkgname}-${pkgver}
  # removing version pinning, as we are rolling release
  # expect to hit bugs!
  sed -e 's/vobject\=\=0\.9\.5/vobject/' \
      -e 's/python-dateutil\=\=2\.6\.1/python-dateutil/' \
      -i setup.py
}

build() {
  cd "${pkgname}-${pkgver}"
  python setup.py build
}

package() {
  cd "${pkgname}-${pkgver}"
  python setup.py install --skip-build \
    --optimize=1 \
    --prefix=/usr \
    --root="${pkgdir}"
    # config
    install -vDm 644 config "${pkgdir}/etc/${pkgname}/config"
    # fcgi/wsgi
    install -t "${pkgdir}/usr/share/${pkgname}/" \
      -vDm 644 "${pkgname}.fcgi" \
      -vDm 644 "${pkgname}.wsgi"
    # systemd service
    install -vDm 755 "${srcdir}/${pkgname}.initd" \
      "${pkgdir}/etc/init.d/${pkgname}"
    # sysusers.d
    install -vDm 644 "${srcdir}/${pkgname}-sysusers.conf" \
      "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
    # tmpfiles.d
    install -vDm 644 "${srcdir}/${pkgname}-tmpfiles.conf" \
      "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
    # docs
    install -t "${pkgdir}/usr/share/doc/${pkgname}/" -vDm 644 {NEWS,README}.md
}

Followed up is now the init-script for OpenRC:

#!/sbin/openrc-run
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

pidfile="/run/radicale.pid"
command="/usr/bin/radicale"
command_args="--foreground"
command_background="yes"

depend() {
    use net
    need localmount
}

Of course you also need the other files to download, otherwise makepkg won't startup building the package. But after installation with pacman -U the new service can be used with OpenRC.

Human being in favor with clear principles and so also for freedom in soft- and hardware!

Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!