aboutsummaryrefslogtreecommitdiff
path: root/multimedia/zoneminder/Makefile
blob: 20f651b454160ca27aa137003d4c3e6bb1e8fe3d (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
132
133
134
135
136
137
138
139
140
141
# Created by: bsam, based on ports by achix (1.23 & local camera stuff),
# $FreeBSD$

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

MAINTAINER=	pakhom706@gmail.com
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.3:${PORTSDIR}/devel/pcre \
		libavutil0.so:${PORTSDIR}/multimedia/ffmpeg0
BUILD_DEPENDS=	${LOCALBASE}/bin/php-config:${PORTSDIR}/lang/php5-extensions \
		p5-DBI>=0:${PORTSDIR}/databases/p5-DBI \
		p5-DBD-mysql>=0:${PORTSDIR}/databases/p5-DBD-mysql \
		p5-Date-Manip>=0:${PORTSDIR}/devel/p5-Date-Manip \
		p5-libwww>=0:${PORTSDIR}/www/p5-libwww \
		p5-Archive-Zip>=0:${PORTSDIR}/archivers/p5-Archive-Zip \
		p5-Archive-Tar>=0:${PORTSDIR}/archivers/p5-Archive-Tar \
		p5-MIME-Lite>=0:${PORTSDIR}/mail/p5-MIME-Lite \
		p5-MIME-Tools>=0:${PORTSDIR}/mail/p5-MIME-Tools \
		${LOCALBASE}/include/linux/videodev.h:${PORTSDIR}/multimedia/v4l_compat

USES=		perl5
GNU_CONFIGURE=	yes
USE_PHP=	json mysql session
USE_MYSQL=	yes
USE_RC_SUBR=	zoneminder

CFLAGS+=	-I${LOCALBASE}/include/ffmpeg0 -I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib/ffmpeg0
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

PORTDOCS=	AUTHORS \
		COPYING \
		ChangeLog \
		INSTALL \
		NEWS \
		README \
		README.FreeBSD \
		TODO

MAN3PREFIX?=	${PREFIX}/lib/perl5/${PERL_VER}
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::ConfigAdmin.3 \
		ZoneMinder::ConfigData.3 \
		ZoneMinder::Logger.3

NO_STAGE=	yes
.include <bsd.port.pre.mk>

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

.if ${OSVERSION} < 900000
BROKEN=	does not compile on 7.X and 8.X
.endif

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' \
		-e 's,lavcodec,lavcodec0,g' \
		-e 's,lavformat,lavformat0,g' \
		-e 's,lavutil,lavutil0,g' \
		-e 's,lavdevice,lavdevice0,g' \
		-e 's,lswscale,lswscale0,g' \
		-e 's,^FFMPEG_CFLAGS=.*,,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
	${CP} ${FILESDIR}/README.FreeBSD ${WRKSRC}

post-install:
.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
.for i in ${PORTDOCS}
	${INSTALL_DATA} ${WRKSRC}/$i ${DOCSDIR}
.endfor
.endif
	${CAT} ${FILESDIR}/README.FreeBSD

.include <bsd.port.post.mk>