btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / ns / nss_ldap / package.nix
blob784ecf2b39cceef776682d218990f80ee71e25e1
1 {lib, stdenv, fetchurl, openldap, perl}:
3 stdenv.mkDerivation rec {
4   pname = "nss_ldap";
5   version = "265";
7   src = fetchurl {
8     url = "http://www.padl.com/download/nss_ldap-${version}.tar.gz";
9     sha256 = "1a16q9p97d2blrj0h6vl1xr7dg7i4s8x8namipr79mshby84vdbp";
10   };
12   preConfigure = ''
13     patchShebangs ./vers_string
14     sed -i s,vers_string,./vers_string, Makefile*
15     substituteInPlace vers_string --replace "cvslib.pl" "./cvslib.pl"
16   '';
18   patches = [ ./crashes.patch ];
20   postPatch = ''
21     patch -p0 < ${./nss_ldap-265-glibc-2.16.patch}
22   '';
24   preInstall = ''
25     installFlagsArray=(INST_UID=$(id -u) INST_GID=$(id -g) LIBC_VERS=2.5 NSS_VERS=2 NSS_LDAP_PATH_CONF=$out/etc/ldap.conf)
26     substituteInPlace Makefile \
27       --replace '/usr$(libdir)' $TMPDIR \
28       --replace 'install-data-local:' 'install-data-local-disabled:'
29     mkdir -p $out/etc
30   '';
32   nativeBuildInputs = [
33     perl # shebang of vers_string
34   ];
36   buildInputs = [
37     openldap
38   ];
40   meta = with lib; {
41     description = "LDAP module for the Solaris Nameservice Switch (NSS)";
42     license = licenses.gpl2Plus;
43     platforms = platforms.linux;
44   };