Revert "pam: Factor out dependencies"

This reverts commit 7141d96bde.
This commit is contained in:
William A. Kennington III 2015-06-06 12:02:38 -07:00
parent 9882cecb10
commit d30d0c783d

View File

@ -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 {
name = "linux-pam-${version}";
version = "1.2.0";
@ -20,45 +9,37 @@ stdenv.mkDerivation rec {
sha256 = "192y2fgf24a5qsg7rl1mzgw5axs5lg8kqamkfff2x50yjv2ym2yd";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ optCracklib optLibaudit optDb ];
nativeBuildInputs = [ flex ];
configureFlags = [
(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)
];
buildInputs = [ cracklib ];
installFlags = [
"sysconfdir=\${out}/etc"
"SCONFIGDIR=\${out}/etc/security"
];
crossAttrs = {
propagatedBuildInputs = [ flex.crossDrv cracklib.crossDrv ];
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 = ''
# Prepare unix_chkpwd for setuid wrapping
mv -v $out/sbin/unix_chkpwd{,.orig}
ln -sv /var/setuid-wrappers/unix_chkpwd $out/sbin/unix_chkpwd
'';
preConfigure = ''
configureFlags="$configureFlags --includedir=$out/include/security"
'';
meta = {
homepage = http://ftp.kernel.org/pub/linux/libs/pam/;
description = "Pluggable Authentication Modules, a flexible mechanism for authenticating user";
license = licenses.bsd3;
platforms = platforms.linux;
maintainers = with maintainers; [ wkennington ];
platforms = stdenv.lib.platforms.linux;
};
}