public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Wolfram Schlich" <wschlich@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/motion/, media-video/motion/files/
Date: Mon, 16 Jan 2017 11:49:55 +0000 (UTC)	[thread overview]
Message-ID: <1484567356.296feb41fc063071d4df2dee73fb6e9831d71ee9.wschlich@gentoo> (raw)

commit:     296feb41fc063071d4df2dee73fb6e9831d71ee9
Author:     Wolfram Schlich <wschlich <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 16 11:47:55 2017 +0000
Commit:     Wolfram Schlich <wschlich <AT> gentoo <DOT> 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 <vilhelm.gray <AT> 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 @@
 	<maintainer type="project">
 		<email>media-video@gentoo.org</email>
 	</maintainer>
+	<use>
+		<flag name="mmal">Enables Multi-Media Abstraction Layer (MMAL) decoding support: Available e.g. on the Raspberry Pi.</flag>
+	</use>
 	<upstream>
 		<remote-id type="sourceforge">motion</remote-id>
 	</upstream>

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
+}


             reply	other threads:[~2017-01-16 11:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16 11:49 Wolfram Schlich [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-02-10 13:44 [gentoo-commits] repo/gentoo:master commit in: media-video/motion/, media-video/motion/files/ Wolfram Schlich
2020-06-04  7:14 Joonas Niilola
2021-04-14 14:44 John Helmert III
2023-06-26 18:05 David Seifert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1484567356.296feb41fc063071d4df2dee73fb6e9831d71ee9.wschlich@gentoo \
    --to=wschlich@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox