1 # Created by: Angel Carpintero <ack@telefonica.net>
8 MASTER_SITES= SF/${PORTNAME}/${PORTNAME}%20-%20${PORTVERSION:R}/${PORTVERSION}
10 MAINTAINER= ports@FreeBSD.org
11 COMMENT= Motion detection application
14 LICENSE_FILE= ${WRKSRC}/COPYING
16 OPTIONS_DEFINE= FFMPEG MYSQL PGSQL DOCS EXAMPLES
18 OPTIONS_SINGLE_VIDEO= BKTR PWCBSD
19 OPTIONS_DEFAULT= BKTR FFMPEG
20 VIDEO_DESC= Video capture driver. Choose one of BKTR or PWCBSD
21 BKTR_DESC= BKTR based TV capture cards
22 PWCBSD_DESC= PWCBSD based Webcams
24 USES= autoreconf gmake jpeg
27 USE_RC_SUBR= ${PORTNAME}
28 SUB_FILES= pkg-message
30 CPPFLAGS+= -I${LOCALBASE}/include
31 LDFLAGS+= -L${LOCALBASE}/lib
33 PORTDOCS= CHANGELOG CREDITS README README.FreeBSD \
35 PORTEXAMPLES= motion-dist.conf thread1.conf thread2.conf \
36 thread3.conf thread4.conf
38 .include <bsd.port.options.mk>
40 .if ${PORT_OPTIONS:MBKTR}
41 CONFIGURE_ARGS+=--with-bktr
43 CONFIGURE_ARGS+=--without-bktr
46 .if ${PORT_OPTIONS:MPWCBSD}
47 # Location /boot/modules is hard coded in the pwc port, so use it here too
48 KMODDIR= /boot/modules
49 BUILD_DEPENDS+= v4l_compat>=1.0.20060801:multimedia/v4l_compat
50 RUN_DEPENDS+= ${KMODDIR}/pwc.ko:multimedia/pwcbsd
51 CONFIGURE_ARGS+=--with-pwcbsd
53 CONFIGURE_ARGS+=--without-pwcbsd
56 CONFIGURE_ARGS+=--without-linuxthreads
58 .if ${PORT_OPTIONS:MFFMPEG}
59 LIB_DEPENDS+= libavformat0.so:multimedia/ffmpeg0
60 CONFIGURE_ARGS+=--with-ffmpeg=${LOCALBASE}
62 CONFIGURE_ARGS+=--without-ffmpeg
65 .if ${PORT_OPTIONS:MMYSQL}
67 CONFIGURE_ARGS+=--with-mysql-lib=${LOCALBASE}/lib/mysql \
68 --with-mysql-include=${LOCALBASE}/include/mysql
70 CONFIGURE_ARGS+=--without-mysql
73 .if ${PORT_OPTIONS:MPGSQL}
75 CONFIGURE_ARGS+=--with-pgsql-lib=${LOCALBASE}/lib \
76 --with-pgsql-include=${LOCALBASE}/include
78 CONFIGURE_ARGS+=--without-pgsql
81 .include <bsd.port.pre.mk>
84 @${REINPLACE_CMD} -e \
85 's|/usr/local|${LOCALBASE}|g' ${WRKSRC}/configure.in
86 # Resolve name collision with jpeg-8
87 @${REINPLACE_CMD} -e \
88 's|jpeg_mem_dest|local_jpeg_mem_dest|' ${WRKSRC}/picture.c
90 @${REINPLACE_CMD} -e \
91 's|/run/motion|/run|' ${WRKSRC}/motion-dist.conf.in
94 ${INSTALL_PROGRAM} ${WRKSRC}/motion ${STAGEDIR}${PREFIX}/bin
95 ${INSTALL_MAN} ${WRKSRC}/motion.1 ${STAGEDIR}${MANPREFIX}/man/man1
96 ${INSTALL_DATA} ${WRKSRC}/motion-dist.conf \
97 ${STAGEDIR}${PREFIX}/etc/motion.conf.sample
98 .if ${PORT_OPTIONS:MDOCS}
99 @${MKDIR} ${STAGEDIR}${DOCSDIR}
100 .for f in ${PORTDOCS}
101 ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}
104 .if ${PORT_OPTIONS:MEXAMPLES}
105 @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
106 .for f in ${PORTEXAMPLES}
107 ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${EXAMPLESDIR}
111 .include <bsd.port.post.mk>