Bump multimedia/motion to version 3.2.12_5
[dports.git] / multimedia / motion / Makefile
1 # Created by: Angel Carpintero <ack@telefonica.net>
2 # $FreeBSD$
3
4 PORTNAME=       motion
5 PORTVERSION=    3.2.12
6 PORTREVISION=   5
7 CATEGORIES=     multimedia
8 MASTER_SITES=   SF/${PORTNAME}/${PORTNAME}%20-%20${PORTVERSION:R}/${PORTVERSION}
9
10 MAINTAINER=     ports@FreeBSD.org
11 COMMENT=        Motion detection application
12
13 LICENSE=        GPLv2
14 LICENSE_FILE=   ${WRKSRC}/COPYING
15
16 OPTIONS_DEFINE= FFMPEG MYSQL PGSQL DOCS EXAMPLES
17 OPTIONS_SINGLE= VIDEO
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
23
24 USES=           autoreconf gmake jpeg
25 GNU_CONFIGURE=  yes
26
27 USE_RC_SUBR=    ${PORTNAME}
28 SUB_FILES=      pkg-message
29
30 CPPFLAGS+=      -I${LOCALBASE}/include
31 LDFLAGS+=       -L${LOCALBASE}/lib
32
33 PORTDOCS=       CHANGELOG CREDITS README README.FreeBSD \
34                 motion_guide.html
35 PORTEXAMPLES=   motion-dist.conf thread1.conf thread2.conf \
36                 thread3.conf thread4.conf
37
38 .include <bsd.port.options.mk>
39
40 .if ${PORT_OPTIONS:MBKTR}
41 CONFIGURE_ARGS+=--with-bktr
42 .else
43 CONFIGURE_ARGS+=--without-bktr
44 .endif
45
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
52 .else
53 CONFIGURE_ARGS+=--without-pwcbsd
54 .endif
55
56 CONFIGURE_ARGS+=--without-linuxthreads
57
58 .if ${PORT_OPTIONS:MFFMPEG}
59 LIB_DEPENDS+=   libavformat0.so:multimedia/ffmpeg0
60 CONFIGURE_ARGS+=--with-ffmpeg=${LOCALBASE}
61 .else
62 CONFIGURE_ARGS+=--without-ffmpeg
63 .endif
64
65 .if ${PORT_OPTIONS:MMYSQL}
66 USE_MYSQL=      yes
67 CONFIGURE_ARGS+=--with-mysql-lib=${LOCALBASE}/lib/mysql \
68                 --with-mysql-include=${LOCALBASE}/include/mysql
69 .else
70 CONFIGURE_ARGS+=--without-mysql
71 .endif
72
73 .if ${PORT_OPTIONS:MPGSQL}
74 USES+=          pgsql
75 CONFIGURE_ARGS+=--with-pgsql-lib=${LOCALBASE}/lib \
76                 --with-pgsql-include=${LOCALBASE}/include
77 .else
78 CONFIGURE_ARGS+=--without-pgsql
79 .endif
80
81 .include <bsd.port.pre.mk>
82
83 post-patch:
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
89 # Fix pidfile path
90         @${REINPLACE_CMD} -e \
91                 's|/run/motion|/run|' ${WRKSRC}/motion-dist.conf.in
92
93 do-install:
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}
102 .endfor
103 .endif
104 .if ${PORT_OPTIONS:MEXAMPLES}
105         @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
106 .for f in ${PORTEXAMPLES}
107         ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${EXAMPLESDIR}
108 .endfor
109 .endif
110
111 .include <bsd.port.post.mk>