Use https by default
[gentoo.git] / media-video / mjpg-streamer / mjpg-streamer-0_pre20120421.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=4
6
7 inherit eutils
8
9 DESCRIPTION="MJPG-streamer takes JPGs from Linux-UVC compatible webcams"
10 HOMEPAGE="http://sourceforge.net/projects/mjpg-streamer"
11 SRC_URI="https://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/${P}.tar.bz2"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~x86 ~amd64"
16
17 INPUT_PLUGINS="input_testpicture input_control input_file input_uvc"
18 OUTPUT_PLUGINS="output_file output_udp output_http output_autofocus output_rtsp"
19 IUSE_PLUGINS="${INPUT_PLUGINS} ${OUTPUT_PLUGINS} +input_file +output_http"
20 IUSE="${IUSE_PLUGINS} www v4l"
21 REQUIRED_USE="|| ( ${INPUT_PLUGINS} )
22         || ( ${OUTPUT_PLUGINS} )
23         v4l? ( input_uvc )"
24
25 RDEPEND="virtual/jpeg
26         v4l? ( input_uvc? ( media-libs/libv4l ) )"
27 DEPEND="${RDEPEND}
28         input_testpicture? ( media-gfx/imagemagick )"
29
30 src_prepare() {
31         epatch "${FILESDIR}/${PV}-make-var-instead-of-cmd.patch"
32
33         local flag switch
34
35         for flag in ${IUSE_PLUGINS}; do
36                 use ${flag} && switch='' || switch='#'
37                 sed -i \
38                         -e "s|^#*PLUGINS +\?= ${flag}.so|${switch}PLUGINS += ${flag}.so|" \
39                         Makefile
40         done
41 }
42
43 src_compile() {
44         local v4l=$(use v4l && use input_uvc && echo 'USE_LIBV4L2=true')
45         emake ${v4l}
46 }
47
48 src_install() {
49         into /usr
50         dobin ${PN//-/_}
51         dolib.so *.so
52
53         if use www ; then
54                 insinto /usr/share/${PN}
55                 doins -r www
56         fi
57
58         dodoc README TODO
59
60         newinitd "${FILESDIR}"/${PN}.initd ${PN}
61         newconfd "${FILESDIR}"/${PN}.confd ${PN}
62 }
63
64 pkg_postinst() {
65         elog "Remember to set an input and output plugin for mjpg-streamer."
66
67         if use www ; then
68                 echo
69                 elog "An example webinterface has been installed into"
70                 elog "/usr/share/mjpg-streamer/www for your usage."
71         fi
72 }