2016-12-29 09:13:27 +00:00
|
|
|
{ stdenv, lib, fetchurl, autoreconfHook, pam, qrencode }:
|
2013-03-30 19:45:38 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-12-29 09:13:27 +00:00
|
|
|
name = "google-authenticator-libpam-${version}";
|
2018-03-20 09:58:34 +00:00
|
|
|
version = "1.05";
|
2013-03-30 19:45:38 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-12-29 09:13:27 +00:00
|
|
|
url = "https://github.com/google/google-authenticator-libpam/archive/${version}.tar.gz";
|
2018-03-20 09:58:34 +00:00
|
|
|
sha256 = "026vljmddi0zqcb3c0vdpabmi4r17kahc00mh6fs3qbyjbb14946";
|
2013-03-30 19:45:38 +00:00
|
|
|
};
|
|
|
|
|
2017-09-05 22:26:13 +01:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
buildInputs = [ pam ];
|
2013-03-30 19:45:38 +00:00
|
|
|
|
2014-02-20 11:30:49 +00:00
|
|
|
preConfigure = ''
|
2016-12-29 09:13:27 +00:00
|
|
|
sed -i "s|libqrencode.so.3|${qrencode}/lib/libqrencode.so.3|" src/google-authenticator.c
|
2014-02-20 11:30:49 +00:00
|
|
|
'';
|
|
|
|
|
2013-03-30 19:45:38 +00:00
|
|
|
installPhase = ''
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p $out/bin $out/lib/security
|
2016-12-29 09:13:27 +00:00
|
|
|
cp ./.libs/pam_google_authenticator.so $out/lib/security
|
2013-03-30 19:45:38 +00:00
|
|
|
cp google-authenticator $out/bin
|
|
|
|
'';
|
|
|
|
|
2016-10-16 17:42:51 +01:00
|
|
|
meta = with lib; {
|
2016-12-29 09:13:27 +00:00
|
|
|
homepage = https://github.com/google/google-authenticator-libpam;
|
2013-03-30 19:45:38 +00:00
|
|
|
description = "Two-step verification, with pam module";
|
2016-10-16 17:42:51 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ aneeshusa ];
|
|
|
|
platforms = platforms.linux;
|
2013-03-30 19:45:38 +00:00
|
|
|
};
|
|
|
|
}
|