[132348] trunk/dports/mail/signing-party

cal at macports.org cal at macports.org
Thu Jan 29 13:47:22 PST 2015


Revision: 132348
          https://trac.macports.org/changeset/132348
Author:   cal at macports.org
Date:     2015-01-29 13:47:21 -0800 (Thu, 29 Jan 2015)
Log Message:
-----------
signing-party: use macports gpg, fixes #46601 and other user misconfigurations, install gpgparticipants-prefill, pgpring, keyart, more documentation and more examples

Modified Paths:
--------------
    trunk/dports/mail/signing-party/Portfile

Added Paths:
-----------
    trunk/dports/mail/signing-party/files/patch-use-macports-gpg.diff

Modified: trunk/dports/mail/signing-party/Portfile
===================================================================
--- trunk/dports/mail/signing-party/Portfile	2015-01-29 16:08:37 UTC (rev 132347)
+++ trunk/dports/mail/signing-party/Portfile	2015-01-29 21:47:21 UTC (rev 132348)
@@ -5,6 +5,7 @@
 
 name                signing-party
 version             1.1.12
+revision            1
 checksums           rmd160  5bd05b4adfe00d683af9029dc4383be9d93c6c55 \
                     sha256  fa818002c6f3baa1348b10b3b9c98d6f1af5ef359ba4d9f06b9591d7d7876e12
 
@@ -25,7 +26,8 @@
 extract.suffix      .orig.tar.gz
 
 patchfiles          gpgwrap-makefile-usingtherightcompiler.patch \
-                    keyanalyze-makefile-usingtherightcompiler.patch
+                    keyanalyze-makefile-usingtherightcompiler.patch \
+                    patch-use-macports-gpg.diff
 
 use_configure       no
 
@@ -42,8 +44,9 @@
                     port:p5.16-mime-tools \
                     port:p5.16-net-idn-encode \
                     port:qprint
-depends_run         bin:gpg:gnupg \
-                    port:dialog
+depends_run         port:gnupg \
+                    port:dialog \
+                    port:python27
 
 variant universal   {}
 
@@ -51,19 +54,42 @@
                     CFLAGS="${configure.cflags} [get_canonical_archflags]"
 
 pre-build {
-    reinplace "s|/usr/bin/perl|${prefix}/bin/perl5.16|" \
+    reinplace "s|/usr/bin/perl|${prefix}/bin/perl5.16|g" \
         ${worksrcpath}/caff/caff \
         ${worksrcpath}/caff/pgp-clean \
         ${worksrcpath}/caff/pgp-fixkey \
+        ${worksrcpath}/gpg-key2latex/gpg-key2latex \
         ${worksrcpath}/gpg-key2ps/gpg-key2ps \
-        ${worksrcpath}/gpgdir/bump_version.pl \
         ${worksrcpath}/gpgdir/gpgdir \
         ${worksrcpath}/gpgdir/install.pl \
         ${worksrcpath}/gpglist/gpglist \
         ${worksrcpath}/gpgsigs/gpgsigs \
+        ${worksrcpath}/keyanalyze/scripts/htmlify_report \
+        ${worksrcpath}/keyanalyze/scripts/top50.pl \
+        ${worksrcpath}/keyanalyze/willy/cosign \
+        ${worksrcpath}/keyanalyze/willy/msd2html \
+        ${worksrcpath}/keyanalyze/willy/non-recip \
+        ${worksrcpath}/keyanalyze/willy/party-table.pl \
+        ${worksrcpath}/keyanalyze/willy/unsign \
         ${worksrcpath}/keylookup/keylookup \
         ${worksrcpath}/sig2dot/sig2dot \
         ${worksrcpath}/springgraph/springgraph
+    reinplace "s|/usr/bin/python|${prefix}/bin/python2.7|g" \
+        ${worksrcpath}/keyart/keyart
+    # force using MacPorts GPG to avoid issues such as #46601
+    reinplace "s|@GPG_PATH@|${prefix}/bin/gpg|g" \
+        ${worksrcpath}/caff/caff \
+        ${worksrcpath}/caff/pgp-clean \
+        ${worksrcpath}/caff/pgp-fixkey \
+        ${worksrcpath}/gpg-key2latex/gpg-key2latex \
+        ${worksrcpath}/gpg-key2ps/gpg-key2ps \
+        ${worksrcpath}/gpg-mailkeys/gpg-mailkeys \
+        ${worksrcpath}/gpgdir/gpgdir \
+        ${worksrcpath}/gpglist/gpglist \
+        ${worksrcpath}/gpgparticipants/gpgparticipants \
+        ${worksrcpath}/gpgsigs/gpgsigs \
+        ${worksrcpath}/keyart/keyart \
+        ${worksrcpath}/keylookup/keylookup
 }
 
 platform macosx {
@@ -82,10 +108,13 @@
             ${worksrcpath}/gpg-mailkeys/gpg-mailkeys \
             ${worksrcpath}/gpglist/gpglist \
             ${worksrcpath}/gpgparticipants/gpgparticipants \
+            ${worksrcpath}/gpgparticipants/gpgparticipants-prefill \
             ${worksrcpath}/gpgsigs/gpgsigs \
             ${worksrcpath}/gpgwrap/bin/gpgwrap \
             ${worksrcpath}/keyanalyze/keyanalyze \
+            ${worksrcpath}/keyanalyze/pgpring/pgpring \
             ${worksrcpath}/keyanalyze/process_keys \
+            ${worksrcpath}/keyart/keyart \
             ${worksrcpath}/keylookup/keylookup \
             ${worksrcpath}/sig2dot/sig2dot \
             ${worksrcpath}/springgraph/springgraph \
@@ -98,21 +127,38 @@
             ${worksrcpath}/gpg-key2ps/gpg-key2ps.1 \
             ${worksrcpath}/gpg-mailkeys/gpg-mailkeys.1 \
             ${worksrcpath}/gpglist/gpglist.1 \
+            ${worksrcpath}/gpgparticipants/gpgparticipants-prefill.1 \
             ${worksrcpath}/gpgparticipants/gpgparticipants.1 \
+            ${worksrcpath}/gpgsigs/gpgsigs.1 \
             ${worksrcpath}/gpgwrap/doc/gpgwrap.1 \
+            ${worksrcpath}/keyanalyze/keyanalyze.1 \
+            ${worksrcpath}/keyanalyze/pgpring/pgpring.1 \
+            ${worksrcpath}/keyanalyze/process_keys.1 \
+            ${worksrcpath}/keyart/doc/keyart.1 \
+            ${worksrcpath}/keylookup/keylookup.1 \
             ${worksrcpath}/sig2dot/sig2dot.1 \
             ${worksrcpath}/springgraph/springgraph.1 \
-            ${worksrcpath}/gpgsigs/gpgsigs.1 \
-            ${worksrcpath}/keyanalyze/keyanalyze.1 \
-            ${worksrcpath}/keylookup/keylookup.1 \
             ${destroot}${prefix}/share/man/man1
-        # install example configurations in share/doc
-        xinstall -d \
-            ${destroot}${prefix}/share/doc/signing-party
+        # install example configurations and scripts in share/doc
+        xinstall -d -m 0755 \
+            ${destroot}${prefix}/share/doc/${name} \
+            ${destroot}${prefix}/share/doc/${name}/examples \
+            ${destroot}${prefix}/share/doc/${name}/examples/keyanalyze \
+            ${destroot}${prefix}/share/doc/${name}/examples/keyart
         xinstall -m 0644 \
             ${worksrcpath}/caff/caffrc.sample \
             ${worksrcpath}/gpg-mailkeys/example.gpg-mailkeysrc \
-            ${destroot}${prefix}/share/doc/signing-party
+            ${destroot}${prefix}/share/doc/${name}
+        copy \
+            ${worksrcpath}/keyanalyze/scripts \
+            ${worksrcpath}/keyanalyze/willy \
+            ${worksrcpath}/keyanalyze/analyze.sh \
+            ${destroot}${prefix}/share/doc/${name}/examples/keyanalyze
+        copy \
+            ${worksrcpath}/keyart/doc/druken-bishop.txt \
+            ${worksrcpath}/keyart/doc/examples \
+            ${worksrcpath}/keyart/doc/party-worksheet \
+            ${destroot}${prefix}/share/doc/${name}/examples/keyart
 }
 
 notes               "Some example configuration files have been installed to ${prefix}/share/doc/signing-party."

Added: trunk/dports/mail/signing-party/files/patch-use-macports-gpg.diff
===================================================================
--- trunk/dports/mail/signing-party/files/patch-use-macports-gpg.diff	                        (rev 0)
+++ trunk/dports/mail/signing-party/files/patch-use-macports-gpg.diff	2015-01-29 21:47:21 UTC (rev 132348)
@@ -0,0 +1,260 @@
+--- ./caff/caff.orig	2015-01-29 21:39:55.000000000 +0100
++++ ./caff/caff	2015-01-29 21:44:31.000000000 +0100
+@@ -169,7 +169,7 @@
+ 
+ =item B<gpg> [string]
+ 
+-Path to the GnuPG binary.  Default: B<gpg>.
++Path to the GnuPG binary.  Default: B<@GPG_PATH@>.
+ 
+ =item B<gpg-sign> [string]
+ 
+@@ -456,7 +456,7 @@
+ 		$gecos =~ s/,.*//;
+ 
+ 		my $gpg = GnuPG::Interface->new();
+-		$gpg->call( 'gpg' );
++		$gpg->call( '@GPG_PATH@' );
+ 		$gpg->options->hash_init(
+ 			'meta_interactive' => 0,
+ 			'always_trust' => 1,
+@@ -566,7 +566,7 @@
+ 	};
+ 	@{$CONFIG{'keyid'}} = map { s/^0x//; uc (substr y/ //dr, -16) } @{$CONFIG{'keyid'}};
+ 	$CONFIG{'export-sig-age'} //= 24*60*60;
+-	$CONFIG{'gpg'} //= 'gpg';
++	$CONFIG{'gpg'} //= '@GPG_PATH@';
+ 	$CONFIG{'gpg-sign'} //= $CONFIG{'gpg'};
+ 	$CONFIG{'gpg-delsig'} //= $CONFIG{'gpg'};
+ 	check_executable($_, $CONFIG{$_}) for qw/gpg gpg-sign gpg-delsig/;
+--- ./caff/pgp-clean.orig	2015-01-29 21:40:04.000000000 +0100
++++ ./caff/pgp-clean	2015-01-29 21:45:59.000000000 +0100
+@@ -237,6 +237,7 @@
+ 	my ($gnupghome, $keyid) = @_;
+ 
+ 	my $gpg = GnuPG::Interface->new();
++	$gpg->call( '@GPG_PATH@' );
+ 	my %confighash = ( armor => 1 );
+ 	$confighash{'homedir'}=$gnupghome if (defined $gnupghome);
+ 	$gpg->options->hash_init( %confighash );
+@@ -317,6 +318,7 @@
+ 	# get key listing
+ 	#################
+ 	my $gpg = GnuPG::Interface->new();
++	$gpg->call( '@GPG_PATH@' );
+ 	$gpg->options->meta_interactive( 0 );
+ 	my ($inputfd, $stdoutfd, $stderrfd, $statusfd, $handles) = make_gpg_fds();
+ 	$gpg->options->hash_init( 'extra_args' => [ '--with-colons', '--fixed-list-mode' ] );
+@@ -354,6 +356,7 @@
+ 	###############################
+ 	my $tempdir = tempdir( "caff-$keyid-XXXXX", DIR => '/tmp/', CLEANUP => 1);
+ 	$gpg = GnuPG::Interface->new();
++	$gpg->call( '@GPG_PATH@' );
+ 	$gpg->options->hash_init( 'homedir' => $tempdir );
+ 	$gpg->options->meta_interactive( 0 );
+ 	($inputfd, $stdoutfd, $stderrfd, $statusfd, $handles) = make_gpg_fds();
+@@ -369,6 +372,7 @@
+ 	# prune it
+ 	##########
+ 	$gpg = GnuPG::Interface->new();
++	$gpg->call( '@GPG_PATH@' );
+ 	$gpg->options->hash_init(
+ 		'homedir' => $tempdir,
+ 		'extra_args' => [ '--with-colons', '--fixed-list-mode', '--command-fd=0', '--no-tty' ] );
+--- ./caff/pgp-fixkey.orig	2015-01-29 21:40:12.000000000 +0100
++++ ./caff/pgp-fixkey	2015-01-29 21:46:36.000000000 +0100
+@@ -245,6 +245,7 @@
+ # find a list of all interesting keys.
+ if (scalar @KEYIDS == 0) {
+ 	my $gpg = GnuPG::Interface->new();
++	$gpg->call( '@GPG_PATH@' );
+ 	$gpg->options->meta_interactive( 0 );
+ 	my ($inputfd, $stdoutfd, $stderrfd, $statusfd, $handles) = make_gpg_fds();
+ 	$gpg->options->hash_init( 'extra_args' => [ '--with-colons', '--fast-list-mode', '--fixed-list-mode' ] );
+@@ -279,6 +280,7 @@
+ 	# get key listing
+ 	#################
+ 	my $gpg = GnuPG::Interface->new();
++	$gpg->call( '@GPG_PATH@' );
+ 	$gpg->options->meta_interactive( 0 );
+ 	my ($inputfd, $stdoutfd, $stderrfd, $statusfd, $handles) = make_gpg_fds();
+ 	$gpg->options->hash_init( 'extra_args' => [ '--with-colons', '--fixed-list-mode' ] );
+@@ -311,6 +313,7 @@
+ 	# prune it
+ 	##########
+ 	$gpg = GnuPG::Interface->new();
++	$gpg->call( '@GPG_PATH@' );
+ 	$gpg->options->hash_init(
+ 		'extra_args' => [ '--with-colons', '--fixed-list-mode', '--command-fd=0', '--no-tty' ] );
+ 	($inputfd, $stdoutfd, $stderrfd, $statusfd, $handles) = make_gpg_fds();
+--- ./gpg-key2latex/gpg-key2latex.orig	2015-01-29 21:47:12.000000000 +0100
++++ ./gpg-key2latex/gpg-key2latex	2015-01-29 21:47:52.000000000 +0100
+@@ -51,6 +51,7 @@
+ # Get the list of all matching keys.
+ {
+     my $gpg = GnuPG::Interface::->new();
++	$gpg->call( '@GPG_PATH@' );
+     $gpg->options->hash_init( 'extra_args' => [ qw/--fingerprint
+                                                    --fixed-list-mode
+                                                    --no-auto-check-trustdb --with-colons/ ]
+@@ -69,6 +70,7 @@
+ foreach my $keyid (@KEYIDS) {
+     my $photos = $options{'show-photo'} ? File::Temp::->new(TMPDIR => 1) : '/dev/null';
+     my $gpg = GnuPG::Interface::->new();
++	$gpg->call( '@GPG_PATH@' );
+     # we need --attribute-{fd,file} and --status-{fd,file} to get the
+     # correct attribute size
+     $gpg->options->hash_init( 'extra_args' => [ '--attribute-file', $photos,
+--- ./gpg-key2ps/gpg-key2ps.orig	2015-01-29 21:48:04.000000000 +0100
++++ ./gpg-key2ps/gpg-key2ps	2015-01-29 21:48:29.000000000 +0100
+@@ -102,7 +102,7 @@
+ 
+ # open a gpg process we'll be reading from below
+ # --list-key due to #382794
+-open GPG, '-|', qw/gpg --list-key --with-fingerprint --with-colons/, @ARGV;
++open GPG, '-|', qw/@GPG_PATH@ --list-key --with-fingerprint --with-colons/, @ARGV;
+ 
+ sub start_postscript {
+ # start the PostScript output
+--- ./gpg-mailkeys/gpg-mailkeys.orig	2015-01-29 21:48:50.000000000 +0100
++++ ./gpg-mailkeys/gpg-mailkeys	2015-01-29 21:49:16.000000000 +0100
+@@ -73,7 +73,7 @@
+ while [ -n "$1" ]; do
+ 	printf "[$1] "
+ 	TEMPFILE=`mktemp -t gpg2mail.XXXXXX`
+-	ADDR=`gpg --with-colons --fixed-list-mode --list-key $1 | sed -e 's/^uid:[^rei:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:<]*<[^:>]*>\):.*/@@uid@@ \1/' -e '/^@@uid@@ /!d' -e 's/([^)]*)//g' -e 's/  */ /g' -e 's/^@@uid@@ //' | head -1`
++	ADDR=`@GPG_PATH@ --with-colons --fixed-list-mode --list-key $1 | sed -e 's/^uid:[^rei:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:<]*<[^:>]*>\):.*/@@uid@@ \1/' -e '/^@@uid@@ /!d' -e 's/([^)]*)//g' -e 's/  */ /g' -e 's/^@@uid@@ //' | head -1`
+ 	if [ -z "$ADDR" ]; then
+ 		printf "(no usable user ids)\n"
+ 		FAILKEYS="$FAILKEYS:$1"
+@@ -117,7 +117,7 @@
+ Content-Type: application/pgp-keys
+ Content-Disposition: attachment; filename="$1.asc"
+ 
+-`gpg --armor --export $1`
++`@GPG_PATH@ --armor --export $1`
+ 
+ --$BOUNDARY--
+ EOM
+--- ./gpgdir/gpgdir.orig	2015-01-29 21:49:49.000000000 +0100
++++ ./gpgdir/gpgdir	2015-01-29 21:52:37.000000000 +0100
+@@ -411,6 +411,7 @@
+     my ($in_file, $out_file, $del_flag) = @_;
+ 
+     my $gpg = GnuPG::Interface->new();
++	$gpg->call('@GPG_PATH@');
+     $gpg->options->hash_init(%options);
+ 
+     die "[*] Could not create new gpg object with ",
+@@ -513,6 +514,7 @@
+     my $handles   = '';
+ 
+     my $gpg = GnuPG::Interface->new();
++	$gpg->call('@GPG_PATH@');
+     $gpg->options->hash_init(%options);
+ 
+     die "[*] Could not create new gpg object with ",
+--- ./gpglist/gpglist.orig	2015-01-29 21:52:48.000000000 +0100
++++ ./gpglist/gpglist	2015-01-29 21:53:16.000000000 +0100
+@@ -86,7 +86,7 @@
+ 	die "Usage: $PROGRAM_NAME <keyid>\n";
+ }
+ 
+-open SIGS, '-|', qw/gpg --no-auto-check-trustdb --list-options show-sig-subpackets --fixed-list-mode --with-colons --list-sigs/, $key
++open SIGS, '-|', qw/@GPG_PATH@ --no-auto-check-trustdb --list-options show-sig-subpackets --fixed-list-mode --with-colons --list-sigs/, $key
+ 	or die "can't get gpg listing";
+ 
+ my ($uid, $id) = ('', '');
+--- ./gpgparticipants/gpgparticipants.orig	2015-01-29 21:56:07.000000000 +0100
++++ ./gpgparticipants/gpgparticipants	2015-01-29 21:56:47.000000000 +0100
+@@ -52,7 +52,7 @@
+ algos=$(echo "$algos" | tr ',' ' ')
+ for algo in $algos; do
+ 	# Ensure this is a valid algo
+-	gpg --print-md "$algo" /dev/null >/dev/null || exit $?
++	@GPG_PATH@ --print-md "$algo" /dev/null >/dev/null || exit $?
+ done
+ 
+ input="$1"
+@@ -83,7 +83,7 @@
+ 
+ EOF
+ for algo in $algos; do
+-	printf "      gpg --print-md %s %s\n" "$algo" "$output"
++	printf "      @GPG_PATH@ --print-md %s %s\n" "$algo" "$output"
+ done
+ cat <<EOF
+ 
+@@ -149,7 +149,7 @@
+ while read i; do
+     k=$(($k+1));
+     printf "\n%03d  [ ] Fingerprint OK        [ ] ID OK\n" $k;
+-	LANGUAGE=en gpg $options --display-charset utf-8 --fingerprint --list-keys -- $i \
++	LANGUAGE=en @GPG_PATH@ $options --display-charset utf-8 --fingerprint --list-keys -- $i \
+ 		| grep -ve "^sub" -e '^uid *\[jpeg image of size ';
+ 	echo "_______________________________________________________________________________"
+ done
+--- ./gpgsigs/gpgsigs.orig	2015-01-29 21:57:34.000000000 +0100
++++ ./gpgsigs/gpgsigs	2015-01-29 21:58:19.000000000 +0100
+@@ -119,7 +119,7 @@
+ # get all known signatures
+ if ($recv_keys) {
+ 	print STDERR "Requesting keys from keyserver\n";
+-	system qw/gpg --recv-keys/, @keys;
++	system qw/@GPG_PATH@ --recv-keys/, @keys;
+ }
+ 
+ my $now = time;
+@@ -127,7 +127,7 @@
+ 
+ my $photos = $latex ? File::Temp::->new(TMPDIR => 1) : '/dev/null';
+ my $gpg = GnuPG::Interface::->new();
+-$gpg->call( 'gpg' );
++$gpg->call( '@GPG_PATH@' );
+ # we need --attribute-{fd,file} and --status-{fd,file} to get the
+ # correct attribute size
+ $gpg->options->hash_init( 'extra_args' => [ '--attribute-file', $photos,
+@@ -330,7 +330,7 @@
+ 
+ sub getChecksum ($$) {
+ 	my ($algo, $infile) = @_;
+-	open MD, '-|', qw/gpg --with-colons --print-md/, $algo, $infile or warn "Can't get gpg $algo digest\n";
++	open MD, '-|', qw/@GPG_PATH@ --with-colons --print-md/, $algo, $infile or warn "Can't get gpg $algo digest\n";
+ 	my $digest = <MD>;
+ 	close MD;
+ 	return $1 if $digest and $digest =~ /:([0-9A-F]+):[^:]*$/;
+--- ./keyart/keyart.orig	2015-01-29 22:12:25.000000000 +0100
++++ ./keyart/keyart	2015-01-29 22:14:18.000000000 +0100
+@@ -28,10 +28,8 @@
+ def test_env():
+     """Test if and where GPG is installed."""
+     try:
+-        if os.access('/usr/bin/gpg', os.X_OK):
+-            gnupg = '/usr/bin/gpg'
+-        else:
+-            gnupg = '/usr/bin/gpg2'
++        if os.access('@GPG_PATH@', os.X_OK):
++            gnupg = '@GPG_PATH@'
+         return gnupg
+     except OSError:
+         print("Please install GnuPG before using this script.")
+--- ./keylookup/keylookup.orig	2015-01-29 22:20:24.000000000 +0100
++++ ./keylookup/keylookup	2015-01-29 22:20:48.000000000 +0100
+@@ -80,7 +80,7 @@
+ 		open (STDIN, "/dev/null") || die ("Cannot open /dev/null as stdin: $!\n");
+ 
+ 		# child
+-		my @ops = ('gpg');
++		my @ops = ('@GPG_PATH@');
+ 		if ($options->{'keyserver'}) {
+ 			push @ops, '--keyserver='.$options->{'keyserver'};
+ 		};
+@@ -289,7 +289,7 @@
+ 	my $keyids = shift;
+ 	my $options = shift;
+ 
+-	my @args = ('gpg');
++	my @args = ('@GPG_PATH@');
+ 	if ($options->{'keyserver'}) {
+ 		push @args, '--keyserver='.$options->{'keyserver'};
+ 	};
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150129/4053965a/attachment.html>


More information about the macports-changes mailing list