1 # Copyright 1999-2021 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 DESCRIPTION="MJPG-streamer takes JPGs from Linux-UVC compatible webcams"
7 HOMEPAGE="https://sourceforge.net/projects/mjpg-streamer"
8 SRC_URI="https://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/${P}.tar.bz2"
12 KEYWORDS="~amd64 ~x86"
14 INPUT_PLUGINS="input-testpicture input-control input-file input-uvc"
15 OUTPUT_PLUGINS="output-file output-udp output-http output-autofocus output-rtsp"
16 IUSE_PLUGINS="${INPUT_PLUGINS} ${OUTPUT_PLUGINS}"
17 IUSE="input-testpicture input-control +input-file input-uvc output-file
18 output-udp +output-http output-autofocus output-rtsp
20 REQUIRED_USE="|| ( ${INPUT_PLUGINS} )
21 || ( ${OUTPUT_PLUGINS} )"
24 input-uvc? ( media-libs/libv4l )"
26 input-testpicture? ( media-gfx/imagemagick )"
29 "${FILESDIR}/make-var-instead-of-cmd.patch"
30 "${FILESDIR}/to-work-with-kernel-3.18.patch"
38 for flag in ${IUSE_PLUGINS}; do
39 use ${flag} && switch='' || switch='#'
40 flag=${flag/input-/input_}
41 flag=${flag/output-/output_}
43 -e "s|^#*PLUGINS +\?= ${flag}.so|${switch}PLUGINS += ${flag}.so|" \
49 local v4l=$(use input-uvc && echo 'USE_LIBV4L2=true')
59 insinto /usr/share/${PN}
65 sed -e "s|@LIBDIR@|$(get_libdir)|g" "${FILESDIR}/${PN}.initd" | newinitd - ${PN}
66 newconfd "${FILESDIR}"/${PN}.confd ${PN}
70 elog "Remember to set an input and output plugin for mjpg-streamer."
74 elog "An example webinterface has been installed into"
75 elog "/usr/share/mjpg-streamer/www for your usage."