1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-04 06:15:24 +00:00
freebsd-ports/net/isc-dhcp43-server/Makefile

184 lines
5.0 KiB
Makefile
Raw Normal View History

# Created by: Ryan Steinmetz <rpsfa@rit.edu>
# $FreeBSD$
PORTNAME= dhcp
2014-08-16 12:14:42 +00:00
DISTVERSION= 4.3.1
PORTREVISION= ${DHCP_PORTREVISION}
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_ISC}
MASTER_SITE_SUBDIR= ${PORTNAME}/${DISTVERSION}
PKGNAMEPREFIX= isc-
PKGNAMESUFFIX= 43-${SUBSYS}
#DISTNAME= ${PORTNAME}-${DISTVERSION}-${PATCHLEVEL}
MAINTAINER= zi@FreeBSD.org
COMMENT?= The ISC Dynamic Host Configuration Protocol server
LICENSE= ISCL
USES= gmake
#PATCHLEVEL= P1
2014-08-16 12:14:42 +00:00
PORTREVISION_SERVER= 0
PORTREVISION_CLIENT= 0
PORTREVISION_RELAY= 0
SUBSYS?= server
#WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION}-${PATCHLEVEL}
UNIQUENAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
OPTIONS_DEFINE= IPV6
OPTIONS_DEFAULT=IPV6
.if ${SUBSYS} == server
OPTIONS_DEFINE+= PARANOIA LDAP LDAP_SSL BIND_SYMBOLS
OPTIONS_DEFAULT+= PARANOIA LDAP_SSL
PARANOIA_DESC= Enable support for chroot
LDAP_SSL_DESC= Support LDAP over SSL/TLS
BIND_SYMBOLS_DESC= Enable BIND internal symbol table
.endif
# PORTREVISION and CONFLICTS handling
.if ${SUBSYS} == client
CONFLICTS= isc-dhcp3?-client-[0-9]* isc-dhcp4[12]-client-[0-9]*
DHCP_PORTREVISION= ${PORTREVISION_CLIENT}
.elif ${SUBSYS} == relay
CONFLICTS= isc-dhcp3?-relay-[0-9]* isc-dhcp4[12]-relay-[0-9]*
DHCP_PORTREVISION= ${PORTREVISION_RELAY}
.else
CONFLICTS= isc-dhcp3?-server-[0-9]* isc-dhcp4[12]-server-[0-9]*
DHCP_PORTREVISION= ${PORTREVISION_SERVER}
MAKE_JOBS_UNSAFE= yes
.endif
.if ${SUBSYS} == server
USERS= dhcpd
GROUPS= dhcpd
.endif
MAN_COMPRESSED= no
GNU_CONFIGURE= yes
CPPFLAGS+= -D_PATH_DHCLIENT_SCRIPT='\"${PREFIX}/sbin/dhclient-script\"' -D_PATH_DHCLIENT_CONF='\"${PREFIX}/etc/dhclient.conf\"' -D_PATH_DHCPD_CONF='\"${PREFIX}/etc/dhcpd.conf\"'
SCRIPTS_ENV+= PKG_PREFIX=${PREFIX}
.include <bsd.port.options.mk>
2014-03-26 17:27:24 +00:00
.if ${SUBSYS} == server
CONFIGURE_ARGS+=--localstatedir=/var
CFLAGS+= -fPIC
.endif
DESCR= ${.CURDIR}/pkg-descr
PLIST= ${.CURDIR}/pkg-plist
.if ${SUBSYS} == server
USE_RC_SUBR= isc-dhcpd
.elif ${SUBSYS} == relay
USE_RC_SUBR= isc-dhcrelay
.endif
SCHEMA_DIR= ${PREFIX}/share/${PKGBASE}
DOCSDIR= ${PREFIX}/share/doc/${PKGBASE}
DATADIR= /var/db
MSG_FILE= ${.CURDIR}/pkg-message
PKGMESSAGE= ${WRKDIR}/pkg-message
REINPLACE_SUB= PREFIX="${PREFIX}"
PKGMESSAGE_SUB= PREFIX="${PREFIX}" MAN1PREFIX="${MAN1PREFIX}" \
DOCSDIR="${DOCSDIR}"
.if ${PORT_OPTIONS:MPARANOIA}
CONFIGURE_ARGS+=--enable-paranoia --enable-early-chroot
SUB_LIST+= PARANOIA="yes"
.else
SUB_LIST+= PARANOIA="no"
.endif
.if ${PORT_OPTIONS:MLDAP}
CONFIGURE_ARGS+=--with-ldap
USE_OPENLDAP= yes
LDAP_SCRIPT= ${WRKSRC}/contrib/ldap/dhcpd-conf-to-ldap
LDAP_SCHEMA= ${WRKSRC}/contrib/ldap/dhcp.schema
LDAP_README= ${WRKSRC}/contrib/ldap/README.ldap
Support LIBS like LDFLAGS. - Add LIBS="${LIBS}" to MAKE_ENV and CONFIGURE_ENV. - Add an option helper for LIBS. - Adjust all ports that already use LIBS. Also remove references to PTHREAD_CFLAGS and PTHREAD_LIBS while here. - Some ports did not support having a LIBS environment variable and required additional patches. Somewhat simplified a linker command line looks like: ${CC} ${src_LDFLAGS} ${LDFLAGS} ${src_LIBS} ${LIBS} where src_LDFLAGS and src_LIBS are controlled by upstream and LDFLAGS and LIBS can be controlled by us. If possible -L and -l flags need to be added to LIBS to make sure they appear after any -L and -l flags set by upstream. Many ports currently add -L${LOCALBASE}/lib to LDFLAGS but this may appear too early on the command line causing installed libraries to be linked in instead of freshly built ones. Additional changes: benchmarks/netio: Replace WITH_IPV6 with an IPV6 option. comms/gnokii: Replace some patches with USES=pathfix. Also remove -fPIC. graphics/gimageview: USES=libtool and install desktop file in DESKTOPDIR. graphics/visionworkbench: Remove FreeBSD 7 support. multimedia/libmovtar: New LIB_DEPENDS syntax. multimedia/opencinematools: Use standard do-build. net/siproxd: USES=libtool:keepla (port actually needs .la files for plugins) net-mgmt/nagios: Remove -fPIC. net-mgmt/nagios4: Remove -fPIC. print/cups-base: Only add -lssp_nonshared on i386 and OSVERSION < 1000036. security/p11-kit: Replace PTHREAD_LIBS in CONFIGURE_ENV with ac_cv_func_pthread_mutexattr_init=no in CONFIGURE_ARGS. This skips a test in configure that falsely detects pthread_mutexattr_init in our libc. sysutils/dar: Fix iconv detection. x11/rxvt-unicode: Remove -lstdc++ and patch configure to remove a FreeBSD hack and use $CXX as linker as on other platforms. PR: 190592 Exp-run by: antoine Approved by: portmgr (antoine)
2014-06-11 14:49:59 +00:00
CPPFLAGS+= -I${LOCALBASE}/include
LIBS+= -L${LOCALBASE}/lib
PORTDOCS+= README.ldap
PLIST_SUB+= SCHEMA_DIR="${SCHEMA_DIR:S,^${PREFIX}/,,}" LDAP=""
2014-03-26 17:27:24 +00:00
USES+= shebangfix
SHEBANG_FILES= contrib/ldap/dhcpd-conf-to-ldap
.else
PLIST_SUB+= LDAP="@comment "
.endif
.if ${PORT_OPTIONS:MLDAP_SSL} && ${PORT_OPTIONS:MLDAP}
USE_OPENSSL= yes
CONFIGURE_ARGS+=--with-ldapcrypto
Support LIBS like LDFLAGS. - Add LIBS="${LIBS}" to MAKE_ENV and CONFIGURE_ENV. - Add an option helper for LIBS. - Adjust all ports that already use LIBS. Also remove references to PTHREAD_CFLAGS and PTHREAD_LIBS while here. - Some ports did not support having a LIBS environment variable and required additional patches. Somewhat simplified a linker command line looks like: ${CC} ${src_LDFLAGS} ${LDFLAGS} ${src_LIBS} ${LIBS} where src_LDFLAGS and src_LIBS are controlled by upstream and LDFLAGS and LIBS can be controlled by us. If possible -L and -l flags need to be added to LIBS to make sure they appear after any -L and -l flags set by upstream. Many ports currently add -L${LOCALBASE}/lib to LDFLAGS but this may appear too early on the command line causing installed libraries to be linked in instead of freshly built ones. Additional changes: benchmarks/netio: Replace WITH_IPV6 with an IPV6 option. comms/gnokii: Replace some patches with USES=pathfix. Also remove -fPIC. graphics/gimageview: USES=libtool and install desktop file in DESKTOPDIR. graphics/visionworkbench: Remove FreeBSD 7 support. multimedia/libmovtar: New LIB_DEPENDS syntax. multimedia/opencinematools: Use standard do-build. net/siproxd: USES=libtool:keepla (port actually needs .la files for plugins) net-mgmt/nagios: Remove -fPIC. net-mgmt/nagios4: Remove -fPIC. print/cups-base: Only add -lssp_nonshared on i386 and OSVERSION < 1000036. security/p11-kit: Replace PTHREAD_LIBS in CONFIGURE_ENV with ac_cv_func_pthread_mutexattr_init=no in CONFIGURE_ARGS. This skips a test in configure that falsely detects pthread_mutexattr_init in our libc. sysutils/dar: Fix iconv detection. x11/rxvt-unicode: Remove -lstdc++ and patch configure to remove a FreeBSD hack and use $CXX as linker as on other platforms. PR: 190592 Exp-run by: antoine Approved by: portmgr (antoine)
2014-06-11 14:49:59 +00:00
LIBS+= -lssl
.include "${PORTSDIR}/Mk/bsd.openssl.mk"
.endif
.if ${PORT_OPTIONS:MIPV6}
CONFIGURE_ARGS+=--enable-dhcpv6
PLIST_SUB+= IPV6=""
.else
CONFIGURE_ARGS+=--disable-dhcpv6
PLIST_SUB+= IPV6="@comment "
.endif
.if ${PORT_OPTIONS:MBIND_SYMBOLS}
USES+= perl5
.else
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-bind__Makefile
.endif
post-patch:
@${SED} ${PKGMESSAGE_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${MSG_FILE} > ${PKGMESSAGE}
@${REINPLACE_CMD} -e 's|/usr/local||g' \
${WRKSRC}/doc/examples/dhcpd-dhcpv6.conf
@${REINPLACE_CMD} ${REINPLACE_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${WRKSRC}/client/dhclient.conf.example
do-install:
2014-03-26 17:27:24 +00:00
${SETENV} DESTDIR=${STAGEDIR} ${MAKE} -C ${WRKSRC}/${SUBSYS} install
.if ${SUBSYS} == server
2014-03-26 17:27:24 +00:00
${SETENV} DESTDIR=${STAGEDIR} ${MAKE} -C ${WRKSRC}/dhcpctl install
${SETENV} DESTDIR=${STAGEDIR} ${MAKE} -C ${WRKSRC}/dst install
${SETENV} DESTDIR=${STAGEDIR} ${MAKE} -C ${WRKSRC}/omapip install
${SETENV} DESTDIR=${STAGEDIR} ${MAKE} -C ${WRKSRC}/includes install
${SETENV} DESTDIR=${STAGEDIR} ${MAKE} -C ${WRKSRC}/common install
${INSTALL_DATA} ${WRKSRC}/dhcpctl/dhcpctl.h ${STAGEDIR}${PREFIX}/include
.if ${PORT_OPTIONS:MIPV6}
${INSTALL_DATA} ${WRKSRC}/doc/examples/dhcpd-dhcpv6.conf \
2014-03-26 17:27:24 +00:00
${STAGEDIR}${PREFIX}/etc/dhcpd6.conf.example
.endif
.if ${PORT_OPTIONS:MLDAP}
2014-03-26 17:27:24 +00:00
@${MKDIR} ${STAGEDIR}${SCHEMA_DIR}
${INSTALL_DATA} ${LDAP_SCHEMA} ${STAGEDIR}${SCHEMA_DIR}
${INSTALL_SCRIPT} ${LDAP_SCRIPT} ${STAGEDIR}${PREFIX}/bin
.endif
2014-03-26 17:27:24 +00:00
.if ${PORT_OPTIONS:MLDAP}
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_MAN} ${LDAP_README} ${STAGEDIR}${DOCSDIR}
.endif
.endif
post-install:
.if ${SUBSYS} == client
2014-03-26 17:27:24 +00:00
${INSTALL_SCRIPT} ${WRKSRC}/client/scripts/freebsd ${STAGEDIR}${PREFIX}/sbin/dhclient-script
.elif ${SUBSYS} == server
.if ${PORT_OPTIONS:MIPV6}
2014-03-26 17:27:24 +00:00
@${LN} -sf isc-dhcpd ${STAGEDIR}${PREFIX}/etc/rc.d/isc-dhcpd6
.endif
.elif ${SUBSYS} == relay
.if ${PORT_OPTIONS:MIPV6}
2014-03-26 17:27:24 +00:00
@${LN} -sf isc-dhcrelay ${STAGEDIR}${PREFIX}/etc/rc.d/isc-dhcrelay6
.endif
.endif
@${SED} ${PKGMESSAGE_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${MSG_FILE} > ${PKGMESSAGE}
.include <bsd.port.mk>