monkeysphere: Correctly wrap the keytrans aliases (subcommands)
This commit is contained in:
parent
8f6e805be4
commit
6d81d8254c
@ -23,22 +23,31 @@ stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup =
|
postFixup =
|
||||||
let wrapMonkeysphere = runtimeDeps: program:
|
let wrapperArgs = runtimeDeps:
|
||||||
"wrapProgram $out/bin/${program} --prefix PERL5LIB : "
|
"--prefix PERL5LIB : "
|
||||||
+ (with perlPackages; stdenv.lib.makePerlPath [
|
+ (with perlPackages; stdenv.lib.makePerlPath [
|
||||||
CryptOpenSSLRSA
|
CryptOpenSSLRSA
|
||||||
CryptOpenSSLBignum
|
CryptOpenSSLBignum
|
||||||
])
|
])
|
||||||
+ stdenv.lib.optionalString
|
+ stdenv.lib.optionalString
|
||||||
(builtins.length runtimeDeps > 0)
|
(builtins.length runtimeDeps > 0)
|
||||||
" --prefix PATH : ${stdenv.lib.makeBinPath runtimeDeps}"
|
" --prefix PATH : ${stdenv.lib.makeBinPath runtimeDeps}";
|
||||||
+ "\n";
|
wrapMonkeysphere = runtimeDeps: program:
|
||||||
|
"wrapProgram $out/bin/${program} ${wrapperArgs runtimeDeps}\n";
|
||||||
wrapPrograms = runtimeDeps: programs: stdenv.lib.concatMapStrings
|
wrapPrograms = runtimeDeps: programs: stdenv.lib.concatMapStrings
|
||||||
(wrapMonkeysphere runtimeDeps)
|
(wrapMonkeysphere runtimeDeps)
|
||||||
programs;
|
programs;
|
||||||
in wrapPrograms [ gnupg ] [ "monkeysphere-authentication" "monkeysphere-host" ]
|
in wrapPrograms [ gnupg ] [ "monkeysphere-authentication" "monkeysphere-host" ]
|
||||||
+ wrapPrograms [ ] [ "../share/monkeysphere/keytrans" "openpgp2ssh" ]
|
+ wrapPrograms [ lockfileProgs ] [ "monkeysphere" ]
|
||||||
+ wrapPrograms [ lockfileProgs ] [ "monkeysphere" ];
|
+ ''
|
||||||
|
# These 4 programs depend on the program name ($0):
|
||||||
|
for program in openpgp2pem openpgp2spki openpgp2ssh pem2openpgp; do
|
||||||
|
rm $out/bin/$program
|
||||||
|
ln -sf keytrans $out/share/monkeysphere/$program
|
||||||
|
makeWrapper $out/share/monkeysphere/$program $out/bin/$program \
|
||||||
|
${wrapperArgs [ ]}
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = http://web.monkeysphere.info/;
|
homepage = http://web.monkeysphere.info/;
|
||||||
|
@ -28,50 +28,5 @@ diff --git a/src/share/keytrans b/src/share/keytrans
|
|||||||
|
|
||||||
# keytrans: this is an RSA key translation utility; it is capable of
|
# keytrans: this is an RSA key translation utility; it is capable of
|
||||||
# transforming RSA keys (both public keys and secret keys) between
|
# transforming RSA keys (both public keys and secret keys) between
|
||||||
@@ -1083,7 +1083,7 @@ sub packetwalk {
|
|
||||||
|
|
||||||
|
|
||||||
for (basename($0)) {
|
|
||||||
- if (/^pem2openpgp$/) {
|
|
||||||
+ if (/pem2openpgp/) {
|
|
||||||
my $rsa;
|
|
||||||
my $stdin;
|
|
||||||
|
|
||||||
@@ -1121,7 +1121,7 @@ for (basename($0)) {
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
- elsif (/^openpgp2ssh$/) {
|
|
||||||
+ elsif (/openpgp2ssh/) {
|
|
||||||
my $fpr = shift;
|
|
||||||
my $instream;
|
|
||||||
open($instream,'-');
|
|
||||||
@@ -1137,7 +1137,7 @@ for (basename($0)) {
|
|
||||||
die "No matching key found.\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- elsif (/^openpgp2pem$/) {
|
|
||||||
+ elsif (/openpgp2pem/) {
|
|
||||||
my $fpr = shift;
|
|
||||||
my $instream;
|
|
||||||
open($instream,'-');
|
|
||||||
@@ -1153,7 +1153,7 @@ for (basename($0)) {
|
|
||||||
die "No matching key found.\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- elsif (/^openpgp2spki$/) {
|
|
||||||
+ elsif (/openpgp2spki/) {
|
|
||||||
my $fpr = shift;
|
|
||||||
my $instream;
|
|
||||||
open($instream,'-');
|
|
||||||
@@ -1165,7 +1165,7 @@ for (basename($0)) {
|
|
||||||
die "No matching key found.\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- elsif (/^keytrans$/) {
|
|
||||||
+ elsif (/keytrans/) {
|
|
||||||
# subcommands when keytrans is invoked directly are UNSUPPORTED,
|
|
||||||
# UNDOCUMENTED, and WILL NOT BE MAINTAINED.
|
|
||||||
my $subcommand = shift;
|
|
||||||
--
|
--
|
||||||
2.16.3
|
2.16.3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user