summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Panteleev2016-08-22 12:50:07 +0000
committerVladimir Panteleev2016-08-22 12:51:40 +0000
commit694cda066769f45621925a199655229420711940 (patch)
tree4177669040b1f4b9d6b145629c4958dd0474cd55
downloadaur-694cda066769f45621925a199655229420711940.tar.gz
Initial commit
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD31
-rw-r--r--femtomail.install20
3 files changed, 73 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..9daf0615ffef
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+# Generated by mksrcinfo v8
+# Mon Aug 22 12:51:33 UTC 2016
+pkgbase = femtomail-git
+ pkgdesc = Minimal sendmail replacement for forwarding mail to a single Maildir box
+ pkgver = r10.e278dfc
+ pkgrel = 1
+ url = https://git.lekensteyn.nl/femtomail/
+ install = femtomail.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = gcc
+ makedepends = git
+ depends = glibc
+ provides = smtp-forwarder
+ conflicts = smtp-forwarder
+ conflicts = smtp-server
+ source = git+https://git.lekensteyn.nl/femtomail.git
+ md5sums = SKIP
+
+pkgname = femtomail-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..2a419139e2b3
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,31 @@
+# Maintainer: Vladimir Panteleev <arch-pkg at thecybershadow.net>
+
+pkgname=femtomail-git
+pkgver=r10.e278dfc
+pkgrel=1
+pkgdesc="Minimal sendmail replacement for forwarding mail to a single Maildir box"
+arch=('i686' 'x86_64')
+url="https://git.lekensteyn.nl/femtomail/"
+license=('GPL')
+provides=('smtp-forwarder')
+conflicts=('smtp-forwarder' 'smtp-server')
+depends=('glibc')
+makedepends=('gcc' 'git')
+install="femtomail.install"
+source=("git+https://git.lekensteyn.nl/femtomail.git")
+md5sums=('SKIP')
+
+pkgver() {
+ cd "$srcdir/femtomail"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+build() {
+ cd "$srcdir/femtomail"
+ make USERNAME=femtomail MAILBOX_PATH=/var/lib/femtomail
+}
+
+package() {
+ cd "$srcdir/femtomail"
+ make install-link-sendmail DESTDIR="$pkgdir" sbindir=/usr/bin
+}
diff --git a/femtomail.install b/femtomail.install
new file mode 100644
index 000000000000..474fb277db1a
--- /dev/null
+++ b/femtomail.install
@@ -0,0 +1,20 @@
+MAILBOX_PATH=/var/lib/femtomail
+
+post_install() {
+ # Create user and group
+ getent group femtomail &> /dev/null || groupadd --system femtomail 1>/dev/null
+ getent passwd femtomail &> /dev/null || useradd --system -d "$MAILBOX_PATH" -g femtomail -s /bin/false femtomail 1>/dev/null
+
+ # Create and set ownership of mailbox directory, if it doesn't exist
+ mkdir -p /var/lib/femtomail/new
+ chmod 770 /var/lib/femtomail /var/lib/femtomail/new
+ chown -R femtomail:femtomail /var/lib/femtomail
+
+ # Bestow setuid/setgid capabilities upon the femtomail binary
+ setcap cap_setuid,cap_setgid=ep /sbin/femtomail
+
+ echo "Email will be delivered to the Maildir located at:"
+ echo " $MAILBOX_PATH"
+ echo "To access the Maildir as an unprivileged user, add yourself to the femtomail group:"
+ echo " sudo usermod -aG femtomail $SUDO_USER"
+}