aboutsummaryrefslogtreecommitdiffstats
path: root/security/sguil-server/Makefile
blob: cd45efc805c73c073e918bc0a8683411e0744b8c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# New ports collection makefile for:    sguil-server
# Date created:             9 Oct 2006
# Whom:                 Paul Schmehl <pauls@utdallas.edu>
#
# $FreeBSD$
#

PORTNAME=   sguil-server
PORTVERSION=    0.6.1
CATEGORIES= security
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= sguil

MAINTAINER= pauls@utdallas.edu
COMMENT=    Squil is a network security monitoring program

RUN_DEPENDS=    p0f:${PORTSDIR}/net-mgmt/p0f \
        tcpflow:${PORTSDIR}/net/tcpflow \
        dtplite:${PORTSDIR}/devel/tcllib \
        barnyard:${PORTSDIR}/security/barnyard-sguil6 \
        ${LOCALBASE}/lib/tclx8.4/tclx.tcl:${PORTSDIR}/lang/tclX
LIB_DEPENDS=    tls:${PORTSDIR}/devel/tcltls

NO_BUILD=   yes
USE_RC_SUBR=    sguild.sh
TCLSH_CMD?= ${PREFIX}/bin/tclsh8.4
SGUILDIR?=  sguil-server
WRKSRC=     ${WRKDIR}/sguil-${PORTVERSION}
PATCH_WRKSRC=   ${WRKSRC}/server
PLIST_SUB=  SGUILDIR=${SGUILDIR}
SUB_FILES=  pkg-message
SUB_LIST=   SGUILDIR=${SGUILDIR} TCLSH=${TCLSH_CMD}
LIBRARIES=  SguildAccess.tcl SguildEvent.tcl SguildReportBuilder.tcl \
        SguildAutoCat.tcl SguildGenericDB.tcl SguildSendComms.tcl \
        SguildClientCmdRcvd.tcl SguildHealthChecks.tcl SguildSensorAgentComms.tcl \
        SguildConnect.tcl SguildLoaderd.tcl SguildSensorCmdRcvd.tcl \
        SguildCreateDB.tcl SguildMysqlMerge.tcl SguildTranscript.tcl \
        SguildEmailEvent.tcl SguildQueryd.tcl SguildUtils.tcl
SCRIPTS=    create_ruledb.sql update_sguildb_v10-v11.sql update_sguildb_v8-v9.sql \
        create_sguildb.sql update_sguildb_v5-v6.sql update_sguildb_v9-v10.sql \
        migrate_event.tcl update_sguildb_v6-v7.sql migrate_sancp.tcl update_sguildb_v7-v8.sql
CONFS=      autocat.conf sguild.access sguild.conf sguild.email sguild.queries sguild.reports sguild.users

PORTDOCS=   CHANGES INSTALL INSTALL.openbsd LICENSE.QPL \
        OPENSSL.README TODO USAGE sguildb.dia

.include <bsd.port.pre.mk>

MYSQLTCL_VER!=  cd ${PORTSDIR}/databases/mysqltcl && ${MAKE} -V PORTVERSION

RUN_DEPENDS+=   ${LOCALBASE}/lib/mysqltcl-${MYSQLTCL_VER}:${PORTSDIR}/databases/mysqltcl

post-patch:
.for f in archive_sguildb.tcl sguild contrib/incident_report.tcl
    @${REINPLACE_CMD} -e 's:exec tclsh:exec ${TCLSH_CMD}:g' ${WRKSRC}/server/${f}
.endfor

do-install:
    @${MKDIR} ${PREFIX}/etc/${SGUILDIR}
    @${MKDIR} ${PREFIX}/lib/${SGUILDIR}
    @${MKDIR} ${PREFIX}/share/${SGUILDIR}
.for f in archive_sguildb.tcl sguild
    ${INSTALL_SCRIPT} -m 751 ${WRKSRC}/server/${f} ${PREFIX}/bin/${f}
.endfor
.for f in incident_report.tcl
    ${INSTALL_SCRIPT} -m 751 ${WRKSRC}/server/contrib/${f} ${PREFIX}/bin/${f}
.endfor
.for f in ${CONFS}
    ${INSTALL_DATA} ${WRKSRC}/server/${f} ${PREFIX}/etc/${SGUILDIR}/${f}-sample
.endfor
.for f in ${LIBRARIES}
    ${INSTALL_DATA} ${WRKSRC}/server/lib/${f} ${PREFIX}/lib/${SGUILDIR}/${f}
.endfor
.for f in ${SCRIPTS}
    ${INSTALL_DATA} ${WRKSRC}/server/sql_scripts/${f} ${PREFIX}/share/${SGUILDIR}/${f}
.endfor
post-install:
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
    cd ${WRKSRC}/doc && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>