nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenvNoCC,
4 fetchurl,
5 makeWrapper,
6 perlPackages,
7}:
8
9stdenvNoCC.mkDerivation rec {
10 pname = "schema2ldif";
11 version = "1.3";
12
13 src = fetchurl {
14 url = "https://repos.fusiondirectory.org/sources/schema2ldif/schema2ldif-${version}.tar.gz";
15 hash = "sha256-KmXdqVuINUnJ6EF5oKgk6BsT3h5ebVqss7aCl3pPjQE=";
16 };
17
18 postPatch = ''
19 # Removes the root check and changes the temporary location
20 # from the nix store to $PWD
21 sed -i \
22 -e '/You have to run this script as root/d' \
23 -e 's|/\^(\.\*)\\\.schema\$/|/.*\\/(.*)\\.schema$/|g' \
24 bin/ldap-schema-manager
25 '';
26
27 buildInputs = [ perlPackages.perl ];
28 nativeBuildInputs = [ makeWrapper ];
29
30 installPhase = ''
31 mkdir -p $out/bin $out/share/man/man1
32
33 cp bin/{schema2ldif,ldap-schema-manager} $out/bin
34 gzip -c man/schema2ldif.1 > $out/share/man/man1/schema2ldif.1.gz
35 gzip -c man/ldap-schema-manager.1 > $out/share/man/man1/ldap-schema-manager.1.gz
36
37 wrapProgram $out/bin/schema2ldif \
38 --prefix PERL5PATH : "${perlPackages.makePerlPath [ perlPackages.GetoptLong ]}"
39 '';
40
41 meta = {
42 description = "Utilities to manage schema in .schema and .ldif format";
43 homepage = "https://www.fusiondirectory.org/schema2ldif-project-and-components/";
44 license = lib.licenses.bsd3;
45 platforms = lib.platforms.unix;
46 maintainers = with lib.maintainers; [ das_j ];
47 };
48}