2016-04-10 01:36:02 +02:00
|
|
|
{ stdenv, lib, fetchurl, gnugrep, glibc, gawk, coreutils, bridge-utils, iproute
|
|
|
|
, dnsmasq, iptables, kmod, utillinux, gnused }:
|
2015-08-10 01:13:40 +02:00
|
|
|
|
2016-04-10 01:36:02 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2015-08-10 01:13:40 +02:00
|
|
|
name = "fanctl-${version}";
|
|
|
|
|
2016-09-18 04:36:54 +02:00
|
|
|
version = "0.12.0";
|
2015-08-10 01:13:40 +02:00
|
|
|
|
2016-04-10 01:36:02 +02:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://launchpad.net/ubuntu/+archive/primary/+files/ubuntu-fan_${version}.tar.xz";
|
2016-09-18 04:36:54 +02:00
|
|
|
sha256 = "0lj7371n06sg5mlbbfgvm0qhzgp464n6v55rgs7kmmx4d37gb5fl";
|
2015-08-10 01:13:40 +02:00
|
|
|
};
|
|
|
|
|
2016-04-10 01:36:02 +02:00
|
|
|
# The Ubuntu package creates a number of state/config directories upon
|
|
|
|
# installation, and so the fanctl script expects those directories to exist
|
|
|
|
# before being used. Instead, we patch the fanctl script to gracefully handle
|
|
|
|
# the fact that the directories might not exist yet.
|
|
|
|
# Also, when dnsmasq is given --conf-file="", it will still attempt to read
|
|
|
|
# /etc/dnsmasq.conf; if that file does not exist, dnsmasq subsequently fails,
|
|
|
|
# so we'll use /dev/null, which actually works as intended.
|
|
|
|
patches = [ ./robustness.patch ];
|
2015-08-10 01:13:40 +02:00
|
|
|
|
2016-04-10 01:36:02 +02:00
|
|
|
postPatch = ''
|
2015-08-10 01:13:40 +02:00
|
|
|
substituteInPlace fanctl \
|
2016-04-10 01:36:02 +02:00
|
|
|
--replace '@PATH@' \
|
2016-04-13 14:53:51 +02:00
|
|
|
'${lib.makeBinPath [
|
2016-04-10 01:36:02 +02:00
|
|
|
gnugrep gawk coreutils bridge-utils iproute dnsmasq
|
|
|
|
iptables kmod utillinux gnused
|
|
|
|
glibc # needed for getent
|
|
|
|
]}'
|
2015-08-10 01:13:40 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/man/man8
|
|
|
|
cp fanctl.8 $out/man/man8
|
|
|
|
cp fanctl $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Ubuntu FAN network support enablement";
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = https://launchpad.net/ubuntu/+source/ubuntu-fan;
|
2015-08-10 01:13:40 +02:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ cstrahan ];
|
|
|
|
};
|
|
|
|
}
|