@ -1,13 +1,17 @@
{ lib , stdenv , fetchurl , pkg-config , dbus , nettle , fetchpatch
, libidn , libnetfilter_conntrack , buildPackages } :
{ lib , stdenv , fetchurl , pkg-config , nettle , fetchpatch
, libidn , libnetfilter_conntrack , buildPackages
, dbusSupport ? stdenv . isLinux
, dbus
} :
with lib ;
let
copts = concatStringsSep " " ( [
" - D H A V E _ I D N "
" - D H A V E _ D N S S E C "
] ++ optionals stdenv . isLinux [
] ++ optionals dbusSupport [
" - D H A V E _ D B U S "
] ++ optionals stdenv . isLinux [
" - D H A V E _ C O N N T R A C K "
] ) ;
in
@ -52,11 +56,12 @@ stdenv.mkDerivation rec {
substituteInPlace $ out/Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist \
- - replace " / u s r / l o c a l / s b i n " " $ o u t / b i n "
'' + o p t i o n a l S t r i n g s t d e n v . i s L i n u x ''
install - Dm644 dbus/dnsmasq.conf $ out/share/dbus-1/system.d/dnsmasq.conf
install - Dm755 contrib/lease-tools/dhcp_lease_time $ out/bin/dhcp_lease_time
install - Dm755 contrib/lease-tools/dhcp_release $ out/bin/dhcp_release
install - Dm755 contrib/lease-tools/dhcp_release6 $ out/bin/dhcp_release6
'' + o p t i o n a l S t r i n g d b u s S u p p o r t ''
install - Dm644 dbus/dnsmasq.conf $ out/share/dbus-1/system.d/dnsmasq.conf
mkdir - p $ out/share/dbus-1/system-services
cat < < END > $ out/share/dbus-1/system-services/uk.org.thekelleys.dnsmasq.service
[ D-BUS Service ]
@ -69,7 +74,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config ] ;
buildInputs = [ nettle libidn ]
++ optionals stdenv . isLinux [ dbus libnetfilter_conntrack ] ;
++ optionals dbusSupport [ dbus ]
++ optionals stdenv . isLinux [ libnetfilter_conntrack ] ;
meta = {
description = " A n i n t e g r a t e d D N S , D H C P a n d T F T P s e r v e r f o r s m a l l n e t w o r k s " ;