From adeb18dda6d4aef5dbd52ff4547267baa8a514ed Mon Sep 17 00:00:00 2001 From: Amadeusz Piotr Żołnowski Date: Thu, 17 Nov 2011 20:00:39 +0000 Subject: media-video/mjpg-streamer: Initial ebuild. Fixes bug #260969. Proxy commit on behalf of Andrzej Pauli . (Portage version: 2.1.10.34/cvs/Linux x86_64) --- .../0_pre20110522-make-var-instead-of-cmd.patch | 118 +++++++++++++++++++++ .../mjpg-streamer/files/mjpg-streamer.confd | 21 ++++ .../mjpg-streamer/files/mjpg-streamer.initd | 48 +++++++++ 3 files changed, 187 insertions(+) create mode 100644 media-video/mjpg-streamer/files/0_pre20110522-make-var-instead-of-cmd.patch create mode 100644 media-video/mjpg-streamer/files/mjpg-streamer.confd create mode 100644 media-video/mjpg-streamer/files/mjpg-streamer.initd (limited to 'media-video/mjpg-streamer/files') diff --git a/media-video/mjpg-streamer/files/0_pre20110522-make-var-instead-of-cmd.patch b/media-video/mjpg-streamer/files/0_pre20110522-make-var-instead-of-cmd.patch new file mode 100644 index 000000000000..98d89c555e04 --- /dev/null +++ b/media-video/mjpg-streamer/files/0_pre20110522-make-var-instead-of-cmd.patch @@ -0,0 +1,118 @@ +Index: Makefile +=================================================================== +--- Makefile (revision 150) ++++ Makefile (working copy) +@@ -63,64 +63,64 @@ + chmod 755 $(APP_BINARY) + + output_autofocus.so: mjpg_streamer.h utils.h +- make -C plugins/output_autofocus all ++ $(MAKE) -C plugins/output_autofocus all + cp plugins/output_autofocus/output_autofocus.so . + + input_testpicture.so: mjpg_streamer.h utils.h +- make -C plugins/input_testpicture all ++ $(MAKE) -C plugins/input_testpicture all + cp plugins/input_testpicture/input_testpicture.so . + + + ifeq ($(USE_LIBV4L2),true) + input_uvc.so: mjpg_streamer.h utils.h +- make -C plugins/input_uvc USE_LIBV4L2=true all ++ $(MAKE) -C plugins/input_uvc USE_LIBV4L2=true all + cp plugins/input_uvc/input_uvc.so . + else + input_uvc.so: mjpg_streamer.h utils.h +- make -C plugins/input_uvc all ++ $(MAKE) -C plugins/input_uvc all + cp plugins/input_uvc/input_uvc.so . + endif + + input_control.so: mjpg_streamer.h utils.h +- make -C plugins/input_control all ++ $(MAKE) -C plugins/input_control all + cp plugins/input_control/input_control.so . + + output_file.so: mjpg_streamer.h utils.h +- make -C plugins/output_file all ++ $(MAKE) -C plugins/output_file all + cp plugins/output_file/output_file.so . + + ifeq ($(WXP_COMPAT),true) + output_http.so: mjpg_streamer.h utils.h +- make -C plugins/output_http -DWXP_COMPAT all ++ $(MAKE) -C plugins/output_http -DWXP_COMPAT all + cp plugins/output_http/output_http.so . + else + output_http.so: mjpg_streamer.h utils.h +- make -C plugins/output_http all ++ $(MAKE) -C plugins/output_http all + cp plugins/output_http/output_http.so . + endif + + output_udp.so: mjpg_streamer.h utils.h +- make -C plugins/output_udp all ++ $(MAKE) -C plugins/output_udp all + cp plugins/output_udp/output_udp.so . + + input_gspcav1.so: mjpg_streamer.h utils.h +- make -C plugins/input_gspcav1 all ++ $(MAKE) -C plugins/input_gspcav1 all + cp plugins/input_gspcav1/input_gspcav1.so . + + input_file.so: mjpg_streamer.h utils.h +- make -C plugins/input_file all ++ $(MAKE) -C plugins/input_file all + cp plugins/input_file/input_file.so . + + output_rtsp.so: mjpg_streamer.h utils.h +- make -C plugins/output_rtsp all ++ $(MAKE) -C plugins/output_rtsp all + cp plugins/output_rtsp/output_rtsp.so . + + output_ptp2.so: mjpg_streamer.h utils.h +- make -C plugins/input_ptp2 all ++ $(MAKE) -C plugins/input_ptp2 all + cp plugins/input_ptp2/input_ptp2.so . + + #input_http.so: mjpg_streamer.h utils.h +-# make -C plugins/input_http all ++# $(MAKE) -C plugins/input_http all + # cp plugins/input_http/input_http.so . + + # The viewer plugin requires the SDL library for compilation +@@ -129,22 +129,22 @@ + # execute the following command: + # make output_viewer.so + output_viewer.so: mjpg_streamer.h utils.h +- make -C plugins/output_viewer all ++ $(MAKE) -C plugins/output_viewer all + cp plugins/output_viewer/output_viewer.so . + + # cleanup + clean: +- make -C plugins/input_uvc $@ +- make -C plugins/input_testpicture $@ +- make -C plugins/output_file $@ +- make -C plugins/output_http $@ +- make -C plugins/output_udp $@ +- make -C plugins/output_autofocus $@ +- make -C plugins/input_gspcav1 $@ +- make -C plugins/output_viewer $@ +- make -C plugins/input_control $@ +- make -C plugins/output_rtsp $@ +-# make -C plugins/input_http $@ ++ $(MAKE) -C plugins/input_uvc $@ ++ $(MAKE) -C plugins/input_testpicture $@ ++ $(MAKE) -C plugins/output_file $@ ++ $(MAKE) -C plugins/output_http $@ ++ $(MAKE) -C plugins/output_udp $@ ++ $(MAKE) -C plugins/output_autofocus $@ ++ $(MAKE) -C plugins/input_gspcav1 $@ ++ $(MAKE) -C plugins/output_viewer $@ ++ $(MAKE) -C plugins/input_control $@ ++ $(MAKE) -C plugins/output_rtsp $@ ++# $(MAKE) -C plugins/input_http $@ + rm -f *.a *.o $(APP_BINARY) core *~ *.so *.lo + + # useful to make a backup "make tgz" diff --git a/media-video/mjpg-streamer/files/mjpg-streamer.confd b/media-video/mjpg-streamer/files/mjpg-streamer.confd new file mode 100644 index 000000000000..07a81b04dcee --- /dev/null +++ b/media-video/mjpg-streamer/files/mjpg-streamer.confd @@ -0,0 +1,21 @@ +# The input plugins and options: +# uvc +# testpicture +# file +#ex. INPUT_PLUGIN="uvc" +INPUT_PLUGIN="" +INPUT_PLUGIN_OPTS="" + +# The output plugins and options: +# autofocus +# file +# http +# udp +# rtsp +#ex. OUTPUT_PLUGIN="http" +OUTPUT_PLUGIN="" +OUTPUT_PLUGIN_OPTS="" + +# Deamon runing as user/group +MJPG_STREAMER_USER="nobody" +MJPG_STREAMER_GROUP="video" diff --git a/media-video/mjpg-streamer/files/mjpg-streamer.initd b/media-video/mjpg-streamer/files/mjpg-streamer.initd new file mode 100644 index 000000000000..776c203b4f94 --- /dev/null +++ b/media-video/mjpg-streamer/files/mjpg-streamer.initd @@ -0,0 +1,48 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-video/mjpg-streamer/files/mjpg-streamer.initd,v 1.1 2011/11/17 20:00:39 aidecoe Exp $ + +MJPG_STREAMER_PIDFILE="${MJPG_STREAMER_PIDFILE:-/var/run/${SVCNAME}.pid}" +MY_NAME=${SVCNAME//-/_} + +depend() { + use logger +} + +checkconfig() { + local vars + + [[ ${INPUT_PLUGIN} ]] || vars+=\ INPUT_PLUGIN + [[ ${OUTPUT_PLUGIN} ]] || vars+=\ OUTPUT_PLUGIN + [[ ${MJPG_STREAMER_USER} ]] || vars+=\ MJPG_STREAMER_USER + [[ ${MJPG_STREAMER_GROUP} ]] || vars+=\ MJPG_STREAMER_GROUP + vars="${vars# }" + + if [[ ${vars} ]]; then + eerror "Required variables in /etc/conf.d/${SVCNAME} are not set:" + eerror " ${vars// /, }" + return 1 + fi + + return 0 +} + +start() { + checkconfig || return $? + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --exec /usr/bin/${MY_NAME} \ + --user "${MJPG_STREAMER_USER}" \ + --group "${MJPG_STREAMER_GROUP}" -w 100 -b -m \ + --pidfile "${MJPG_STREAMER_PIDFILE}" \ + -- -i "/usr/lib/input_${INPUT_PLUGIN}.so ${INPUT_PLUGIN_OPTS}" \ + -o "/usr/lib/output_${OUTPUT_PLUGIN}.so ${OUTPUT_PLUGIN_OPTS}" + eend $? "Check syslog to see why startup failed." +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --exec /usr/bin/${MY_NAME} \ + --pidfile "${MJPG_STREAMER_PIDFILE}" + eend $? +} -- cgit v1.2.3-65-gdbad