Commit e504121a authored by Natanael Copa's avatar Natanael Copa

extra/fetchmail: create fetchmail user and fix init.d script

parent e318f7ea
......@@ -2,16 +2,17 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fetchmail
pkgver=6.3.9
pkgrel=0
pkgrel=1
pkgdesc="A remote-mail retrieval and forwarding utility"
url="http://fetchmail.berlios.de/"
license="GPL"
depends="openssl uclibc"
makedepends="openssl-dev"
install=
makedepends="openssl-dev python"
install="fetchmail.pre-install fetchmail.post-install"
subpackages="$pkgname-doc fetchmailconf"
source="http://download.berlios.de/fetchmail/$pkgname-$pkgver.tar.bz2
fetchmail.initrd"
$install
fetchmail.initd"
build() {
cd "$srcdir/$pkgname-$pkgver"
......@@ -24,6 +25,7 @@ build() {
make || return 1
make DESTDIR="$pkgdir" install
install -Dm755 $srcdir/fetchmail.initrd "$pkgdir"/etc/init.d/fetchmail
install -d "$pkgdir"/var/lib/fetchmail
}
fetchmailconf() {
......@@ -36,4 +38,6 @@ fetchmailconf() {
}
md5sums="72c20ad2b9629f1a109668b05a84d823 fetchmail-6.3.9.tar.bz2
b6b95767279d77c98acdc3aa4d00ec89 fetchmail.initrd"
5a2fc8e8b3115fe2b9bf23503fb8f0a4 fetchmail.pre-install
e27237ed73ad183ddd06dfd5e3dd0da7 fetchmail.post-install
9a64c2b77d1a03a1eb8648a32d46b2c5 fetchmail.initd"
#!/sbin/runscript
pidfile=/var/run/fetchmail/fetchmail.pid
depend() {
need net
use mta
......@@ -16,15 +18,16 @@ start() {
checkconfig || return 1
ebegin "Starting fetchmail"
start-stop-daemon --start --quiet --exec /usr/bin/fetchmail \
--chuid ${USER:-fetchmail}:${GROUP:-fetchmail} \
-- -d ${polling_period} -f /etc/fetchmailrc
start-stop-daemon --start --quiet \
--chuid fetchmail --exec /usr/bin/fetchmail \
-- -d ${polling_period} -f /etc/fetchmailrc \
--pidfile ${pidfile} -i /var/lib/fetchmail/.fetchids
eend ${?}
}
stop() {
ebegin "Stopping fetchmail"
start-stop-daemon --stop --quiet --pidfile /var/run/fetchmail.pid
start-stop-daemon --stop --quiet --pidfile ${pidfile}
eend ${?}
}
#!/bin/sh
chown fetchmail:fetchmail /var/lib/fetchmail
#!/bin/sh
adduser -H -h /var/lib/fetchmail -s /bin/false -D fetchmail 2>/dev/null
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment