1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-03 11:12:13 +00:00
Raphael Kubo da Costa 23ee2a7d62 Uses/cmake.mk: Replace CMAKE_ENV with CONFIGURE_ENV.
Instead of defining a variable that is almost always based on CONFIGURE_ENV,
just use CONFIGURE_ENV directly.

This also matches the behavior of other ports that do not use autotools (so
most ports can just worry about CONFIGURE_ENV). Additionally, the fact that
we do not use ?= means we do not have problems if another file in Uses/
needs to set CONFIGURE_ENV (with CMAKE_ENV, the order of the arguments to
USES would matter).

Ports which set CMAKE_ENV have been adjusted accordingly. In most cases,
CMAKE_ENV was just replaced with CONFIGURE_ENV, the exceptions being:
* databases/sqliteman: CMAKE_ENV line removed; setting QMAKESPEC there has
                       no effect on the build system.
* devel/freeocl: CMAKE_ENV line removed; FREEOCL_CXX_COMPILER is already
                 retrieved from the CMAKE_CXX_COMPILER variable in the build
                 system.
* graphics/openimageio: CMAKE_ENV line removed; setting Qt variables there
                        has no effect on the build system.

Reviewed by:		makc
Differential Revision:	https://reviews.freebsd.org/D3403
2015-08-18 10:51:01 +00:00

79 lines
2.9 KiB
Makefile

# Created by: Ryan Steinmetz <zi@FreeBSD.org>
# $FreeBSD$
PORTNAME= osquery
PORTVERSION= 1.4.7
CATEGORIES= sysutils
MAINTAINER= zi@FreeBSD.org
COMMENT= SQL powered OS instrumentation, monitoring, and analytics
LICENSE= BSD3CLAUSE
BUILD_DEPENDS= snappy>0:${PORTSDIR}/archivers/snappy \
rocksdb>0:${PORTSDIR}/databases/rocksdb \
thrift>0:${PORTSDIR}/devel/thrift \
thrift-cpp>0:${PORTSDIR}/devel/thrift-cpp \
bash>0:${PORTSDIR}/shells/bash \
yara>0:${PORTSDIR}/security/yara \
doxygen:${PORTSDIR}/devel/doxygen \
${PYTHON_PKGNAMEPREFIX}MarkupSafe>0:${PORTSDIR}/textproc/py-MarkupSafe \
${PYTHON_PKGNAMEPREFIX}psutil>0:${PORTSDIR}/sysutils/py-psutil \
${PYTHON_PKGNAMEPREFIX}argparse>0:${PORTSDIR}/devel/py-argparse \
${PYTHON_PKGNAMEPREFIX}pexpect>0:${PORTSDIR}/misc/py-pexpect \
${PYTHON_PKGNAMEPREFIX}Jinja2>0:${PORTSDIR}/devel/py-Jinja2 \
${PYTHON_PKGNAMEPREFIX}thrift>0:${PORTSDIR}/devel/py-thrift \
${PYTHON_PKGNAMEPREFIX}pip>0:${PORTSDIR}/devel/py-pip
LIB_DEPENDS= libboost_regex.so:${PORTSDIR}/devel/boost-libs \
libgflags.so:${PORTSDIR}/devel/gflags \
libicuuc.so:${PORTSDIR}/devel/icu
USES= cmake:outsource gmake libtool python:build compiler:c++11-lib
CONFIGURE_ENV+= OSQUERY_BUILD_VERSION="${PORTVERSION}" HOME="${WRKDIR}" \
SKIP_TESTS="yes" CC="${CC}" CXX="${CXX}"
CMAKE_ARGS+= -DFREEBSD=awesome -DCMAKE_SYSTEM_NAME="FreeBSD"
BLDDIR= ${WRKDIR}/.build/${PORTNAME}
USE_RC_SUBR= ${PORTNAME}d
USE_GITHUB= yes
GH_ACCOUNT= facebook ${PORTNAME}:tp
GH_PROJECT= third-party:tp
MAKE_JOBS_UNSAFE= yes
.include <bsd.port.pre.mk>
.if ${OSVERSION} <= 1000000
CFLAGS+= -D_GLIBCXX_USE_C99
.endif
post-extract:
${RMDIR} ${WRKSRC}/third-party
${LN} -sf ${WRKSRC_tp} ${WRKSRC}/third-party
post-patch:
${REINPLACE_CMD} -e 's|/var/osquery|/var/db/osquery|g' \
${WRKSRC}/osquery/core/init.cpp
${REINPLACE_CMD} -e 's|/var/osquery/osquery.em|/var/run/osquery.em|g' \
-e 's|/etc/osquery/extensions.load|${PREFIX}/etc/osquery.extensions|g' \
-e 's|/etc/osquery/modules.load|${PREFIX}/etc/osquery.modules|g' \
${WRKSRC}/osquery/extensions/extensions.cpp
${REINPLACE_CMD} -e 's|/var/osquery/osquery.conf|${PREFIX}/etc/osquery.conf|g' \
${WRKSRC}/osquery/config/plugins/filesystem.cpp
${REINPLACE_CMD} -e 's|/var/osquery/|/var/db/osquery/|g' \
${WRKSRC}/tools/deployment/osquery.example.conf
${REINPLACE_CMD} -e 's|python |${PYTHON_CMD} |g' \
${WRKSRC}/CMake/CMakeLibs.cmake \
${WRKSRC}/CMakeLists.txt
do-install:
${INSTALL_PROGRAM} ${BLDDIR}/osqueryi ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${BLDDIR}/osqueryd ${STAGEDIR}${PREFIX}/sbin
${INSTALL_DATA} ${BLDDIR}/libosquery.a ${STAGEDIR}${PREFIX}/lib
(cd ${WRKSRC}/include && ${COPYTREE_SHARE} ${PORTNAME} ${STAGEDIR}${PREFIX}/include)
${INSTALL_DATA} ${WRKSRC}/tools/deployment/osquery.example.conf \
${STAGEDIR}${PREFIX}/etc/osquery.conf.sample
post-stage:
${MKDIR} ${STAGEDIR}/var/db/osquery
.include <bsd.port.post.mk>