openvswitch: export and fix ovs-monitor-ipsec script

This commit is contained in:
Jaka Hudoklin 2015-04-25 15:33:08 +02:00
parent b5114de4ac
commit f2ec6964db

View File

@ -1,47 +1,62 @@
{ stdenv, fetchurl, openssl, python27, iproute, perl, kernel ? null}: { stdenv, fetchurl, makeWrapper
, openssl, python27, iproute, perl, kernel ? null }:
with stdenv.lib;
let let
_kernel = kernel;
version = "2.1.2"; in stdenv.mkDerivation rec {
version = "2.3.1";
skipKernelMod = kernel == null;
in
stdenv.mkDerivation {
version = "2.1.2";
name = "openvswitch-${version}"; name = "openvswitch-${version}";
src = fetchurl { src = fetchurl {
url = "http://openvswitch.org/releases/openvswitch-2.1.2.tar.gz"; url = "http://openvswitch.org/releases/${name}.tar.gz";
sha256 = "16q7faqrj2pfchhn0x5s9ggi5ckcg9n62f6bnqaih064aaq2jm47"; sha256 = "1lmwyhm5wmdv1l4v1v5xd36d5ra21jz9ix57nh1lgm8iqc0lj5r1";
}; };
kernel = if skipKernelMod then null else kernel.dev;
buildInputs = [ kernel = optional (_kernel != null) _kernel.dev;
openssl
python27 buildInputs = [ makeWrapper openssl python27 perl ];
perl
];
configureFlags = [ configureFlags = [
"--localstatedir=/var" "--localstatedir=/var"
"--sharedstatedir=/var" "--sharedstatedir=/var"
"--sbindir=$(out)/bin" "--sbindir=$(out)/bin"
] ++ (if skipKernelMod then [] else ["--with-linux"]); ] ++ (optionals (_kernel != null) ["--with-linux"]);
# Leave /var out of this! # Leave /var out of this!
installFlags = [ installFlags = [
"LOGDIR=$(TMPDIR)/dummy" "LOGDIR=$(TMPDIR)/dummy"
"RUNDIR=$(TMPDIR)/dummy" "RUNDIR=$(TMPDIR)/dummy"
"PKIDIR=$(TMPDIR)/dummy" "PKIDIR=$(TMPDIR)/dummy"
]; ];
postInstall = ''
cp debian/ovs-monitor-ipsec $out/share/openvswitch/scripts
makeWrapper \
$out/share/openvswitch/scripts/ovs-monitor-ipsec \
$out/bin/ovs-monitor-ipsec \
--prefix PYTHONPATH : "$out/share/openvswitch/python"
substituteInPlace $out/share/openvswitch/scripts/ovs-monitor-ipsec \
--replace "UnixctlServer.create(None)" "UnixctlServer.create(os.environ['UNIXCTLPATH'])"
substituteInPlace $out/share/openvswitch/scripts/ovs-monitor-ipsec \
--replace "self.psk_file" "root_prefix + self.psk_file"
substituteInPlace $out/share/openvswitch/scripts/ovs-monitor-ipsec \
--replace "self.cert_dir" "root_prefix + self.cert_dir"
'';
meta = { meta = {
platforms = stdenv.lib.platforms.linux; platforms = platforms.linux;
description = "A multilayer virtual switch"; description = "A multilayer virtual switch";
longDescription = longDescription =
'' ''
Open vSwitch is a production quality, multilayer virtual switch Open vSwitch is a production quality, multilayer virtual switch
licensed under the open source Apache 2.0 license. It is licensed under the open source Apache 2.0 license. It is
designed to enable massive network automation through designed to enable massive network automation through
programmatic extension, while still supporting standard programmatic extension, while still supporting standard
management interfaces and protocols (e.g. NetFlow, sFlow, SPAN, management interfaces and protocols (e.g. NetFlow, sFlow, SPAN,
RSPAN, CLI, LACP, 802.1ag). In addition, it is designed to RSPAN, CLI, LACP, 802.1ag). In addition, it is designed to
support distribution across multiple physical servers similar support distribution across multiple physical servers similar
to VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. to VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V.
''; '';
homepage = "http://openvswitch.org/"; homepage = "http://openvswitch.org/";