From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D4F45139085 for ; Mon, 16 Jan 2017 11:49:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 16CCB21C075; Mon, 16 Jan 2017 11:49:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D6BCB21C06B for ; Mon, 16 Jan 2017 11:49:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 78AFC341016 for ; Mon, 16 Jan 2017 11:49:57 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8A021286F for ; Mon, 16 Jan 2017 11:49:55 +0000 (UTC) From: "Wolfram Schlich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Wolfram Schlich" Message-ID: <1484567356.296feb41fc063071d4df2dee73fb6e9831d71ee9.wschlich@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/motion/, media-video/motion/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-video/motion/Manifest media-video/motion/files/motion.conf media-video/motion/files/motion.confd-r1 media-video/motion/files/motion.initd-r3 media-video/motion/files/motion.service media-video/motion/files/motion_at.service media-video/motion/metadata.xml media-video/motion/motion-4.0.1.ebuild X-VCS-Directories: media-video/motion/files/ media-video/motion/ X-VCS-Committer: wschlich X-VCS-Committer-Name: Wolfram Schlich X-VCS-Revision: 296feb41fc063071d4df2dee73fb6e9831d71ee9 X-VCS-Branch: master Date: Mon, 16 Jan 2017 11:49:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 95e645be-1d79-405a-85a0-785e8ca8b66c X-Archives-Hash: cbf63579b17f015c44d8501758c0e128 commit: 296feb41fc063071d4df2dee73fb6e9831d71ee9 Author: Wolfram Schlich gentoo org> AuthorDate: Mon Jan 16 11:47:55 2017 +0000 Commit: Wolfram Schlich gentoo org> CommitDate: Mon Jan 16 11:49:16 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=296feb41 media-video/motion: add new ebuild for version 4, mostly based upon the ebuild from William Breathitt Gray gmail.com> (bug #475120) Package-Manager: portage-2.3.0 media-video/motion/Manifest | 1 + media-video/motion/files/motion.conf | 1 + media-video/motion/files/motion.confd-r1 | 9 ++++ media-video/motion/files/motion.initd-r3 | 43 ++++++++++++++++ media-video/motion/files/motion.service | 20 ++++++++ media-video/motion/files/motion_at.service | 20 ++++++++ media-video/motion/metadata.xml | 3 ++ media-video/motion/motion-4.0.1.ebuild | 81 ++++++++++++++++++++++++++++++ 8 files changed, 178 insertions(+) diff --git a/media-video/motion/Manifest b/media-video/motion/Manifest index a8e665f..3334e86 100644 --- a/media-video/motion/Manifest +++ b/media-video/motion/Manifest @@ -1 +1,2 @@ DIST motion-3.2.12.tar.gz 425729 SHA256 a597f8d7ec0bf3c5fb62722c4eead59717fe01c2ae0d256c642027cea74b2f0a SHA512 d44620f8865420da71ff1dc1e1d8ba8e5465b395f2cf3b2cc9a91d3d415694b26376a9f8e3a1b78ffd0efde22d9e0338daa77237aed38c060dc3577af4c0864c WHIRLPOOL 0b7618d48161e8ffefacc5331d1078004d87839b532100c37bfaf06e99772921228feea6eea063301dfdc9e5f5a1dc07fd0847858440c6f876c1e03deaa078c8 +DIST release-4.0.1.tar.gz 444779 SHA256 2f67669a09ce0481ecd987028dae1c5cb135dfdc3c254c06ab7c9ca0c6c183f0 SHA512 6ccde3890e6af56f28208321987dd1b9d62a55bbe7cbc3ab5600263602e6e8f47589392c2f3a3a6cb54f927ee76aea94d0e83f26ce8e4047890c891b6c2f8976 WHIRLPOOL 425587a1ff52edadddbdc7fd65cdb015324b99514128d3810a6d1bb6d2cd2f1c5daea03c1db0c4a89679358793f9201156dd821ce795d704ede12bdb151fafdd diff --git a/media-video/motion/files/motion.conf b/media-video/motion/files/motion.conf new file mode 100644 index 00000000..f032d87 --- /dev/null +++ b/media-video/motion/files/motion.conf @@ -0,0 +1 @@ +d /var/lib/motion/ 0750 motion video diff --git a/media-video/motion/files/motion.confd-r1 b/media-video/motion/files/motion.confd-r1 new file mode 100644 index 00000000..dfff31b --- /dev/null +++ b/media-video/motion/files/motion.confd-r1 @@ -0,0 +1,9 @@ +# Set the user and group under which motion will be run +MOTION_USER="motion" +MOTION_GROUP="video" + +# Set the the directory for storing the pidfile +MOTION_RUN_DIR="/var/run/motion" + +# Set the the working directory for storing images/videos +MOTION_LIB_DIR="/var/lib/motion" diff --git a/media-video/motion/files/motion.initd-r3 b/media-video/motion/files/motion.initd-r3 new file mode 100644 index 00000000..d893a82 --- /dev/null +++ b/media-video/motion/files/motion.initd-r3 @@ -0,0 +1,43 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +extra_started_commands="reload" + +depend() { + need modules + after mysql +} + +checkconfig() { + export MOTION_RUN_DIR="${MOTION_RUN_DIR:-/var/run/motion}" + checkpath -d -m 750 -o "${MOTION_USER:-motion}:${MOTION_GROUP:-video}" "${MOTION_RUN_DIR}" + export MOTION_LIB_DIR="${MOTION_LIB_DIR:-/var/lib/motion}" + checkpath -d -m 750 -o "${MOTION_USER:-motion}:${MOTION_GROUP:-video}" "${MOTION_LIB_DIR}" + return 0 +} + +start() { + checkconfig || return 1 + + ebegin "Starting motion detection" + start-stop-daemon --start -u "${MOTION_USER}" -g "${MOTION_GROUP}" -d "${MOTION_LIB_DIR}" --quiet --exec /usr/bin/motion -- -b -p "${MOTION_RUN_DIR}/motion.pid" + eend $? +} + +stop() { + checkconfig || return 1 + + ebegin "Stopping motion detection" + start-stop-daemon --stop --quiet --exec /usr/bin/motion --pidfile "${MOTION_RUN_DIR}/motion.pid" + eend $? +} + +reload() { + checkconfig || return 1 + + ebegin "Reloading motion detection configuration" + start-stop-daemon --stop --signal HUP --exec /usr/bin/motion --pidfile "${MOTION_RUN_DIR}/motion.pid" + eend $? +} diff --git a/media-video/motion/files/motion.service b/media-video/motion/files/motion.service new file mode 100644 index 00000000..559b94b --- /dev/null +++ b/media-video/motion/files/motion.service @@ -0,0 +1,20 @@ +[Unit] +Description=Motion detection daemon +After=local-fs.target network.target +Documentation=man:motion(1) + +[Service] +Type=simple +ExecStart=/usr/bin/motion -n -c /etc/motion/motion.conf +StandardError=null + +User=motion +Group=video + +#RuntimeDirectory=motion +#RuntimeDirectoryMode=0750 + +WorkingDirectory=/var/lib/motion + +[Install] +WantedBy=multi-user.target diff --git a/media-video/motion/files/motion_at.service b/media-video/motion/files/motion_at.service new file mode 100644 index 00000000..87df911 --- /dev/null +++ b/media-video/motion/files/motion_at.service @@ -0,0 +1,20 @@ +[Unit] +Description=Motion detection daemon for %I +After=local-fs.target network.target +Documentation=man:motion(1) + +[Service] +Type=simple +ExecStart=/usr/bin/motion -n -c /etc/motion/motion-%i.conf +StandardError=null + +User=motion +Group=video + +#RuntimeDirectory=motion +#RuntimeDirectoryMode=0750 + +WorkingDirectory=/var/lib/motion + +[Install] +WantedBy=multi-user.target diff --git a/media-video/motion/metadata.xml b/media-video/motion/metadata.xml index bd52de8..cf2e1ad 100644 --- a/media-video/motion/metadata.xml +++ b/media-video/motion/metadata.xml @@ -4,6 +4,9 @@ media-video@gentoo.org + + Enables Multi-Media Abstraction Layer (MMAL) decoding support: Available e.g. on the Raspberry Pi. + motion diff --git a/media-video/motion/motion-4.0.1.ebuild b/media-video/motion/motion-4.0.1.ebuild new file mode 100644 index 00000000..e820993 --- /dev/null +++ b/media-video/motion/motion-4.0.1.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 +inherit autotools readme.gentoo-r1 user systemd + +DESCRIPTION="A software motion detector" +HOMEPAGE="https://motion-project.github.io" +SRC_URI="https://github.com/Motion-Project/${PN}/archive/release-${PV}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="ffmpeg libav mmal mysql postgres v4l" + +RDEPEND=" + ffmpeg? ( + libav? ( media-video/libav:= ) + !libav? ( media-video/ffmpeg:0= ) + ) + virtual/jpeg:= + mmal? ( media-libs/raspberrypi-userland ) + mysql? ( virtual/mysql ) + postgres? ( dev-db/postgresql:= ) +" +DEPEND="${RDEPEND} + v4l? ( virtual/os-headers media-libs/libv4l ) +" + +DISABLE_AUTOFORMATTING="yes" +DOC_CONTENTS="You need to setup /etc/${PN}/${PN}.conf before running +${PN} for the first time. +To install ${PN} as a service, use: +rc-update add ${PN} default # with OpenRC +systemctl enable ${PN}.service # with systemd +" + +pkg_setup() { + enewuser ${PN} -1 -1 -1 video +} + +S="${WORKDIR}"/${PN}-release-${PV} + +src_prepare() { + eapply_user + eautoreconf +} + +src_configure() { + econf \ + $(use_with ffmpeg) \ + $(use_with mmal) \ + $(use_with mysql) \ + $(use_with postgres pgsql) \ + $(use_with v4l) \ + --without-optimizecpu +} + +src_install() { + emake \ + DESTDIR="${D}" \ + docdir=/usr/share/doc/${PF} \ + examplesdir=/usr/share/doc/${PF}/examples \ + install + + newinitd "${FILESDIR}"/${PN}.initd-r2 ${PN} + newconfd "${FILESDIR}"/${PN}.confd ${PN} + + systemd_dounit "${FILESDIR}"/${PN}.service + systemd_dounit "${FILESDIR}"/${PN}_at.service + systemd_dotmpfilesd "${FILESDIR}"/${PN}.conf + + keepdir /var/lib/motion + fowners motion:video /var/lib/motion + fperms 0750 /var/lib/motion + + mv -vf "${D}"/etc/${PN}/${PN}{-dist,}.conf || die + + readme.gentoo_create_doc +}