2012-12-16 00:52:36 +01:00
|
|
|
# Created by: lx
|
2003-04-13 15:17:14 +02:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= samhain
|
2013-06-25 21:04:41 +02:00
|
|
|
PORTVERSION= 3.0.13
|
2003-04-13 15:17:14 +02:00
|
|
|
CATEGORIES= security
|
2003-07-29 07:45:30 +02:00
|
|
|
MASTER_SITES= http://la-samhna.de/archive/ \
|
2006-05-02 09:58:17 +02:00
|
|
|
http://redundancy.redundancy.org/mirror/
|
2005-09-22 09:15:29 +02:00
|
|
|
DISTNAME= samhain_signed-${PORTVERSION}
|
2003-04-13 15:17:14 +02:00
|
|
|
|
2007-01-21 03:30:48 +01:00
|
|
|
MAINTAINER= lx@FreeBSD.org
|
2003-04-13 15:17:14 +02:00
|
|
|
COMMENT= The Samhain Intrusion Detection System
|
|
|
|
|
2011-10-05 02:17:36 +02:00
|
|
|
LICENSE= GPLv2
|
|
|
|
|
2013-06-05 12:21:04 +02:00
|
|
|
OPTIONS_DEFINE= KCHECK GPG MYSQL PGSQL XML_LOGS LIBWRAP PRELUDE
|
|
|
|
OPTIONS_DEFAULT= XML_LOGS LIBWRAP
|
|
|
|
KCHECK_DESC= Enable rogue KLD detection
|
|
|
|
GPG_DESC= Enable GnuPG support
|
|
|
|
MYSQL_DESC= Enable MySQL logging
|
|
|
|
PGSQL_DESC= Enable PostgreSQL logging
|
|
|
|
XML_LOGS_DESC= Enable XML-formatted logs
|
|
|
|
LIBWRAP_DESC= Enable TCP wrapper support
|
|
|
|
PRELUDE_DESC= Enable Prelude Framework support
|
2004-08-12 01:00:12 +02:00
|
|
|
|
2006-04-09 04:40:09 +02:00
|
|
|
SUB_FILES+= pkg-install
|
|
|
|
|
2005-09-22 00:56:58 +02:00
|
|
|
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
|
|
|
|
|
2006-01-07 08:56:03 +01:00
|
|
|
CONFLICTS= samhain-client-2*
|
|
|
|
|
2013-09-21 00:55:24 +02:00
|
|
|
NO_STAGE= yes
|
2004-08-12 01:00:12 +02:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2008-08-14 03:13:14 +02:00
|
|
|
.if ${ARCH} == "amd64"
|
2009-07-24 04:47:02 +02:00
|
|
|
CFLAGS+= -fPIC
|
2008-08-14 03:13:14 +02:00
|
|
|
.endif
|
|
|
|
|
2010-08-11 23:34:26 +02:00
|
|
|
.if ${OSVERSION} > 800000 && ${ARCH} == "amd64"
|
|
|
|
MANUAL_PACKAGE_BUILD= fails to link on pointyhat
|
|
|
|
.endif
|
|
|
|
|
2010-07-28 19:21:08 +02:00
|
|
|
.if ${OSVERSION} > 900007
|
2012-11-21 21:36:28 +01:00
|
|
|
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-config-h-in
|
2009-07-26 14:16:23 +02:00
|
|
|
.endif
|
|
|
|
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MGPG}
|
2004-08-12 01:00:12 +02:00
|
|
|
BUILD_DEPENDS+= gpg:${PORTSDIR}/security/gnupg
|
2003-04-13 15:17:14 +02:00
|
|
|
.endif
|
|
|
|
|
2003-11-01 15:05:52 +01:00
|
|
|
GNU_CONFIGURE= yes
|
|
|
|
CONFIGURE_ARGS= --enable-login-watch --localstatedir=/var \
|
2007-07-23 11:36:51 +02:00
|
|
|
--enable-suidcheck
|
2003-04-13 15:17:14 +02:00
|
|
|
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MXML_LOGS}
|
2005-08-31 00:04:29 +02:00
|
|
|
CONFIGURE_ARGS+= --enable-xml-log
|
|
|
|
.endif
|
2004-08-12 01:00:12 +02:00
|
|
|
.if defined(WITH_RUNAS_USER)
|
|
|
|
CONFIGURE_ARGS+= --enable-identity=${WITH_RUNAS_USER}
|
2005-08-31 00:04:29 +02:00
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= --enable-identity=yule
|
2003-04-13 15:17:14 +02:00
|
|
|
.endif
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MKCHECK}
|
2003-04-13 15:17:14 +02:00
|
|
|
CONFIGURE_ARGS+= --with-kcheck
|
|
|
|
.endif
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MGPG}
|
2003-04-13 15:17:14 +02:00
|
|
|
CONFIGURE_ARGS+= --with-gpg=${PREFIX}/bin/gpg
|
|
|
|
.endif
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MMYSQL}
|
2003-06-04 11:20:58 +02:00
|
|
|
CONFIGURE_ARGS+= --with-database=mysql \
|
|
|
|
--with-cflags=-I${LOCALBASE}/include/mysql \
|
2005-08-31 00:04:29 +02:00
|
|
|
--with-libs=-L${LOCALBASE}/lib/mysql
|
2003-04-13 15:17:14 +02:00
|
|
|
.endif
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MPGSQL}
|
2005-08-31 00:04:29 +02:00
|
|
|
CONFIGURE_ARGS+= --with-database=postgresql
|
2003-04-13 15:17:14 +02:00
|
|
|
.endif
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MLIBWRAP}
|
2003-11-01 15:05:52 +01:00
|
|
|
CONFIGURE_ARGS+= --with-libwrap
|
|
|
|
.endif
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MCLIENT}
|
2003-11-01 15:05:52 +01:00
|
|
|
CONFIGURE_ARGS+= --enable-network=client \
|
2003-06-04 11:20:58 +02:00
|
|
|
--with-data-file=REQ_FROM_SERVER/var/lib/samhain/data.samhain \
|
2004-04-06 15:01:13 +02:00
|
|
|
--with-config-file=REQ_FROM_SERVER
|
2003-04-13 15:17:14 +02:00
|
|
|
PLIST_SUB+= SAMHAIN="" SETPWD="" YULE="@comment "
|
2003-11-01 15:05:52 +01:00
|
|
|
EXTRA_PATCHES+= ${FILESDIR}/fixsamhainrc.patch
|
2011-03-23 03:01:00 +01:00
|
|
|
MAN5+= samhainrc.5
|
|
|
|
MAN8+= samhain.8
|
2013-06-05 12:21:04 +02:00
|
|
|
.elif ${PORT_OPTIONS:MSERVER}
|
2003-04-13 15:17:14 +02:00
|
|
|
CONFIGURE_ARGS+= --enable-network=server
|
2006-04-09 04:40:09 +02:00
|
|
|
SUB_LIST+= WITH_YULE="yes"
|
2003-04-13 15:17:14 +02:00
|
|
|
PLIST_SUB+= YULE="" SAMHAIN="@comment " SETPWD="@comment "
|
2003-11-01 15:05:52 +01:00
|
|
|
EXTRA_PATCHES+= ${FILESDIR}/fixyulerc.patch
|
2011-03-23 03:01:00 +01:00
|
|
|
MAN5+= yulerc.5
|
|
|
|
MAN8+= yule.8
|
2003-04-13 15:17:14 +02:00
|
|
|
.else
|
2006-04-09 04:40:09 +02:00
|
|
|
SUB_LIST+= WITH_YULE=""
|
2003-04-13 15:17:14 +02:00
|
|
|
PLIST_SUB+= SAMHAIN="" YULE="@comment " SETPWD="@comment "
|
2003-11-01 15:05:52 +01:00
|
|
|
EXTRA_PATCHES+= ${FILESDIR}/fixsamhainrc.patch
|
2011-03-23 03:01:00 +01:00
|
|
|
MAN5+= samhainrc.5
|
|
|
|
MAN8+= samhain.8
|
2003-04-13 15:17:14 +02:00
|
|
|
.endif
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MLOG_SERVER}
|
|
|
|
CONFIGURE_ARGS+= --with-logserver=true
|
2004-04-06 15:01:13 +02:00
|
|
|
.endif
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MALT_LOG_SERVER}
|
|
|
|
CONFIGURE_ARGS+= --with-altlogserver=true
|
2003-06-04 11:20:58 +02:00
|
|
|
.endif
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MPRELUDE}
|
2012-12-16 00:52:36 +01:00
|
|
|
LIB_DEPENDS+= prelude:${PORTSDIR}/security/libprelude
|
2006-03-18 20:17:30 +01:00
|
|
|
CONFIGURE_ARGS+= --with-prelude
|
|
|
|
.endif
|
2003-04-13 15:17:14 +02:00
|
|
|
|
|
|
|
pre-everything::
|
|
|
|
|
2004-08-12 01:00:12 +02:00
|
|
|
.if !defined(WITH_CLIENT) && !defined(WITH_SERVER)
|
2003-06-04 11:20:58 +02:00
|
|
|
@${ECHO_MSG}
|
2006-01-07 08:56:03 +01:00
|
|
|
@${ECHO_MSG} "Building Samhain in standalone mode."
|
2003-04-13 15:17:14 +02:00
|
|
|
@${ECHO_MSG} "If you wish to enable networked mode, please hit CTRL-C"
|
2006-01-07 08:56:03 +01:00
|
|
|
@${ECHO_MSG} "now, and build samhain from the samhain-client and"
|
|
|
|
@${ECHO_MSG} "samhain-server ports."
|
2003-06-04 11:20:58 +02:00
|
|
|
@${ECHO_MSG}
|
|
|
|
.endif
|
|
|
|
|
2004-08-12 01:00:12 +02:00
|
|
|
.if defined(WITH_CLIENT) && defined(WITH_SERVER)
|
2006-01-07 08:56:03 +01:00
|
|
|
IGNORE= can't build client and server at once
|
2003-06-04 11:20:58 +02:00
|
|
|
.endif
|
|
|
|
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MKCHECK}
|
2003-06-04 11:20:58 +02:00
|
|
|
@${ECHO_MSG}
|
2004-10-13 04:04:30 +02:00
|
|
|
@${ECHO_MSG} "Building with kernel checking requires reading /dev/kmem"
|
2004-10-16 13:56:24 +02:00
|
|
|
@${ECHO_MSG} "and /dev/mem. If you're not building as root, please hit"
|
2004-10-13 04:04:30 +02:00
|
|
|
@${ECHO_MSG} "Control-C and restart the build as root."
|
2003-06-04 11:20:58 +02:00
|
|
|
@${ECHO_MSG}
|
2003-04-13 15:17:14 +02:00
|
|
|
.endif
|
|
|
|
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MMYSQL} && ! ${PORT_OPTIONS:MXML_LOGS}
|
2005-09-10 22:32:10 +02:00
|
|
|
IGNORE= XML logging is required to log to MySQL
|
2005-08-31 00:04:29 +02:00
|
|
|
.endif
|
|
|
|
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MPGSQL} && ! ${PORT_OPTIONS:MXML_LOGS}
|
2005-09-10 22:32:10 +02:00
|
|
|
IGNORE= XML logging is required to log to Postgres
|
2005-08-31 00:04:29 +02:00
|
|
|
.endif
|
|
|
|
|
2003-04-13 15:17:14 +02:00
|
|
|
post-extract:
|
|
|
|
@${TAR} -C ${WRKDIR} -xzf ${WRKSRC}.tar.gz
|
|
|
|
@${RM} ${WRKSRC}.tar.gz ${WRKSRC}.tar.gz.asc
|
|
|
|
|
2006-04-09 04:40:09 +02:00
|
|
|
pre-install:
|
|
|
|
@PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
|
|
|
|
2003-04-13 15:17:14 +02:00
|
|
|
post-install:
|
2004-08-12 01:00:12 +02:00
|
|
|
.if !defined(WITH_SERVER)
|
2006-09-06 09:03:14 +02:00
|
|
|
@${CP} ${WRKSRC}/init/samhain.startFreeBSD ${PREFIX}/etc/rc.d/samhain.sh
|
2005-05-05 11:21:28 +02:00
|
|
|
@${CP} ${WRKSRC}/samhainrc ${PREFIX}/etc/samhainrc.sample
|
2005-08-31 00:04:29 +02:00
|
|
|
@${CHGRP} wheel ${PREFIX}/etc/samhainrc.sample
|
2003-04-13 15:17:14 +02:00
|
|
|
.else
|
2006-09-06 09:03:14 +02:00
|
|
|
@${CP} ${WRKSRC}/init/samhain.startFreeBSD ${PREFIX}/etc/rc.d/yule.sh
|
2005-05-05 11:21:28 +02:00
|
|
|
@${CP} ${WRKSRC}/yulerc ${PREFIX}/etc/yulerc.sample
|
2003-04-13 15:17:14 +02:00
|
|
|
.endif
|
2013-06-05 12:21:04 +02:00
|
|
|
.if ${PORT_OPTIONS:MDOCS}
|
2003-11-01 15:05:52 +01:00
|
|
|
${MKDIR} ${DOCSDIR}
|
2006-11-05 11:11:08 +01:00
|
|
|
${INSTALL_MAN} ${WRKSRC}/docs/MANUAL-2_3.pdf ${DOCSDIR}
|
2003-11-01 15:05:52 +01:00
|
|
|
${INSTALL_MAN} ${WRKSRC}/docs/HOWTO-client+server.html ${DOCSDIR}
|
2004-11-02 19:12:13 +01:00
|
|
|
${INSTALL_MAN} ${WRKSRC}/docs/HOWTO-client+server-troubleshooting.html ${DOCSDIR}
|
2003-11-01 15:05:52 +01:00
|
|
|
${INSTALL_MAN} ${WRKSRC}/docs/HOWTO-samhain+GnuPG.html ${DOCSDIR}
|
2004-11-02 19:12:13 +01:00
|
|
|
${INSTALL_MAN} ${WRKSRC}/docs/HOWTO-write-modules.html ${DOCSDIR}
|
|
|
|
${INSTALL_MAN} ${WRKSRC}/docs/FAQ.html ${DOCSDIR}
|
|
|
|
${INSTALL_MAN} ${WRKSRC}/docs/README.UPGRADE ${DOCSDIR}
|
|
|
|
${INSTALL_MAN} ${WRKSRC}/docs/README ${DOCSDIR}
|
|
|
|
${INSTALL_MAN} ${WRKSRC}/docs/BUGS ${DOCSDIR}
|
|
|
|
${INSTALL_MAN} ${WRKSRC}/docs/sh_mounts.txt ${DOCSDIR}
|
|
|
|
${INSTALL_MAN} ${WRKSRC}/docs/sh_userfiles.txt ${DOCSDIR}
|
2003-04-13 15:17:14 +02:00
|
|
|
.endif
|
|
|
|
|
2006-09-06 09:03:14 +02:00
|
|
|
@${CAT} ${PKGMESSAGE}
|
2004-08-12 01:00:12 +02:00
|
|
|
.include <bsd.port.post.mk>
|