Unverified Commit 039fab18 authored by Niklas Hambüchen's avatar Niklas Hambüchen Committed by GitHub
Browse files

ceph: patch getopt path at build time (#440224)

parents 3af0eb84 175a0fc1
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -45,8 +45,6 @@ let
      partOf = [ "ceph-${daemonType}.target" ];
      wantedBy = [ "ceph-${daemonType}.target" ];

      path = [ pkgs.getopt ];

      # Don't start services that are not yet initialized
      unitConfig.ConditionPathExists = "/var/lib/${stateDirectory}/keyring";
      startLimitBurst =
+9 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@
  cunit,
  e2fsprogs,
  doxygen,
  getopt,
  gperf,
  graphviz,
  gnugrep,
@@ -518,6 +519,10 @@ stdenv.mkDerivation {
    substituteInPlace src/client/fuse_ll.cc \
      --replace-fail "mount -i -o remount" "${util-linux}/bin/mount -i -o remount"

    substituteInPlace src/{ceph-osd-prestart.sh,ceph-post-file.in,init-ceph.in} \
       --replace-fail "GETOPT=/usr/local/bin/getopt" "GETOPT=${getopt}/bin/getopt" \
       --replace-fail "GETOPT=getopt" "GETOPT=${getopt}/bin/getopt"

    # The install target needs to be in PYTHONPATH for "*.pth support" check to succeed
    export PYTHONPATH=$PYTHONPATH:$lib/${sitePackages}:$out/${sitePackages}
    patchShebangs src/
@@ -584,6 +589,10 @@ stdenv.mkDerivation {
    # silently drop it with misconfigurations.
    test -f $out/bin/ceph-volume

    # Assert that getopt patch from preConfigure covered all instances
    ! grep -F -r 'GETOPT=getopt' $out
    ! grep -F -r 'GETOPT=/usr/local/bin/getopt' $out

    mkdir -p $client/{bin,etc,${sitePackages},share/bash-completion/completions}
    cp -r $out/bin/{ceph,.ceph-wrapped,rados,rbd,rbdmap} $client/bin
    cp -r $out/bin/ceph-{authtool,conf,dencoder,rbdnamer,syn} $client/bin