Skip to content

Instantly share code, notes, and snippets.

@abraithwaite
Created August 14, 2014 07:24
Show Gist options
  • Save abraithwaite/86d0e4c510f7431335b3 to your computer and use it in GitHub Desktop.
Save abraithwaite/86d0e4c510f7431335b3 to your computer and use it in GitHub Desktop.
mutt pkgbuild
post_install() {
cat <<EOF
==> For GPG support, add the following to your muttrc:
==> source /etc/Muttrc.gpg.dist
EOF
}
# HG changeset patch
# User Kevin McCarthy <[email protected]>
# Date 1383096352 25200
# Tue Oct 29 18:25:52 2013 -0700
# Node ID e9a88e52c98a404bd2cb4fe48d341e1e50b054c0
# Parent 1e935cab6f178deefd5f2b9ce5e10638aa64a0f4
Add gpg signature name. (closes #3478)
Some mail clients display "noname" for the gpg signature
attachment. This patch sets the mime name to "signature.asc".
The patch is based on
http://dev.mutt.org/trac/attachment/ticket/3478/gpg_signature_name.patch
with the changes:
- removes the configuration options
- removes mime description
diff --git a/crypt-gpgme.c b/crypt-gpgme.c
--- a/crypt-gpgme.c
+++ b/crypt-gpgme.c
@@ -913,16 +913,17 @@
t->encoding = ENCBASE64;
t->use_disp = 1;
t->disposition = DISPATTACH;
t->d_filename = safe_strdup ("smime.p7s");
}
else
{
t->subtype = safe_strdup ("pgp-signature");
+ mutt_set_parameter ("name", "signature.asc", &t->parameter);
t->use_disp = 0;
t->disposition = DISPNONE;
t->encoding = ENC7BIT;
}
t->filename = sigfile;
t->unlink = 1; /* ok to remove this file after sending. */
return a;
diff --git a/pgp.c b/pgp.c
--- a/pgp.c
+++ b/pgp.c
@@ -1122,16 +1122,17 @@
t = t->parts->next;
t->type = TYPEAPPLICATION;
t->subtype = safe_strdup ("pgp-signature");
t->filename = safe_strdup (sigfile);
t->use_disp = 0;
t->disposition = DISPNONE;
t->encoding = ENC7BIT;
t->unlink = 1; /* ok to remove this file after sending. */
+ mutt_set_parameter ("name", "signature.asc", &t->parameter);
return (a);
}
static short is_numerical_keyid (const char *s)
{
/* or should we require the "0x"? */
if (strncmp (s, "0x", 2) == 0)
# $Id$
# Contributor: tobias [tobias [at] archlinux.org]
# Maintainer: Gaetan Bisson <[email protected]>
pkgname=mutt
pkgver=1.5.23
pkgrel=1
pkgdesc='Small but very powerful text-based mail client'
url='http://www.mutt.org/'
license=('GPL')
backup=('etc/Muttrc')
arch=('i686' 'x86_64')
optdepends=('smtp-forwarder: to send mail')
depends=('gpgme' 'ncurses' 'openssl' 'libsasl' 'gdbm' 'libidn' 'mime-types' 'krb5')
source=("https://bitbucket.org/mutt/mutt/downloads/${pkgname}-${pkgver}.tar.gz"
"mutt.patch")
sha1sums=('8ac821d8b1e25504a31bf5fda9c08d93a4acc862'
'1ca3a0ab5c4a965d180bd310ba15cfe42c6a4e12')
install=install
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
patch < ../mutt.patch || return 1
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--enable-gpgme \
--enable-pop \
--enable-imap \
--enable-smtp \
--enable-hcache \
--with-curses=/usr \
--with-regex \
--with-gss=/usr \
--with-ssl=/usr \
--with-sasl \
--with-idn \
make
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install
rm "${pkgdir}"/etc/mime.types{,.dist}
rm "${pkgdir}"/usr/bin/{flea,muttbug}
rm "${pkgdir}"/usr/share/man/man1/{flea,muttbug}.1
install -Dm644 contrib/gpg.rc "${pkgdir}"/etc/Muttrc.gpg.dist
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment