summaryrefslogtreecommitdiff
path: root/pcr
diff options
context:
space:
mode:
Diffstat (limited to 'pcr')
-rw-r--r--pcr/mailpile/PKGBUILD55
-rw-r--r--pcr/mailpile/mailpile.install34
-rw-r--r--pcr/mailpile/mailpile.service14
3 files changed, 103 insertions, 0 deletions
diff --git a/pcr/mailpile/PKGBUILD b/pcr/mailpile/PKGBUILD
new file mode 100644
index 000000000..aca19f142
--- /dev/null
+++ b/pcr/mailpile/PKGBUILD
@@ -0,0 +1,55 @@
+# Maintainer (Arch): Maxim Andersson <thesilentboatman@gmail.com>
+# Based on the mailpile-git PKGBUILD
+# Contributor (Arch): cornholio <vigo.the.unholy.carpathian@gmail.com>
+
+pkgname=mailpile
+pkgver=0.5.2
+pkgrel=3
+pkgdesc="A modern, fast web-mail client with user-friendly encryption and privacy features."
+arch=('any')
+url="http://www.mailpile.is"
+license=('AGPL3')
+depends=('gnupg1' 'python2-jinja>=2.6' 'python2-lxml>=2.3.2' 'python2-markupsafe' 'python2-pgpdump' 'python2-pillow' 'python2-pydns' 'spambayes>=1.1a6')
+install=${pkgname}.install
+source=("https://github.com/pagekite/${pkgname}/archive/${pkgver}.tar.gz"
+ "${pkgname}.service")
+sha256sums=('2619dd0711628e25e216bec196d42381e50d45d943a727177f11f8ce89e26004'
+ '07adbd61cda225bf11818d39776240ee1077a3f2ddc9e5ef0f11825dd4ca504d')
+
+prepare() {
+ cd "${srcdir}/Mailpile-${pkgver}"
+
+ # Set absolute paths for static files
+ sed -i "s^('static/^('/usr/share/mailpile/static/^g" mailpile/config.py
+ sed -i '/os.path.dirname( # scripts/d' mp
+ sed -i 's^__file__))^"/usr/share/mailpile/mailpile")^g' mp
+
+ # Use gnupg 1.4
+ sed -i "s/gpg'/gpg1'/g" mailpile/crypto/gpgi.py
+ sed -i "s/gpg /gpg1 /g" mailpile/plugins/crypto_gnupg.py
+}
+
+build() {
+ cd "${srcdir}/Mailpile-${pkgver}"
+
+ # Compile bytecode
+ python2 -m compileall -f mailpile
+}
+
+package() {
+ cd "${srcdir}/Mailpile-${pkgver}"
+
+ install -d "${pkgdir}/usr/share/${pkgname}"
+
+ cp -r static "${pkgdir}/usr/share/${pkgname}/"
+ cp -r mailpile "${pkgdir}/usr/share/${pkgname}/"
+ cp -r locale "${pkgdir}/usr/share/${pkgname}/"
+
+ find "${pkgdir}/usr/share/${pkgname}" -type f -exec chmod 644 '{}' ';'
+ find "${pkgdir}/usr/share/${pkgname}" -type d -exec chmod 755 '{}' ';'
+
+ install -D mp -t "${pkgdir}/usr/bin"
+ install -Dm644 "../${pkgname}.service" -t "${pkgdir}/usr/lib/systemd/system"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/pcr/mailpile/mailpile.install b/pcr/mailpile/mailpile.install
new file mode 100644
index 000000000..fbfbd5a70
--- /dev/null
+++ b/pcr/mailpile/mailpile.install
@@ -0,0 +1,34 @@
+post_install() {
+ post_upgrade $1
+
+ echo ""
+ echo "==> Note: Mailpile is still in development and not"
+ echo "==> suitable for production or end-user use."
+ echo ""
+ echo "==> Get more info at:"
+ echo "==> https://github.com/pagekite/Mailpile/wiki/Getting-started"
+ echo ""
+}
+
+# arg 2: the old package version
+post_upgrade() {
+ if ! getent group mailpile >/dev/null; then
+ groupadd --system mailpile
+ fi
+
+ if ! getent passwd mailpile >/dev/null; then
+ useradd --system -c 'mailpile daemon user' -g mailpile -b /var/lib -m -s /bin/bash mailpile >/dev/null 2>&1
+ elif ! test -d /var/lib/mailpile; then
+ mkhomedir_helper mailpile
+ fi
+
+ if test $2 && test "`vercmp $2 0.4.1-1`" -lt 0; then
+ echo '==> Mailpile home directory has moved to /var/lib/mailpile'
+ fi
+}
+
+post_remove() {
+ systemctl stop mailpile >/dev/null 2>&1
+
+ echo "==> Note: /var/lib/mailpile may still contain data"
+}
diff --git a/pcr/mailpile/mailpile.service b/pcr/mailpile/mailpile.service
new file mode 100644
index 000000000..51a110552
--- /dev/null
+++ b/pcr/mailpile/mailpile.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Mailpile Daemon
+Requires=network.target
+After=network.target
+
+[Service]
+User=mailpile
+PIDFile=/run/mailpile.pid
+PrivateTmp=true
+Environment=MAILPILE_HOME=/var/lib/mailpile
+ExecStart=/usr/bin/mp --www= --wait
+
+[Install]
+WantedBy=multi-user.target