summaryrefslogtreecommitdiffstats
path: root/multimedia/webcamd/Makefile
blob: 0f6053bd40cc1d59209c7aa54956f5f0547d3d91 (plain)
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
# Created by: Andrew Thompson <thompsa@FreeBSD.org>
# $FreeBSD$

PORTNAME=	webcamd
PORTVERSION=	3.16.0.1
CATEGORIES=	multimedia
MASTER_SITES=	http://www.selasky.org/hans_petter/distfiles/ \
		http://home.selasky.org:8192/distfiles/

MAINTAINER=	hselasky@FreeBSD.org
COMMENT=	A port of Linux USB webcam and DVB drivers into userspace

BUILD_DEPENDS=	v4l_compat>=1.0.20100321:${PORTSDIR}/multimedia/v4l_compat \
		cuse4bsd-kmod>=0.1.31:${PORTSDIR}/multimedia/cuse4bsd-kmod
LIB_DEPENDS=	libv4l1.so:${PORTSDIR}/multimedia/libv4l \
		libcuse4bsd.so:${PORTSDIR}/multimedia/cuse4bsd-kmod

LICENSE=	GPLv2

USES=		pkgconfig tar:bzip2 uidfix
USE_RC_SUBR=	webcamd
USE_LDCONFIG=	yes

LIBDIR=		${PREFIX}/lib

OPTIONS_DEFINE=	DEBUG HAL VT_CLIENT VT_SERVER DVB INPUT RADIO WEBCAM
OPTIONS_DEFAULT=DVB HAL INPUT RADIO WEBCAM
HAL_DESC=	Build with HAL and DBUS support
DEBUG_DESC=	Build with debugging support
VT_CLIENT_DESC=	Build with vTuner client support
VT_SERVER_DESC=	Build with vTuner server support

DVB_DESC=	Build with USB DVB support (DVB-X, analog TV, ...)
INPUT_DESC=	Build with USB input support (tablet, joystick, IR, ...)
RADIO_DESC=	Build with USB radio support
WEBCAM_DESC=	Build with USB webcam support (UVC, gspca, ...)

USERS=		webcamd
GROUPS=		webcamd

.include <bsd.port.pre.mk>

LIBCUSE=${LIBDIR}/libcuse4bsd.so

MAKE_ARGS+=" HAVE_MAN=YES"
MAKE_ARGS+=" PTHREAD_LIBS=${PTHREAD_LIBS}"

.if ${PORT_OPTIONS:MDVB}
MAKE_ARGS+=" HAVE_DVB_DRV=YES"
.endif

.if ${PORT_OPTIONS:MINPUT}
MAKE_ARGS+=" HAVE_INPUT_DRV=YES"
.endif

.if ${PORT_OPTIONS:MRADIO}
MAKE_ARGS+=" HAVE_RADIO_DRV=YES"
.endif

.if ${PORT_OPTIONS:MWEBCAM}
MAKE_ARGS+=" HAVE_WEBCAM_DRV=YES"
.endif

.if ${PORT_OPTIONS:MHAL}
MAKE_ARGS+=" HAVE_HAL=YES"
LIBHAL=${LIBDIR}/libhal.so:${LIBDIR}/libdbus-1.so:
LIB_DEPENDS+=libhal.so:${PORTSDIR}/sysutils/hal
LIB_DEPENDS+=libdbus-1.so:${PORTSDIR}/devel/dbus
.else
LIBHAL=
.endif

.if ${PORT_OPTIONS:MVT_CLIENT}
MAKE_ARGS+=" HAVE_VTUNER_CLIENT=YES"
.endif

.if ${PORT_OPTIONS:MVT_SERVER}
MAKE_ARGS+=" HAVE_VTUNER_SERVER=YES"
.endif

.if ${PORT_OPTIONS:MDEBUG}
MAKE_ARGS+=" HAVE_DEBUG=YES"
.endif

.if ${OSVERSION} < 800000
IGNORE=		requires FreeBSD 8.0-RELEASE or later
.endif

#
# This step is optional
#
do-configure:
	${MAKE} -C${WRKSRC}/tools/linux_make
	${MAKE} ${MAKE_ARGS} configure -C${WRKSRC}

post-patch:
	@cd ${WRKSRC}/patches; ${SH} ./do_patch.sh

post-install:
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/devd
	@${SED} -e "s|%%PREFIX%%|${PREFIX}|g" \
		-e "s|%%LIBHAL%%|${LIBHAL}|g" \
		-e "s|%%LIBCUSE%%|${LIBCUSE}|g" \
		< ${FILESDIR}/webcamd.conf.in > ${WRKDIR}/webcamd.conf
	${INSTALL_DATA} "${WRKDIR}/webcamd.conf" ${STAGEDIR}${PREFIX}/etc/devd

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud