aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/zoneminder/Makefile
blob: b2cca4044c94a875b548fb7ed4c80984492d7bb3 (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# New ports collection makefile for:    multimedia/zoneminder
# Date created:             2011-04-08
# Whom:                 bsam, based on ports by achix (1.23 & local camera stuff),
#                   Richard Lee and Electric Messiah
# $FreeBSD$
#

PORTNAME=   zoneminder
PORTVERSION=    1.24.4
PORTREVISION=   9
CATEGORIES= multimedia
MASTER_SITES=   http://www2.zoneminder.com/downloads/ \
        http://www.zoneminder.com/downloads/
DISTNAME=   ZoneMinder-${PORTVERSION}

MAINTAINER= bsam@FreeBSD.org
COMMENT=    Complete security camera solution, fully web based with image analysis

LICENSE=    GPLv2

RUN_DEPENDS=    ${LOCALBASE}/bin/sudo:${PORTSDIR}/security/sudo
LIB_DEPENDS=    jpeg.11:${PORTSDIR}/graphics/jpeg \
        netpbm.1:${PORTSDIR}/graphics/netpbm \
        pcre.0:${PORTSDIR}/devel/pcre \
        avutil.1:${PORTSDIR}/multimedia/ffmpeg
BUILD_DEPENDS=  ${LOCALBASE}/lib/php/20090626/mysql.so:${PORTSDIR}/databases/php5-mysql \
        ${LOCALBASE}/bin/php-config:${PORTSDIR}/lang/php5-extensions \
        ${SITE_PERL}/${PERL_ARCH}/DBI.pm:${PORTSDIR}/databases/p5-DBI \
        ${SITE_PERL}/${PERL_ARCH}/DBD/mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql${MYSQL_VER} \
        ${SITE_PERL}/Date/Manip.pm:${PORTSDIR}/devel/p5-Date-Manip \
        ${SITE_PERL}/LWP.pm:${PORTSDIR}/www/p5-libwww \
        ${SITE_PERL}/Archive/Zip.pm:${PORTSDIR}/archivers/p5-Archive-Zip \
        ${SITE_PERL}/Archive/Tar.pm:${PORTSDIR}/archivers/p5-Archive-Tar \
        ${SITE_PERL}/MIME/Lite.pm:${PORTSDIR}/mail/p5-MIME-Lite \
        ${SITE_PERL}/MIME/Entity.pm:${PORTSDIR}/mail/p5-MIME-Tools \
        ${LOCALBASE}/include/linux/videodev.h:${PORTSDIR}/multimedia/v4l_compat

GNU_CONFIGURE=  yes
USE_PHP=    json mysql session
USE_PERL5=  yes
USE_MYSQL=  yes
USE_RC_SUBR=    zm

CONFIGURE_ARGS= --with-mysql=${LOCALBASE} \
        --with-webdir=${WWWDIR}/data \
        --with-cgidir=${WWWDIR}/cgi-bin \
        --with-webgroup=${WWWGRP} \
        --with-webuser=${WWWOWN} \
        --enable-crashtrace=no \
        --with-ffmpeg=${LOCALBASE} \
        --enable-mmap=no \
        --with-extralibs=-lpthread

CONFIGURE_ENV=  ZM_DB_HOST=${DB_HOST} \
        ZM_DB_NAME=${DB_NAME} \
        ZM_DB_USER=${DB_USER} \
        ZM_DB_PASS=${DB_PASS} \
        ZM_SSL_LIB="openssl"

DB_HOST?=   localhost
DB_NAME?=   zm
DB_USER?=   zmuser
DB_PASS?=   zmpass

PLIST_SUB=  WWWDIR_REL=${WWWDIR_REL}

MAN3PREFIX?=    ${PREFIX}/lib/perl5/${PERL_VERSION}
MAN3=       ZoneMinder::Trigger::Connection.3 \
        ZoneMinder::Control::Ncs370.3 \
        ZoneMinder::Trigger::Channel::Serial.3 \
        ZoneMinder.3 \
        ZoneMinder::Config.3 \
        ZoneMinder::Control::mjpgStreamer.3 \
        ZoneMinder::Control::PanasonicIP.3 \
        ZoneMinder::Base.3 \
        ZoneMinder::Trigger::Channel::Unix.3 \
        ZoneMinder::Control::AxisV2.3 \
        ZoneMinder::Trigger::Channel.3 \
        ZoneMinder::Memory.3 \
        ZoneMinder::Trigger::Channel::File.3 \
        ZoneMinder::Database.3 \
        ZoneMinder::Control::PelcoD.3 \
        ZoneMinder::Control::Visca.3 \
        ZoneMinder::Trigger::Channel::Inet.3 \
        ZoneMinder::Trigger::Connection::Example.3 \
        ZoneMinder::Trigger::Channel::Spawning.3 \
        ZoneMinder::Control.3 \
        ZoneMinder::General.3 \
        ZoneMinder::Trigger::Channel::Handle.3 \
        ZoneMinder::Debug.3 \
        ZoneMinder::ConfigAdmin.3 \
        ZoneMinder::ConfigData.3

post-configure:
    ${MV} ${WRKSRC}/zm.conf ${WRKSRC}/zm.conf.sample

post-patch:
    ${REINPLACE_CMD} -e 's,/bin:/usr/bin,/bin:/usr/bin:${LOCALBASE}/bin,g' ${WRKSRC}/scripts/*.pl.in
    ${REINPLACE_CMD} -e 's,sudo,${LOCALBASE}/bin/sudo,g' ${WRKSRC}/scripts/zmpkg.pl.in
    ${REINPLACE_CMD} -e 's," == "," = ",g' ${WRKSRC}/configure
    ${REINPLACE_CMD} -e 's,ZM_V4L2,ZM_HAS_V4L2,g' ${WRKSRC}//web/skins/classic/views/monitorprobe.php

pre-build:
    ${CP} ${FILESDIR}/videodev.h ${WRKSRC}/src
    ${CP} ${FILESDIR}/zm_fbsd_camera.cpp ${WRKSRC}/src
    ${TOUCH} ${WRKSRC}/src/zm_fbsd_camera.h

post-install:
    @if [ ! -f ${PREFIX}/etc/zm.conf ]; then \
        ${CP} -p ${PREFIX}/etc/zm.conf.sample ${PREFIX}/etc/zm.conf  ; \
    fi
.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}
    ${INSTALL_MAN} ${WRKSRC}/AUTHORS   ${DOCSDIR}
    ${INSTALL_MAN} ${WRKSRC}/COPYING   ${DOCSDIR}
    ${INSTALL_MAN} ${WRKSRC}/ChangeLog ${DOCSDIR}
    ${INSTALL_MAN} ${WRKSRC}/INSTALL   ${DOCSDIR}
    ${INSTALL_MAN} ${WRKSRC}/NEWS      ${DOCSDIR}
    ${INSTALL_MAN} ${WRKSRC}/README    ${DOCSDIR}
    ${INSTALL_MAN} ${WRKSRC}/TODO      ${DOCSDIR}
    ${INSTALL_MAN} ${FILESDIR}/README.FreeBSD ${DOCSDIR}
.endif
    ${CAT} ${FILESDIR}/README.FreeBSD

.include <bsd.port.pre.mk>

.if ${ARCH}=="i386"
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-scripts_ZoneMinder_lib_ZoneMinder_Memory.pm.in
.endif

.include <bsd.port.post.mk>