freebsd-ports/sysutils/osquery/Makefile
Ryan Steinmetz 6efaeef862 New port: sysutils/osquery:
osquery exposes an operating system as a high-performance relational database.
This allows you to write SQL-based queries to explore operating system data.
With osquery, SQL tables represent abstract concepts such as running
processes, loaded kernel modules, open network connections, browser plugins,
hardware events or file hashes.

WWW: https://osquery.io/

Sponsored by:	Beer from wxs@
2015-05-10 15:19:11 +00:00

74 lines
2.7 KiB
Makefile

# Created by: Ryan Steinmetz <zi@FreeBSD.org>
# $FreeBSD$
PORTNAME= osquery
PORTVERSION= 1.4.5
CATEGORIES= sysutils
MASTER_SITES= GH:ghc \
https://codeload.github.com/${PORTNAME}/third-party/tar.gz/${PORTVERSION}?dummy=/:gh
DISTFILES= ${PORTNAME}-${PORTVERSION}.tar.gz:ghc \
third-party-${PORTVERSION}.tar.gz:gh
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
CMAKE_ENV+= OSQUERY_BUILD_VERSION="${PORTVERSION}" HOME="${WRKDIR}" SKIP_TESTS="yes"
CMAKE_ARGS+= -DFREEBSD=awesome -DCMAKE_SYSTEM_NAME="FreeBSD"
BLDDIR= ${WRKDIR}/.build/${PORTNAME}
USE_RC_SUBR= ${PORTNAME}d
USE_GITHUB= yes
GH_ACCOUNT= facebook
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 ${WRKDIR}/third-party-${PORTVERSION} ${WRKSRC}/third-party
post-patch:
${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>