2012-03-29 19:02:10 +01:00
|
|
|
{stdenv, fetchurl, makeWrapper, useSetUID, dbus, libxml2, pam, pkgconfig, pmount, python, pythonDBus}:
|
2010-01-03 11:12:05 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
pmountBin = useSetUID pmount "/bin/pmount";
|
|
|
|
pumountBin = useSetUID pmount "/bin/pumount";
|
|
|
|
in
|
|
|
|
|
2012-01-07 19:16:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "pam_usb-0.5.0";
|
2010-01-03 11:12:05 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2012-01-07 19:16:52 +00:00
|
|
|
url = "mirror://sourceforge/pamusb/${name}.tar.gz";
|
|
|
|
sha256 = "1g1w0s9d8mfld8abrn405ll5grv3xgs0b0hsganrz6qafdq9j7q1";
|
2010-01-03 11:12:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
# pam_usb dependencies
|
2012-03-29 19:02:10 +01:00
|
|
|
dbus libxml2 pam pmount pkgconfig
|
2010-01-03 11:12:05 +00:00
|
|
|
# pam_usb's tools dependencies
|
|
|
|
python
|
|
|
|
# cElementTree is included with python 2.5 and later.
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
makeFlagsArray=(DESTDIR=$out)
|
|
|
|
substituteInPlace ./src/volume.c \
|
|
|
|
--replace 'pmount' '${pmountBin}' \
|
|
|
|
--replace 'pumount' '${pumountBin}'
|
|
|
|
'';
|
|
|
|
|
|
|
|
# pmount is append to the PATH because pmounts binaries should have a set uid bit.
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/usr/* $out/. # fix color */
|
|
|
|
rm -rf $out/usr
|
|
|
|
for prog in $out/bin/pamusb-conf $out/bin/pamusb-agent; do
|
|
|
|
substituteInPlace $prog --replace '/usr/bin/env python' '/bin/python'
|
|
|
|
wrapProgram $prog \
|
|
|
|
--prefix PYTHONPATH : "$(toPythonPath ${pythonDBus})"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://pamusb.org/;
|
|
|
|
description = "Authentication using USB Flash Drives";
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2010-01-03 11:12:05 +00:00
|
|
|
};
|
|
|
|
}
|