source: build-files/ports-overlay/security/ossec-hids-server/Makefile @ 58663b0

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2
Last change on this file since 58663b0 was 58663b0, checked in by Kris Moore <kris@…>, 9 months ago

Fix up next wave of ports

  • Property mode set to 100644
File size: 3.3 KB
Line 
1# Created by: Valerio Daelli <valerio.daelli@gmail.com>
2# $FreeBSD: security/ossec-hids-server/Makefile 327769 2013-09-20 22:55:24Z bapt $
3
4PORTNAME=       ossec-hids
5PORTVERSION=    2.7
6PORTREVISION?=  0
7CATEGORIES=     security
8MASTER_SITES=   http://www.ossec.net/files/ \
9                http://www.ossec.net/files/old/
10PKGNAMESUFFIX=  -server
11
12MAINTAINER=     glarkin@FreeBSD.org
13COMMENT?=       A security tool to monitor and check logs and intrusions
14
15USE_GCC=        yes
16CC=gcc46
17CXX=g++46
18CPP=cpp46
19USE_RC_SUBR=    ossec-hids
20
21.if defined(MAINTAINER_MODE)
22UID_FILES+=     ../../UIDs
23GID_FILES+=     ../../GIDs
24.endif
25USERS=          ossec ossecm ossecr
26GROUPS=         ossec
27
28.if !defined(CLIENT_ONLY)
29OPTIONS_DEFINE= MYSQL PGSQL
30.endif
31OPTIONS_DEFINE+=        DOCS
32
33SUB_LIST=       PORTNAME=${PORTNAME}
34SUB_FILES=      pkg-message
35PLIST_SUB=      PORTNAME=${PORTNAME}
36PORTDOCS=       BUGS CONFIG CONTRIBUTORS INSTALL LICENSE README
37
38NO_STAGE=       yes
39.include <bsd.port.pre.mk>
40.if ${OSVERSION} < 800067
41# Add string function that didn't exist until 8.x
42EXTRA_PATCHES+= ${FILESDIR}/extra-patch-src__os_csyslogd__csyslogd.c
43.endif
44
45.if !defined(CLIENT_ONLY)
46.if ${PORT_OPTIONS:MMYSQL}
47WITH_DB=        yes
48USE_MYSQL=      client
49.endif
50
51.if ${PORT_OPTIONS:MPGSQL}
52WITH_DB=        yes
53USE_PGSQL=      yes
54.endif
55.endif
56
57.if defined(CLIENT_ONLY)
58SUB_LIST+=      PRECMD=:
59PKGNAMESUFFIX=  -client
60CONFLICTS=      ossec-hids-server-[0-9]* ossec-hids-local-[0-9]*
61.elif defined(LOCAL_ONLY)
62SUB_LIST+=      PRECMD=ossechids_start_precmd
63PKGNAMESUFFIX=  -local
64CONFLICTS=      ossec-hids-client-[0-9]* ossec-hids-server-[0-9]*
65.else
66SUB_LIST+=      PRECMD=ossechids_start_precmd
67CONFLICTS=      ossec-hids-client-[0-9]* ossec-hids-local-[0-9]*
68.endif
69
70post-patch:
71        @${REINPLACE_CMD} 's|PREFIX|${PREFIX}/${PORTNAME}|' ${WRKSRC}/src/LOCATION
72        @${REINPLACE_CMD} 's|PREFIX|${PREFIX}/${PORTNAME}|' ${WRKSRC}/src/headers/defs.h
73
74do-build:
75.if defined(WITH_DB)
76.if defined(CLIENT_ONLY)
77        @cd ${WRKSRC}/src;${MAKE} setagent;${MAKE} all;${MAKE} build
78.elif defined(LOCAL_ONLY)
79        @cd ${WRKSRC}/src;${MAKE} setlocal;${MAKE} all;${MAKE} build
80.else
81        @cd ${WRKSRC}/src;${MAKE} setdb;${MAKE} all;${MAKE} build
82.endif
83.else
84.if defined(CLIENT_ONLY)
85        @cd ${WRKSRC}/src;${MAKE} setagent;${MAKE} all;${MAKE} build; \
86                ${MAKE} unsetdb
87.elif defined(LOCAL_ONLY)
88        @cd ${WRKSRC}/src;${MAKE} setlocal;${MAKE} all;${MAKE} build; \
89                ${MAKE} unsetdb
90.else
91        @cd ${WRKSRC}/src;${MAKE} all;${MAKE} build;${MAKE} unsetdb
92.endif
93.endif
94
95do-install:
96.if defined(CLIENT_ONLY)
97        @cd ${WRKSRC}/src; ${MAKE} agent
98.elif defined(LOCAL_ONLY)
99        @cd ${WRKSRC}/src; ${MAKE} local
100.else
101        @cd ${WRKSRC}/src; ${MAKE} server
102.endif
103
104post-install:
105        @${MKDIR} ${PREFIX}/${PORTNAME}/etc
106
107.if defined(CLIENT_ONLY)
108        @${CP} ${WRKSRC}/etc/ossec-agent.conf ${PREFIX}/${PORTNAME}/etc/ossec.conf.sample
109        @if [ ! -f ${PREFIX}/${PORTNAME}/etc/ossec.conf ]; then \
110        ${CP} ${WRKSRC}/etc/ossec-agent.conf ${PREFIX}/${PORTNAME}/etc/ossec.conf; \
111        fi
112.elif defined(LOCAL_ONLY)
113        ${CP} ${WRKSRC}/etc/ossec-local.conf ${PREFIX}/${PORTNAME}/etc/ossec.conf.sample
114        @if [ ! -f ${PREFIX}/${PORTNAME}/etc/ossec.conf ]; then \
115        ${CP} ${WRKSRC}/etc/ossec-local.conf ${PREFIX}/${PORTNAME}/etc/ossec.conf; \
116        fi
117.else
118        @if [ ! -f ${PREFIX}/${PORTNAME}/etc/ossec.conf ]; then \
119        ${CP} ${WRKSRC}/etc/ossec-server.conf ${PREFIX}/${PORTNAME}/etc/ossec.conf; \
120        fi
121.endif
122
123.if ${PORT_OPTIONS:MDOCS}
124        @${MKDIR} ${DOCSDIR}
125        @cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
126.endif
127
128        @${CAT} ${PKGMESSAGE}
129
130.include <bsd.port.post.mk>
Note: See TracBrowser for help on using the repository browser.