[arch-commits] Commit in fetchmail/trunk (5 files)

Pierre Schmitz pierre at archlinux.org
Thu Jun 7 06:25:44 UTC 2012


    Date: Thursday, June 7, 2012 @ 02:25:43
  Author: pierre
Revision: 160934

add systemd support; cleanup

Added:
  fetchmail/trunk/fetchmail.service
  fetchmail/trunk/fetchmail.tmpfiles
Modified:
  fetchmail/trunk/PKGBUILD
  fetchmail/trunk/fetchmail.install
  fetchmail/trunk/fetchmail.rc

--------------------+
 PKGBUILD           |   18 +++++++++++-------
 fetchmail.install  |    6 ++++++
 fetchmail.rc       |    6 ++----
 fetchmail.service  |   12 ++++++++++++
 fetchmail.tmpfiles |    1 +
 5 files changed, 32 insertions(+), 11 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2012-06-07 05:56:33 UTC (rev 160933)
+++ PKGBUILD	2012-06-07 06:25:43 UTC (rev 160934)
@@ -1,9 +1,8 @@
 # $Id$
-# Maintainer: Aaron Griffin <aaron at archlinux.org>
 
 pkgname=fetchmail
 pkgver=6.3.21
-pkgrel=3
+pkgrel=4
 pkgdesc="A remote-mail retrieval utility"
 arch=('i686' 'x86_64')
 url="http://fetchmail.berlios.de/"
@@ -14,13 +13,16 @@
             'python2: for using fetchmailconf')
 backup=('etc/conf.d/fetchmail')
 options=('!makeflags')
-install=fetchmail.install
-source=(http://downloads.sourceforge.net/$pkgname.berlios/${pkgname}-${pkgver}.tar.xz{,.asc}
-        fetchmail.rc fetchmail.conf)
+install='fetchmail.install'
+source=("http://downloads.sourceforge.net/$pkgname.berlios/${pkgname}-${pkgver}.tar.xz"
+        "http://downloads.sourceforge.net/$pkgname.berlios/${pkgname}-${pkgver}.tar.xz.asc"
+        'fetchmail.rc' 'fetchmail.conf' 'fetchmail.tmpfiles' 'fetchmail.service')
 sha1sums=('4f1e5f2e1a616d4007da1de9c976c2c1fb5dcb81'
           'bc8c68ec0d71b97d3168981cbaa4b04ab8e56059'
-          '910ec21ad0a619db67e4665189dc46d2a0634ea5'
-          '30401729386d6f774c6c36ab8530842166de54a8')
+          'fc25180f1add26df0a3bdaac03fd9d2e3473ff88'
+          '30401729386d6f774c6c36ab8530842166de54a8'
+          '199ba749c829f22286c34aabcf8b7dd5bbd7c0e6'
+          '11ff81fc8363a54099880da18634b0d1ecf9fa82')
 
 build() {
   cd "${srcdir}/${pkgname}-${pkgver}"
@@ -35,4 +37,6 @@
   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
 }

Modified: fetchmail.install
===================================================================
--- fetchmail.install	2012-06-07 05:56:33 UTC (rev 160933)
+++ fetchmail.install	2012-06-07 06:25:43 UTC (rev 160934)
@@ -4,6 +4,9 @@
   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() {
@@ -13,6 +16,9 @@
   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() {

Modified: fetchmail.rc
===================================================================
--- fetchmail.rc	2012-06-07 05:56:33 UTC (rev 160933)
+++ fetchmail.rc	2012-06-07 06:25:43 UTC (rev 160934)
@@ -2,15 +2,14 @@
 
 . /etc/rc.conf
 . /etc/rc.d/functions
-[ -f /etc/conf.d/fetchmail ] && . /etc/conf.d/fetchmail
+. /etc/conf.d/fetchmail
 
 PID=`pidof -o %PPID /usr/bin/fetchmail`
 case "$1" in
   start)
     stat_busy "Starting fetchmail"
-    [ ! -d /var/run/fetchmail ] && install -d -o fetchmail -g nobody -m700 /var/run/fetchmail
     [ -z "$PID" ] &&
-		su -c "/usr/bin/fetchmail -d $INTERVAL -f $CONFIG" -s /bin/sh fetchmail
+      su -c "/usr/bin/fetchmail -d $INTERVAL -f $CONFIG" -s /bin/sh fetchmail
     if [ $? -gt 0 ]; then
       stat_fail
     else
@@ -24,7 +23,6 @@
     if [ $? -gt 0 ]; then
       stat_fail
     else
-      rm -f /var/run/fetchmail.pid
       rm_daemon fetchmail
       stat_done
     fi

Added: fetchmail.service
===================================================================
--- fetchmail.service	                        (rev 0)
+++ fetchmail.service	2012-06-07 06:25:43 UTC (rev 160934)
@@ -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

Added: fetchmail.tmpfiles
===================================================================
--- fetchmail.tmpfiles	                        (rev 0)
+++ fetchmail.tmpfiles	2012-06-07 06:25:43 UTC (rev 160934)
@@ -0,0 +1 @@
+d /run/fetchmail 700 fetchmail nobody




More information about the arch-commits mailing list