1{ stdenv, fetchurl, pam, qrencode }: 2 3stdenv.mkDerivation rec { 4 name = "google-authenticator-1.0"; 5 6 src = fetchurl { 7 url = "https://google-authenticator.googlecode.com/files/libpam-${name}-source.tar.bz2"; 8 sha1 = "017b7d89989f1624e360abe02d6b27a6298d285d"; 9 }; 10 11 buildInputs = [ pam ]; 12 13 preConfigure = '' 14 sed -i 's|libqrencode.so.3|${qrencode}/lib/libqrencode.so.3|' google-authenticator.c 15 ''; 16 17 installPhase = '' 18 mkdir -p $out/bin $out/lib/security 19 cp pam_google_authenticator.so $out/lib/security 20 cp google-authenticator $out/bin 21 ''; 22 23 meta = { 24 homepage = https://code.google.com/p/google-authenticator/; 25 description = "Two-step verification, with pam module"; 26 license = stdenv.lib.licenses.asl20; 27 platforms = stdenv.lib.platforms.linux; 28 }; 29}