aboutsummaryrefslogtreecommitdiffstats
path: root/main/fetchmail
diff options
context:
space:
mode:
Diffstat (limited to 'main/fetchmail')
-rw-r--r--main/fetchmail/APKBUILD46
-rwxr-xr-xmain/fetchmail/fetchmail.initd34
-rw-r--r--main/fetchmail/fetchmail.post-install3
-rw-r--r--main/fetchmail/fetchmail.pre-install4
4 files changed, 87 insertions, 0 deletions
diff --git a/main/fetchmail/APKBUILD b/main/fetchmail/APKBUILD
new file mode 100644
index 0000000000..c18f2e382a
--- /dev/null
+++ b/main/fetchmail/APKBUILD
@@ -0,0 +1,46 @@
+# Contributor: Michael Mason <ms13sp@gmail.com>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=fetchmail
+pkgver=6.3.20
+pkgrel=1
+pkgdesc="A remote-mail retrieval and forwarding utility"
+url="http://fetchmail.berlios.de/"
+arch="all"
+license="GPL"
+depends=
+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.initd"
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --with-ssl \
+ --disable-nls
+ make || return 1
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+ install -Dm755 "$srcdir"/fetchmail.initd "$pkgdir"/etc/init.d/fetchmail
+ install -d "$pkgdir"/var/lib/fetchmail "$pkgdir"/var/run/fetchmail
+}
+
+fetchmailconf() {
+ depends="python"
+ pkgdesc="A GUI for generating fetchmail configuration files"
+ install=
+ mkdir -p "$subpkgdir"/usr/bin
+ cd "$pkgdir"
+ mv usr/bin/fetchmailconf "$subpkgdir"/usr/bin/
+ mv usr/lib "$subpkgdir"/usr/
+}
+
+md5sums="9176a9005a816946f766774bc4cbc642 fetchmail-6.3.20.tar.bz2
+b27fe01a7c25534d62d175c8ba22fc48 fetchmail.initd"
diff --git a/main/fetchmail/fetchmail.initd b/main/fetchmail/fetchmail.initd
new file mode 100755
index 0000000000..73286c4e70
--- /dev/null
+++ b/main/fetchmail/fetchmail.initd
@@ -0,0 +1,34 @@
+#!/sbin/runscript
+
+pidfile=/var/run/fetchmail/fetchmail.pid
+
+depend() {
+ need net
+ after firewall
+ use mta
+}
+
+checkconfig() {
+ if [ ! -f /etc/fetchmailrc ]; then
+ eerror "Configuration file /etc/fetchmailrc not found"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting fetchmail"
+ start-stop-daemon --start --quiet \
+ --chuid fetchmail --exec /usr/bin/fetchmail \
+ -- -d ${polling_period:-300} -f /etc/fetchmailrc \
+ --pidfile ${pidfile} -i /var/lib/fetchmail/.fetchids
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping fetchmail"
+ start-stop-daemon --stop --quiet --pidfile ${pidfile}
+ eend ${?}
+}
+
diff --git a/main/fetchmail/fetchmail.post-install b/main/fetchmail/fetchmail.post-install
new file mode 100644
index 0000000000..b16bfcc3e4
--- /dev/null
+++ b/main/fetchmail/fetchmail.post-install
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+chown fetchmail:fetchmail /var/*/fetchmail
diff --git a/main/fetchmail/fetchmail.pre-install b/main/fetchmail/fetchmail.pre-install
new file mode 100644
index 0000000000..4a1b630e00
--- /dev/null
+++ b/main/fetchmail/fetchmail.pre-install
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+adduser -H -h /var/lib/fetchmail -s /bin/false -D fetchmail 2>/dev/null
+exit 0