dev-python/mpmath: Bump to 1.4.0_alpha4
[gentoo/gentoo.git] / media-video / mjpg-streamer / mjpg-streamer-0_pre20120621-r2.ebuild
blobab0b5bde573c6f6af2accee920b650913ad48159
1 # Copyright 1999-2021 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=7
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"
10 LICENSE="GPL-2"
11 SLOT="0"
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
19         www"
20 REQUIRED_USE="|| ( ${INPUT_PLUGINS} )
21         || ( ${OUTPUT_PLUGINS} )"
23 RDEPEND="virtual/jpeg
24         input-uvc? ( media-libs/libv4l )"
25 DEPEND="${RDEPEND}
26         input-testpicture? ( media-gfx/imagemagick )"
28 PATCHES=(
29         "${FILESDIR}/make-var-instead-of-cmd.patch"
30         "${FILESDIR}/to-work-with-kernel-3.18.patch"
33 src_prepare() {
34         default
36         local flag switch
38         for flag in ${IUSE_PLUGINS}; do
39                 use ${flag} && switch='' || switch='#'
40                 flag=${flag/input-/input_}
41                 flag=${flag/output-/output_}
42                 sed -i \
43                         -e "s|^#*PLUGINS +\?= ${flag}.so|${switch}PLUGINS += ${flag}.so|" \
44                         Makefile
45         done
48 src_compile() {
49         local v4l=$(use input-uvc && echo 'USE_LIBV4L2=true')
50         emake ${v4l}
53 src_install() {
54         into /usr
55         dobin ${PN//-/_}
56         dolib.so *.so
58         if use www ; then
59                 insinto /usr/share/${PN}
60                 doins -r www
61         fi
63         dodoc README TODO
65         sed -e "s|@LIBDIR@|$(get_libdir)|g" "${FILESDIR}/${PN}.initd" | newinitd - ${PN}
66         newconfd "${FILESDIR}"/${PN}.confd ${PN}
69 pkg_postinst() {
70         elog "Remember to set an input and output plugin for mjpg-streamer."
72         if use www ; then
73                 echo
74                 elog "An example webinterface has been installed into"
75                 elog "/usr/share/mjpg-streamer/www for your usage."
76         fi