# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 # $Id$ PortSystem 1.0 name dnsmasq version 2.59 revision 2 categories net license GPL maintainers snc openmaintainer description lightweight DNS forwarder and DHCP server long_description Dnsmasq is lightweight, easy to configure DNS \ forwarder and DHCP server. It is designed to provide \ DNS and, optionally, DHCP, to a small network. It can \ serve the names of local machines which are not in the \ global DNS. The DHCP server integrates with the DNS \ server and allows machines with DHCP-allocated \ addresses to appear in the DNS with names configured \ either in each host or in a central configuration \ file. Dnsmasq supports static and dynamic DHCP leases \ and BOOTP for network booting of diskless machines. homepage http://www.thekelleys.org.uk/dnsmasq/doc.html platforms darwin notes "A startup item has been generated that will aid in\ starting ${name} with launchd. You must specify the\ path to resolv.conf. For your protection, this script\ is disabled by default. Execute the following command\ to start it, and to cause it to launch at startup:\ \n\nsudo port load ${name}" master_sites http://www.thekelleys.org.uk/dnsmasq/ use_lzma yes checksums rmd160 ca7b841d97e0ef7ab5a8c2c099ecb79de28633b3 \ sha256 3bba1f637d04145e756ffc31a5076961a0aaf4716d097fa0d4a9a24dc8869391 patchfiles patch-src-config.h.diff \ patch-src-network.c.diff \ patch-Makefile.diff post-patch { reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/src/config.h reinplace s|#resolv-file=|resolv-file=/etc/resolv.conf| \ ${worksrcpath}/dnsmasq.conf.example } use_configure no variant universal {} build.env-append CC="${configure.cc} [get_canonical_archflags]" destroot.args PREFIX=${prefix} destroot.keepdirs ${destroot}${prefix}/var/run/${name} livecheck.type regex livecheck.url ${master_sites} livecheck.regex LATEST_IS_(\\d\\.\\d+) set COPTS "" variant no_dhcp description { Disable built in DHCP server } { set COPTS "${COPTS} -DNO_DHCP" build.args COPTS="${COPTS}" } variant no_tftp description { Disable built in TFTP server } { set COPTS "${COPTS} -DNO_TFTP" build.args COPTS="${COPTS}" } variant no_ipv6 description { Disable IPV6 support } { set COPTS "${COPTS} -DNO_IPV6" build.args COPTS="${COPTS}" } post-destroot { # copy configuration file if not previously created if {![file exists ${prefix}/etc/dnsmasq.conf]} { copy ${destroot}${prefix}/etc/dnsmasq.conf.sample \ ${destroot}${prefix}/etc/dnsmasq.conf } # Create the directory that dnsmasq likes to store its pid in. xinstall -d -m 777 ${destroot}${prefix}/var/run/${name} # # Set up a launchd item. The daemondo wrapper is not needed. # # Create the plist file. set itemname ${startupitem.name} set uniquename ${startupitem.uniquename} set plistname ${startupitem.plist} set daemondest ${startupitem.location} set itemdir ${prefix}/etc/${daemondest}/${uniquename} file mkdir ${destroot}${itemdir} file attributes ${destroot}${itemdir} -owner root -group wheel set plist [open "${destroot}${itemdir}/${plistname}" w 0644] puts ${plist} "" puts ${plist} "" puts ${plist} "" puts ${plist} " " puts ${plist} " Disabled" puts ${plist} " " puts ${plist} " Label" puts ${plist} " ${uniquename}" puts ${plist} " ProgramArguments" puts ${plist} " " puts ${plist} " ${prefix}/sbin/dnsmasq" puts ${plist} " -k" puts ${plist} " " puts ${plist} " KeepAlive" puts ${plist} " " puts ${plist} " NetworkState" puts ${plist} " " puts ${plist} " " puts ${plist} " " puts ${plist} "" close ${plist} # Make a symlink to the plist file. file mkdir "${destroot}/Library/${daemondest}" ln -sf "${itemdir}/${plistname}" "${destroot}/Library/${daemondest}" }