1{ stdenv, lib, fetchurl, autoreconfHook, pam, qrencode }:
2
3stdenv.mkDerivation rec {
4 name = "google-authenticator-libpam-${version}";
5 version = "1.03";
6
7 src = fetchurl {
8 url = "https://github.com/google/google-authenticator-libpam/archive/${version}.tar.gz";
9 sha256 = "0wb95z5v1w4sk0p7y9pbn4v95w9hrbf80vw9k2z2sgs0156ljkb7";
10 };
11
12 buildInputs = [ autoreconfHook pam ];
13
14 preConfigure = ''
15 sed -i "s|libqrencode.so.3|${qrencode}/lib/libqrencode.so.3|" src/google-authenticator.c
16 '';
17
18 installPhase = ''
19 mkdir -p $out/bin $out/lib/security
20 cp ./.libs/pam_google_authenticator.so $out/lib/security
21 cp google-authenticator $out/bin
22 '';
23
24 meta = with lib; {
25 homepage = https://github.com/google/google-authenticator-libpam;
26 description = "Two-step verification, with pam module";
27 license = licenses.asl20;
28 maintainers = with maintainers; [ aneeshusa ];
29 platforms = platforms.linux;
30 };
31}