1 # Created by: Steven Honson
8 MASTER_SITES= http://www.thekelleys.org.uk/dnsmasq/ \
11 MAINTAINER= mandree@FreeBSD.org
12 COMMENT= Lightweight DNS forwarder, DHCP, and TFTP server
16 CONFLICTS_INSTALL=dnsmasq-devel-*
18 PORTDOCS= CHANGELOG CHANGELOG.archive FAQ doc.html setup.html
20 SUB_FILES= pkg-message
23 CFLAGS+= -Wall -Wno-unused-value
24 CPPFLAGS+= -I${LOCALBASE}/include
25 MAKE_ARGS= CC="${CC}" CFLAGS="${CFLAGS}" PREFIX="${PREFIX}" LIBS="${LDFLAGS}" RPM_OPT_FLAGS="${CPPFLAGS}"
27 OPTIONS_DEFINE= IPV6 DBUS LUA
28 OPTIONS_DEFAULT= IPV6 NLS
29 OPTIONS_EXCLUDE+= EXAMPLES
31 OPTIONS_RADIO_INTL= IDN NLS
32 INTL_DESC= Internationalization Support Level
33 NLS_DESC= National Language and Int'l Domain Names support (IDN + NLS)
34 IDN_DESC= International Domain Names support WITHOUT full NLS (IDN)
35 LUA_DESC= Support lease-change scripts in LUA
37 SHEBANG_FILES= contrib/dynamic-dnsmasq/dynamic-dnsmasq.pl \
38 contrib/dnslist/dnslist.pl
40 .include <bsd.port.options.mk>
42 .if empty(PORT_OPTIONS:MIPV6)
46 .if ${PORT_OPTIONS:MNLS}
47 USES+= pkgconfig gettext iconv gmake
48 LIB_DEPENDS+= libidn.so:${PORTSDIR}/dns/libidn
54 PLIST_SUB+= NLS="@comment "
55 .if ${PORT_OPTIONS:MIDN}
58 LIB_DEPENDS+= libidn.so:${PORTSDIR}/dns/libidn
63 .if ${PORT_OPTIONS:MDBUS}
64 LIB_DEPENDS+= libdbus-1.so:${PORTSDIR}/devel/dbus
66 CPPFLAGS+= `pkg-config --cflags dbus-1`
68 LDFLAGS+= `pkg-config --libs dbus-1`
71 .if ${PORT_OPTIONS:MLUA}
72 CPPFLAGS+= -I${LUA_INCDIR}
73 CFLAGS+= -DHAVE_LUASCRIPT
74 LDFLAGS+= -L${LUA_LIBDIR} -llua
80 .include <bsd.port.pre.mk>
82 LDFLAGS+= -L${LOCALBASE}/lib ${_intllibs} ${ICONV_LIB}
85 ${REINPLACE_CMD} -e "s/lua5\.1/lua-5.1/" ${WRKSRC}/Makefile
87 pre-configure: pretty-print-config
88 @${PRINTF} "dns/libidn config: " ; ${MAKE} -C ${PORTSDIR}/dns/libidn pretty-print-config
89 .if ${PORT_OPTIONS:MIDN}
90 .if empty(PORT_OPTIONS:MNLS)
91 @if ${OBJDUMP} -p ${LOCALBASE}/lib/libidn.so \
92 | ${EGREP} -q 'NEEDED[[:space:]]+libintl\.so' ; \
93 then ${ECHO} ; ${ECHO} 'WARNING: dns/libidn was compiled with NLS support!' ; \
94 ${ECHO} 'Recompile libidn WITHOUT_NLS to get rid of NLS dependencies.' ; ${ECHO} ; \
97 @${ECHO} 'WARNING: IDN and NLS enabled, building IDN WITH NLS.'
102 ${INSTALL_PROGRAM} ${WRKSRC}/src/dnsmasq ${STAGEDIR}${PREFIX}/sbin
103 ${INSTALL_DATA} ${WRKSRC}/dnsmasq.conf.example ${STAGEDIR}${PREFIX}/etc
104 ${INSTALL_MAN} ${WRKSRC}/man/${PORTNAME}.8 ${STAGEDIR}${PREFIX}/man/man8
105 .if ${PORT_OPTIONS:MDOCS}
106 @${MKDIR} ${STAGEDIR}${DOCSDIR}
107 cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
109 .if ${PORT_OPTIONS:MNLS}
110 .for i in de es fi fr id it no pl pt_BR ro
111 ${MKDIR} ${STAGEDIR}${PREFIX}/share/locale/${i}/LC_MESSAGES
112 ${INSTALL_DATA} ${WRKSRC}/src/${i}.mo \
113 ${STAGEDIR}${PREFIX}/share/locale/${i}/LC_MESSAGES/${PORTNAME}.mo
116 ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/dynamic-dnsmasq ${STAGEDIR}${EXAMPLESDIR}/dnslist
117 ${INSTALL_SCRIPT} ${WRKSRC}/contrib/dynamic-dnsmasq/dynamic-dnsmasq.pl ${STAGEDIR}${EXAMPLESDIR}/dynamic-dnsmasq/
118 ${INSTALL_SCRIPT} ${WRKSRC}/contrib/dnslist/dnslist.pl ${STAGEDIR}${EXAMPLESDIR}/dnslist/
119 ${INSTALL_DATA} ${WRKSRC}/contrib/dnslist/dhcp.css ${STAGEDIR}${EXAMPLESDIR}/dnslist/
120 ${INSTALL_DATA} ${WRKSRC}/contrib/dnslist/dnslist.tt2 ${STAGEDIR}${EXAMPLESDIR}/dnslist/
122 .include <bsd.port.post.mk>