Merge branch 'master' into staging

This commit is contained in:
Vladimír Čunát
2014-11-24 22:14:25 +01:00
374 changed files with 5842 additions and 2060 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
{ stdenv, fetchurl, zlib, bzip2, libiconvOrNull, libxml2, openssl, ncurses, curl }:
stdenv.mkDerivation rec {
name = "clamav-${version}";
version = "0.98.4";
version = "0.98.5";
src = fetchurl {
url = "mirror://sourceforge/clamav/clamav-${version}.tar.gz";
sha256 = "071yzamalj3rf7kl2jvc35ipnk1imdkq5ylbb8whyxfgmd3nf06k";
sha256 = "0kdaimnbbb0hymg7d15a3iwk17r8555nyzr3d1j96cwhzbakfbww";
};
buildInputs = [ zlib bzip2 libxml2 openssl ncurses curl ]
@@ -0,0 +1,38 @@
{ stdenv, fetchurl, jre, makeWrapper, pcsclite }:
stdenv.mkDerivation rec {
# TODO: find out what the version components actually mean, if anything:
package = "eid-viewer-4.0.7-195";
build = "tcm406-258907";
name = "${package}-${build}";
src = fetchurl {
url = "http://eid.belgium.be/en/binaries/${package}.src.tar_${build}.gz";
sha256 = "e263e6751ef7c185e278a607fdc46c207306d9a56c6ddb2ce6f58fb4464a2893";
};
buildInputs = [ jre makeWrapper pcsclite ];
unpackPhase = "tar -xzf ${src} --strip-components=1";
preConfigure = ''
substituteInPlace eid-viewer.sh.in --replace "exec java" "exec ${jre}/bin/java"
'';
postInstall = ''
wrapProgram $out/bin/eid-viewer --suffix LD_LIBRARY_PATH : ${pcsclite}/lib
'';
meta = with stdenv.lib; {
description = "Belgian electronic identity card (eID) viewer";
homepage = http://eid.belgium.be/en/using_your_eid/installing_the_eid_software/linux/;
license = with licenses; lgpl3;
longDescription = ''
A simple, graphical Java application to view, print and save data from
Belgian electronic identity cards. Independent of the eid-mw package,
which is required to actually use your eID for authentication or signing.
'';
maintainers = with maintainers; [ nckx ];
platforms = with platforms; linux;
};
}
+4 -1
View File
@@ -1,6 +1,6 @@
{ fetchurl, stdenv, pkgconfig, libgcrypt, libassuan, libksba, npth
, readline ? null, libusb ? null, gnutls ? null, adns ? null, openldap ? null
, zlib ? null, bzip2 ? null, pinentry ? null
, zlib ? null, bzip2 ? null, pinentry ? null, autoreconfHook, gettext
}:
with stdenv.lib;
@@ -12,9 +12,12 @@ stdenv.mkDerivation rec {
sha256 = "12q5shx6ldqad3rky154nv8f2cy57sxy9idivz93ggqm1bsw7a0n";
};
patches = [ ./socket-activate.patch ];
buildInputs = [
pkgconfig libgcrypt libassuan libksba npth
readline libusb gnutls adns openldap zlib bzip2
autoreconfHook gettext
];
configureFlags =
@@ -0,0 +1,180 @@
From 8fde13d07c0059040ed531ca3ac365f5780ff240 Mon Sep 17 00:00:00 2001
From: Shea Levy <shea@shealevy.com>
Date: Tue, 18 Nov 2014 14:34:53 -0500
Subject: [PATCH] gpg-agent: Enable socket activation
This allows gpg-agent to be managed by tools such as systemd or launchd
---
agent/gpg-agent.c | 62 ++++++++++++++++++++++++++++++++++++------------------
doc/gpg-agent.texi | 21 +++++++++++++++++-
2 files changed, 61 insertions(+), 22 deletions(-)
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index 5960fe3..2f06982 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -124,7 +124,9 @@ enum cmd_and_opt_values
oPuttySupport,
oDisableScdaemon,
oDisableCheckOwnSocket,
- oWriteEnvFile
+ oWriteEnvFile,
+ oAgentFD,
+ oSSHAgentFD
};
@@ -138,6 +140,8 @@ static ARGPARSE_OPTS opts[] = {
{ 301, NULL, 0, N_("@Options:\n ") },
{ oDaemon, "daemon", 0, N_("run in daemon mode (background)") },
+ { oAgentFD, "agent-fd", 1, "@" },
+ { oSSHAgentFD, "ssh-agent-fd", 1, "@" },
{ oServer, "server", 0, N_("run in server mode (foreground)") },
{ oVerbose, "verbose", 0, N_("verbose") },
{ oQuiet, "quiet", 0, N_("be somewhat more quiet") },
@@ -596,6 +600,31 @@ parse_rereadable_options (ARGPARSE_ARGS *pargs, int reread)
return 1; /* handled */
}
+/* Handle agent socket(s) */
+static void
+handle_agent_socks(int fd, int fd_ssh)
+{
+#ifndef HAVE_W32_SYSTEM
+ if (chdir("/"))
+ {
+ log_error ("chdir to / failed: %s\n", strerror (errno));
+ exit (1);
+ }
+
+ {
+ struct sigaction sa;
+
+ sa.sa_handler = SIG_IGN;
+ sigemptyset (&sa.sa_mask);
+ sa.sa_flags = 0;
+ sigaction (SIGPIPE, &sa, NULL);
+ }
+#endif /*!HAVE_W32_SYSTEM*/
+
+ log_info ("%s %s started\n", strusage(11), strusage(13) );
+ handle_connections (fd, fd_ssh);
+ assuan_sock_close (fd);
+}
/* The main entry point. */
int
@@ -612,6 +641,8 @@ main (int argc, char **argv )
int default_config =1;
int pipe_server = 0;
int is_daemon = 0;
+ int fd_agent = GNUPG_INVALID_FD;
+ int fd_ssh_agent = GNUPG_INVALID_FD;
int nodetach = 0;
int csh_style = 0;
char *logfile = NULL;
@@ -819,6 +850,8 @@ main (int argc, char **argv )
case oSh: csh_style = 0; break;
case oServer: pipe_server = 1; break;
case oDaemon: is_daemon = 1; break;
+ case oAgentFD: fd_agent = pargs.r.ret_int; break;
+ case oSSHAgentFD: fd_ssh_agent = pargs.r.ret_int; break;
case oDisplay: default_display = xstrdup (pargs.r.ret_str); break;
case oTTYname: default_ttyname = xstrdup (pargs.r.ret_str); break;
@@ -904,7 +937,8 @@ main (int argc, char **argv )
bind_textdomain_codeset (PACKAGE_GT, "UTF-8");
#endif
- if (!pipe_server && !is_daemon && !gpgconf_list)
+ if (!pipe_server && !is_daemon && !gpgconf_list &&
+ fd_agent == GNUPG_INVALID_FD)
{
/* We have been called without any options and thus we merely
check whether an agent is already running. We do this right
@@ -1054,6 +1088,10 @@ main (int argc, char **argv )
agent_deinit_default_ctrl (ctrl);
xfree (ctrl);
}
+ else if (fd_agent != GNUPG_INVALID_FD)
+ {
+ handle_agent_socks(fd_agent, fd_ssh_agent);
+ }
else if (!is_daemon)
; /* NOTREACHED */
else
@@ -1238,26 +1276,8 @@ main (int argc, char **argv )
log_set_prefix (NULL, oldflags | JNLIB_LOG_RUN_DETACHED);
opt.running_detached = 1;
}
-
- if (chdir("/"))
- {
- log_error ("chdir to / failed: %s\n", strerror (errno));
- exit (1);
- }
-
- {
- struct sigaction sa;
-
- sa.sa_handler = SIG_IGN;
- sigemptyset (&sa.sa_mask);
- sa.sa_flags = 0;
- sigaction (SIGPIPE, &sa, NULL);
- }
#endif /*!HAVE_W32_SYSTEM*/
-
- log_info ("%s %s started\n", strusage(11), strusage(13) );
- handle_connections (fd, opt.ssh_support ? fd_ssh : GNUPG_INVALID_FD);
- assuan_sock_close (fd);
+ handle_agent_socks(fd, opt.ssh_support ? fd_ssh : GNUPG_INVALID_FD);
}
return 0;
diff --git a/doc/gpg-agent.texi b/doc/gpg-agent.texi
index a4079d7..1556e54 100644
--- a/doc/gpg-agent.texi
+++ b/doc/gpg-agent.texi
@@ -43,7 +43,15 @@
.IR file ]
.RI [ options ]
.B \-\-daemon
-.RI [ command_line ]
+.br
+.B gpg-agent
+.RB [ \-\-homedir
+.IR dir ]
+.RB [ \-\-options
+.IR file ]
+.RI [ options ]
+.B \-\-agent-fd
+.IR fd
@end ifset
@mansect description
@@ -186,6 +194,11 @@ Yet another way is creating
a new process as a child of gpg-agent: @code{gpg-agent --daemon
/bin/sh}. This way you get a new shell with the environment setup
properly; if you exit from this shell, gpg-agent terminates as well.
+
+@item --agent-fd @var{fd}
+@opindex agent-fd
+Start the gpg-agent using @var{fd} as the listening socket. This is useful for
+socket activation a la systemd and launchd.
@end table
@mansect options
@@ -532,6 +545,12 @@ Ignore requests to change the current @code{tty} or X window system's
@code{DISPLAY} variable respectively. This is useful to lock the
pinentry to pop up at the @code{tty} or display you started the agent.
+@item --ssh-agent-fd @var{fd}
+@opindex ssh-agent-fd
+
+When starting the agent with @option{--agent-fd}, use this to pass in a socket
+to be used for the OpenSSH agent protocol.
+
@anchor{option --enable-ssh-support}
@item --enable-ssh-support
@opindex enable-ssh-support
+3 -3
View File
@@ -1,11 +1,11 @@
{ stdenv, fetchurl, libevent, openssl, zlib }:
stdenv.mkDerivation rec {
name = "tor-0.2.4.24";
name = "tor-0.2.5.10";
src = fetchurl {
url = "https://archive.torproject.org/tor-package-archive/${name}.tar.gz";
sha256 = "1l8aczqz8injzcj3mabx4figl8ahkzb0vs9s3nir6kn0b1l5rccr";
sha256 = "0fx8qnwh2f8ykfx0np4hyznjfi4xfy96z59pk96y3zyjvjjh5pdk";
};
buildInputs = [ libevent openssl zlib ];
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
license="mBSD";
maintainers = with stdenv.lib.maintainers; [ phreedom ludo ];
maintainers = with stdenv.lib.maintainers; [ phreedom ludo doublec ];
platforms = stdenv.lib.platforms.gnu; # arbitrary choice
};
}
+9 -9
View File
@@ -20,18 +20,18 @@ let
in stdenv.mkDerivation rec {
name = "tor-browser-${version}";
version = "3.6.2";
version = "4.0.1";
src = fetchurl {
url = "https://archive.torproject.org/tor-package-archive/torbrowser/${version}/tor-browser-linux${bits}-${version}_en-US.tar.xz";
sha256 = if bits == "64" then
"1rfv59k9mia6hr1z1k4im20dy59ir7i054cgf78sfj1zsh08q7hf" else
"1klkk1k5r51pcx44r1z3sw08fqcl2f2v5iblf4yh83js482c37r8";
"1cz36g7jfcz8xs7sa2fl44g1bxlrl0psbsx5hig6j5ydsl87vyak" else
"135ya109skzd4x8zhmsiwjg6d533yijbdrscm36lsplgcf7dx8l3";
};
patchPhase = ''
patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" Browser/firefox
patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" Tor/tor
patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" Browser/TorBrowser/Tor/tor
'';
doCheck = true;
@@ -41,7 +41,7 @@ in stdenv.mkDerivation rec {
echo "Checking firefox..."
LD_LIBRARY_PATH=${ldLibraryPath} Browser/firefox --help 1> /dev/null
echo "Checking tor..."
LD_LIBRARY_PATH=${torEnv}/lib:Tor Tor/tor --help 1> /dev/null
LD_LIBRARY_PATH=${torEnv}/lib:Browser/TorBrowser/Tor Browser/TorBrowser/Tor/tor --help 1> /dev/null
'';
installPhase = ''
@@ -50,13 +50,13 @@ in stdenv.mkDerivation rec {
cp -R * $out/share/tor-browser
cat > "$out/bin/tor-browser" << EOF
export HOME="\$HOME/.torbrowser"
export HOME="\$HOME/.torbrowser4"
if [ ! -d \$HOME ]; then
mkdir -p \$HOME && cp -R $out/share/tor-browser/Data \$HOME/ && chmod -R +w \$HOME
mkdir -p \$HOME && cp -R $out/share/tor-browser/Browser/TorBrowser/Data \$HOME/ && chmod -R +w \$HOME
echo "pref(\"extensions.torlauncher.tordatadir_path\", \"\$HOME/Data/Tor/\");" >> \
~/Data/Browser/profile.default/preferences/extension-overrides.js
fi
export LD_LIBRARY_PATH=${ldLibraryPath}:$out/share/tor-browser/Tor
export LD_LIBRARY_PATH=${ldLibraryPath}:$out/share/tor-browser/Browser/TorBrowser/Tor
$out/share/tor-browser/Browser/firefox -no-remote -profile ~/Data/Browser/profile.default "$@"
EOF
chmod +x $out/bin/tor-browser
@@ -68,6 +68,6 @@ in stdenv.mkDerivation rec {
description = "Tor Browser Bundle for GNU/Linux, everything you need to safely browse the Internet";
homepage = https://www.torproject.org/;
platforms = ["i686-linux" "x86_64-linux"];
maintainers = [ maintainers.offline maintainers.matejc ];
maintainers = [ maintainers.offline maintainers.matejc maintainers.doublec ];
};
}