diff options
author | root <root@rshg054.dnsready.net> | 2012-09-04 00:04:04 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-09-04 00:04:04 +0000 |
commit | 8b7b4f2e5a808cb0c1226c23469fa57751eba190 (patch) | |
tree | d3b039c682e3991febbfa886b15b31cf09d048b8 /testing/fetchmail | |
parent | 81de702a6fc79e430129a7d2b708d90f43ae5ba1 (diff) |
Tue Sep 4 00:04:04 UTC 2012
Diffstat (limited to 'testing/fetchmail')
-rw-r--r-- | testing/fetchmail/PKGBUILD | 42 | ||||
-rw-r--r-- | testing/fetchmail/fetchmail.conf | 5 | ||||
-rw-r--r-- | testing/fetchmail/fetchmail.install | 26 | ||||
-rw-r--r-- | testing/fetchmail/fetchmail.rc | 38 | ||||
-rw-r--r-- | testing/fetchmail/fetchmail.service | 12 | ||||
-rw-r--r-- | testing/fetchmail/fetchmail.tmpfiles | 1 |
6 files changed, 124 insertions, 0 deletions
diff --git a/testing/fetchmail/PKGBUILD b/testing/fetchmail/PKGBUILD new file mode 100644 index 000000000..f4045b5c2 --- /dev/null +++ b/testing/fetchmail/PKGBUILD @@ -0,0 +1,42 @@ +# $Id: PKGBUILD 165877 2012-09-02 12:54:03Z pierre $ + +pkgname=fetchmail +pkgver=6.3.22 +pkgrel=1 +pkgdesc="A remote-mail retrieval utility" +arch=('i686' 'x86_64') +url="http://fetchmail.berlios.de/" +license=('GPL') +depends=('openssl') +makedepends=('python2') +optdepends=('tk: for using fetchmailconf' + 'python2: for using fetchmailconf') +backup=('etc/conf.d/fetchmail') +options=('!makeflags') +install='fetchmail.install' +source=("http://downloads.sourceforge.net/$pkgname/${pkgname}-${pkgver}.tar.xz" + "http://downloads.sourceforge.net/$pkgname/${pkgname}-${pkgver}.tar.xz.asc" + 'fetchmail.rc' 'fetchmail.conf' 'fetchmail.tmpfiles' 'fetchmail.service') +sha1sums=('3bb755010dbe568d53840e22d8e87d8d5db25b19' + '27184b75ef09c5202bede9863ae8abc3d0cdb1d2' + 'fc25180f1add26df0a3bdaac03fd9d2e3473ff88' + '30401729386d6f774c6c36ab8530842166de54a8' + '199ba749c829f22286c34aabcf8b7dd5bbd7c0e6' + '11ff81fc8363a54099880da18634b0d1ecf9fa82') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + sed -i 's|/usr/bin/env python|/usr/bin/env python2|' fetchmailconf.py + PYTHON=python2 ./configure --prefix=/usr --with-ssl=/usr + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make DESTDIR="${pkgdir}" install + install -Dm755 "${srcdir}/fetchmail.rc" "${pkgdir}/etc/rc.d/fetchmail" + install -Dm644 "${srcdir}/fetchmail.conf" "${pkgdir}/etc/conf.d/fetchmail" + install -d -o 90 -g nobody "${pkgdir}/var/lib/fetchmail" + install -D -m644 ${srcdir}/fetchmail.tmpfiles ${pkgdir}/usr/lib/tmpfiles.d/fetchmail.conf + install -D -m644 ${srcdir}/fetchmail.service ${pkgdir}/usr/lib/systemd/system/fetchmail.service +} diff --git a/testing/fetchmail/fetchmail.conf b/testing/fetchmail/fetchmail.conf new file mode 100644 index 000000000..dcac2a067 --- /dev/null +++ b/testing/fetchmail/fetchmail.conf @@ -0,0 +1,5 @@ +# Daemon polling interval +INTERVAL=60 + +# Config location +CONFIG=/etc/fetchmailrc diff --git a/testing/fetchmail/fetchmail.install b/testing/fetchmail/fetchmail.install new file mode 100644 index 000000000..81b374c57 --- /dev/null +++ b/testing/fetchmail/fetchmail.install @@ -0,0 +1,26 @@ +post_install() { + # /etc/fetchmail must be owned by fetchmail for daemon to work. + echo "If you run fetchmail as a daemon and not a cron job" + echo "then 'chown fetchmail /etc/fetchmailrc'" + getent passwd fetchmail >/dev/null || usr/sbin/useradd -u 90 -g nobody \ + -d '/var/lib/fetchmail' -c 'Fetchmail daemon' -s /bin/false fetchmail + if [[ ! -d run/fetchmail ]]; then + usr/bin/systemd-tmpfiles --create usr/lib/tmpfiles.d/fetchmail.conf + fi +} + +post_upgrade() { + getent passwd fetchmail >/dev/null || usr/sbin/useradd -u 90 -g nobody \ + -d '/var/lib/fetchmail' -c 'Fetchmail daemon' -s /bin/false fetchmail + + if [ "$(vercmp $2 6.3.19-3)" -lt 0 ] ; then + usermod -d '/var/lib/fetchmail' -s /bin/false fetchmail + fi + if [[ ! -d run/fetchmail ]]; then + usr/bin/systemd-tmpfiles --create usr/lib/tmpfiles.d/fetchmail.conf + fi +} + +pre_remove() { + usr/sbin/userdel fetchmail &>/dev/null +} diff --git a/testing/fetchmail/fetchmail.rc b/testing/fetchmail/fetchmail.rc new file mode 100644 index 000000000..4d8b98d40 --- /dev/null +++ b/testing/fetchmail/fetchmail.rc @@ -0,0 +1,38 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/fetchmail + +PID=`pidof -o %PPID /usr/bin/fetchmail` +case "$1" in + start) + stat_busy "Starting fetchmail" + [ -z "$PID" ] && + su -c "/usr/bin/fetchmail -d $INTERVAL -f $CONFIG" -s /bin/sh fetchmail + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon fetchmail + stat_done + fi + ;; + stop) + stat_busy "Stopping fetchmail" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon fetchmail + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/testing/fetchmail/fetchmail.service b/testing/fetchmail/fetchmail.service new file mode 100644 index 000000000..3e7da7545 --- /dev/null +++ b/testing/fetchmail/fetchmail.service @@ -0,0 +1,12 @@ +[Unit] +Description=A remote-mail retrieval utility +After=network.target + +[Service] +User=fetchmail +EnvironmentFile=/etc/conf.d/fetchmail +ExecStart=/usr/bin/fetchmail -d ${INTERVAL} -f ${CONFIG} +RestartSec=1 + +[Install] +WantedBy=multi-user.target diff --git a/testing/fetchmail/fetchmail.tmpfiles b/testing/fetchmail/fetchmail.tmpfiles new file mode 100644 index 000000000..07945f876 --- /dev/null +++ b/testing/fetchmail/fetchmail.tmpfiles @@ -0,0 +1 @@ +d /run/fetchmail 700 fetchmail nobody |