Tweak dns/sleuth version 1.4.4
[dports.git] / dns / dnsmasq / Makefile
1 # Created by: Steven Honson
2 # $FreeBSD$
3
4 PORTNAME=       dnsmasq
5 DISTVERSION=    2.68
6 PORTEPOCH=      1
7 CATEGORIES=     dns ipv6
8 MASTER_SITES=   http://www.thekelleys.org.uk/dnsmasq/ \
9                 LOCAL/mandree/
10
11 MAINTAINER=     mandree@FreeBSD.org
12 COMMENT=        Lightweight DNS forwarder, DHCP, and TFTP server
13
14 LICENSE=        GPLv2
15
16 CONFLICTS_INSTALL=dnsmasq-devel-*
17
18 PORTDOCS=       CHANGELOG CHANGELOG.archive FAQ doc.html setup.html
19
20 SUB_FILES=      pkg-message
21
22 USE_XZ=         yes
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}"
26
27 OPTIONS_DEFINE=         IPV6 DBUS LUA
28 OPTIONS_DEFAULT=        IPV6 NLS
29 OPTIONS_EXCLUDE+=       EXAMPLES
30 OPTIONS_RADIO=          INTL
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
36 USES=           shebangfix
37 SHEBANG_FILES=  contrib/dynamic-dnsmasq/dynamic-dnsmasq.pl \
38                 contrib/dnslist/dnslist.pl
39
40 .include <bsd.port.options.mk>
41
42 .if empty(PORT_OPTIONS:MIPV6)
43 CFLAGS+=        -DNO_IPV6
44 .endif
45
46 .if ${PORT_OPTIONS:MNLS}
47 USES+=          pkgconfig gettext iconv gmake
48 LIB_DEPENDS+=   libidn.so:${PORTSDIR}/dns/libidn
49 PLIST_SUB+=     NLS=""
50 ALL_TARGET=     all-i18n
51 _intllibs=      -lintl
52 .else
53 _intllibs=
54 PLIST_SUB+=     NLS="@comment "
55 .if ${PORT_OPTIONS:MIDN}
56 USES+=          iconv
57 CFLAGS+=        -DHAVE_IDN
58 LIB_DEPENDS+=   libidn.so:${PORTSDIR}/dns/libidn
59 _intllibs+=     -lidn
60 .endif
61 .endif
62
63 .if ${PORT_OPTIONS:MDBUS}
64 LIB_DEPENDS+=   libdbus-1.so:${PORTSDIR}/devel/dbus
65 USES+=          pkgconfig
66 CPPFLAGS+=      `pkg-config --cflags dbus-1`
67 CFLAGS+=        -DHAVE_DBUS
68 LDFLAGS+=       `pkg-config --libs dbus-1`
69 .endif
70
71 .if ${PORT_OPTIONS:MLUA}
72 CPPFLAGS+=      -I${LUA_INCDIR}
73 CFLAGS+=        -DHAVE_LUASCRIPT
74 LDFLAGS+=       -L${LUA_LIBDIR} -llua
75 USE_LUA=        5.1
76 .endif
77
78 USE_RC_SUBR=    dnsmasq
79
80 .include <bsd.port.pre.mk>
81
82 LDFLAGS+=       -L${LOCALBASE}/lib ${_intllibs} ${ICONV_LIB}
83
84 post-patch:
85         ${REINPLACE_CMD} -e "s/lua5\.1/lua-5.1/" ${WRKSRC}/Makefile
86
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} ; \
95         fi
96 .else
97         @${ECHO} 'WARNING: IDN and NLS enabled, building IDN WITH NLS.'
98 .endif
99 .endif
100
101 do-install:
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}
108 .endif
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
114 .endfor
115 .endif
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/
121
122 .include <bsd.port.post.mk>