parent
9882cecb10
commit
d30d0c783d
@ -1,16 +1,5 @@
|
|||||||
{ stdenv, fetchurl, pkgconfig
|
{ stdenv, fetchurl, flex, cracklib }:
|
||||||
|
|
||||||
# Optional Depdencies
|
|
||||||
, cracklib ? null, libaudit ? null, db ? null
|
|
||||||
}:
|
|
||||||
|
|
||||||
with stdenv;
|
|
||||||
let
|
|
||||||
optCracklib = shouldUsePkg cracklib;
|
|
||||||
optLibaudit = shouldUsePkg libaudit;
|
|
||||||
optDb = shouldUsePkg db;
|
|
||||||
in
|
|
||||||
with stdenv.lib;
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "linux-pam-${version}";
|
name = "linux-pam-${version}";
|
||||||
version = "1.2.0";
|
version = "1.2.0";
|
||||||
@ -20,45 +9,37 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "192y2fgf24a5qsg7rl1mzgw5axs5lg8kqamkfff2x50yjv2ym2yd";
|
sha256 = "192y2fgf24a5qsg7rl1mzgw5axs5lg8kqamkfff2x50yjv2ym2yd";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ flex ];
|
||||||
buildInputs = [ optCracklib optLibaudit optDb ];
|
|
||||||
|
|
||||||
configureFlags = [
|
buildInputs = [ cracklib ];
|
||||||
(mkOther "sysconfdir" "/etc")
|
|
||||||
(mkOther "localstatedir" "/var")
|
|
||||||
(mkOther "includedir" "\${out}/include/security")
|
|
||||||
(mkEnable false "static-modules" null)
|
|
||||||
(mkEnable true "pie" null)
|
|
||||||
(mkEnable false "prelude" null)
|
|
||||||
(mkEnable false "debug" null)
|
|
||||||
(mkEnable false "pamlocking" null)
|
|
||||||
(mkEnable true "read-both-confs" null)
|
|
||||||
(mkEnable true "lckpwdf" null)
|
|
||||||
(mkWith true "xauth" "/run/current-system/sw/bin/xauth")
|
|
||||||
(mkEnable (optCracklib != null) "cracklib" null)
|
|
||||||
(mkEnable (optLibaudit != null) "audit" null)
|
|
||||||
(mkEnable (optDb != null) "db" "db")
|
|
||||||
(mkEnable true "nis" null) # TODO: Consider tirpc support here
|
|
||||||
(mkEnable false "selinux" null)
|
|
||||||
(mkEnable false "regenerate-docu" null)
|
|
||||||
];
|
|
||||||
|
|
||||||
installFlags = [
|
crossAttrs = {
|
||||||
"sysconfdir=\${out}/etc"
|
propagatedBuildInputs = [ flex.crossDrv cracklib.crossDrv ];
|
||||||
"SCONFIGDIR=\${out}/etc/security"
|
preConfigure = preConfigure + ''
|
||||||
];
|
ar x ${flex.crossDrv}/lib/libfl.a
|
||||||
|
mv libyywrap.o libyywrap-target.o
|
||||||
|
ar x ${flex}/lib/libfl.a
|
||||||
|
mv libyywrap.o libyywrap-host.o
|
||||||
|
export LDFLAGS="$LDFLAGS $PWD/libyywrap-target.o"
|
||||||
|
sed -e 's/@CC@/gcc/' -i doc/specs/Makefile.in
|
||||||
|
'';
|
||||||
|
postConfigure = ''
|
||||||
|
sed -e "s@ $PWD/libyywrap-target.o@ $PWD/libyywrap-host.o@" -i doc/specs/Makefile
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
# Prepare unix_chkpwd for setuid wrapping
|
|
||||||
mv -v $out/sbin/unix_chkpwd{,.orig}
|
mv -v $out/sbin/unix_chkpwd{,.orig}
|
||||||
ln -sv /var/setuid-wrappers/unix_chkpwd $out/sbin/unix_chkpwd
|
ln -sv /var/setuid-wrappers/unix_chkpwd $out/sbin/unix_chkpwd
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
preConfigure = ''
|
||||||
|
configureFlags="$configureFlags --includedir=$out/include/security"
|
||||||
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://ftp.kernel.org/pub/linux/libs/pam/;
|
homepage = http://ftp.kernel.org/pub/linux/libs/pam/;
|
||||||
description = "Pluggable Authentication Modules, a flexible mechanism for authenticating user";
|
description = "Pluggable Authentication Modules, a flexible mechanism for authenticating user";
|
||||||
license = licenses.bsd3;
|
platforms = stdenv.lib.platforms.linux;
|
||||||
platforms = platforms.linux;
|
|
||||||
maintainers = with maintainers; [ wkennington ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user