2007-01-11 15:22:59 +00:00
|
|
|
{stdenv, fetchurl, pam}:
|
|
|
|
|
|
|
|
# This is just coreutils, except that we only build su, with the PAM
|
|
|
|
# patch. We build su separately because we don't want to give all of
|
|
|
|
# coreutils a dependency on PAM.
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2009-02-02 14:42:00 +00:00
|
|
|
name = "su-7.0";
|
|
|
|
|
2007-01-11 15:22:59 +00:00
|
|
|
src = fetchurl {
|
2009-02-02 14:42:00 +00:00
|
|
|
url = "ftp://alpha.gnu.org/gnu/coreutils/coreutils-7.0.tar.gz";
|
|
|
|
sha256 = "00cwf8rqbj89ikv8fhdhv26dpc2ghzw1hn48pk1vg3nnmxj55nr7";
|
2007-01-11 15:22:59 +00:00
|
|
|
};
|
2009-02-02 14:42:00 +00:00
|
|
|
|
2007-01-11 15:22:59 +00:00
|
|
|
patches = [
|
|
|
|
# PAM patch taken from SUSE's coreutils-6.7-5.src.rpm.
|
|
|
|
./su-pam.patch
|
|
|
|
];
|
2009-02-02 14:42:00 +00:00
|
|
|
|
2007-01-11 15:22:59 +00:00
|
|
|
buildInputs = [pam];
|
2009-02-02 14:42:00 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
2007-01-11 15:22:59 +00:00
|
|
|
make -C lib
|
2009-02-02 14:42:00 +00:00
|
|
|
make -C src version.h
|
|
|
|
make -C src su su_OBJECTS="su.o getdef.o" CFLAGS="-DUSE_PAM" LDFLAGS="-lpam -lpam_misc -ldl"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2007-01-11 15:22:59 +00:00
|
|
|
ensureDir $out/bin
|
|
|
|
cp src/su $out/bin
|
2009-02-02 14:42:00 +00:00
|
|
|
'';
|
2007-01-11 15:22:59 +00:00
|
|
|
}
|