You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
1.9 KiB
80 lines
1.9 KiB
5 years ago
|
# Copyright 1999-2019 Gentoo Authors
|
||
9 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
5 years ago
|
EAPI=7
|
||
9 years ago
|
|
||
|
inherit eutils
|
||
|
|
||
|
DESCRIPTION="MJPG-streamer takes JPGs from Linux-UVC compatible webcams"
|
||
8 years ago
|
HOMEPAGE="https://sourceforge.net/projects/mjpg-streamer"
|
||
9 years ago
|
SRC_URI="https://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/${P}.tar.bz2"
|
||
9 years ago
|
|
||
|
LICENSE="GPL-2"
|
||
|
SLOT="0"
|
||
5 years ago
|
KEYWORDS="~amd64 ~x86"
|
||
9 years ago
|
|
||
5 years ago
|
INPUT_PLUGINS="input-testpicture input-control input-file input-uvc"
|
||
|
OUTPUT_PLUGINS="output-file output-udp output-http output-autofocus output-rtsp"
|
||
9 years ago
|
IUSE_PLUGINS="${INPUT_PLUGINS} ${OUTPUT_PLUGINS}"
|
||
5 years ago
|
IUSE="input-testpicture input-control +input-file input-uvc output-file
|
||
|
output-udp +output-http output-autofocus output-rtsp
|
||
|
www"
|
||
9 years ago
|
REQUIRED_USE="|| ( ${INPUT_PLUGINS} )
|
||
5 years ago
|
|| ( ${OUTPUT_PLUGINS} )"
|
||
9 years ago
|
|
||
|
RDEPEND="virtual/jpeg
|
||
5 years ago
|
input-uvc? ( media-libs/libv4l )"
|
||
9 years ago
|
DEPEND="${RDEPEND}
|
||
5 years ago
|
input-testpicture? ( media-gfx/imagemagick )"
|
||
|
|
||
|
PATCHES=(
|
||
|
"${FILESDIR}/make-var-instead-of-cmd.patch"
|
||
|
"${FILESDIR}/to-work-with-kernel-3.18.patch"
|
||
|
)
|
||
9 years ago
|
|
||
|
src_prepare() {
|
||
5 years ago
|
default
|
||
9 years ago
|
|
||
|
local flag switch
|
||
|
|
||
|
for flag in ${IUSE_PLUGINS}; do
|
||
|
use ${flag} && switch='' || switch='#'
|
||
5 years ago
|
flag=${flag/input-/input_}
|
||
|
flag=${flag/output-/output_}
|
||
9 years ago
|
sed -i \
|
||
|
-e "s|^#*PLUGINS +\?= ${flag}.so|${switch}PLUGINS += ${flag}.so|" \
|
||
|
Makefile
|
||
|
done
|
||
|
}
|
||
|
|
||
|
src_compile() {
|
||
5 years ago
|
local v4l=$(use input-uvc && echo 'USE_LIBV4L2=true')
|
||
9 years ago
|
emake ${v4l}
|
||
|
}
|
||
|
|
||
|
src_install() {
|
||
|
into /usr
|
||
|
dobin ${PN//-/_}
|
||
|
dolib.so *.so
|
||
|
|
||
|
if use www ; then
|
||
|
insinto /usr/share/${PN}
|
||
|
doins -r www
|
||
|
fi
|
||
|
|
||
|
dodoc README TODO
|
||
|
|
||
5 years ago
|
sed -e "s|@LIBDIR@|$(get_libdir)|g" "${FILESDIR}/${PN}.initd" | newinitd - ${PN}
|
||
9 years ago
|
newconfd "${FILESDIR}"/${PN}.confd ${PN}
|
||
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
elog "Remember to set an input and output plugin for mjpg-streamer."
|
||
|
|
||
|
if use www ; then
|
||
|
echo
|
||
|
elog "An example webinterface has been installed into"
|
||
|
elog "/usr/share/mjpg-streamer/www for your usage."
|
||
|
fi
|
||
|
}
|