diff options
author | Wolfram Schlich <wschlich@gentoo.org> | 2017-01-16 12:47:55 +0100 |
---|---|---|
committer | Wolfram Schlich <wschlich@gentoo.org> | 2017-01-16 12:49:16 +0100 |
commit | 296feb41fc063071d4df2dee73fb6e9831d71ee9 (patch) | |
tree | 667a9c7340f78c0369455617b43068cd1e9513f2 /media-video | |
parent | app-misc/xmind: version bump (diff) | |
download | gentoo-296feb41fc063071d4df2dee73fb6e9831d71ee9.tar.gz gentoo-296feb41fc063071d4df2dee73fb6e9831d71ee9.tar.bz2 gentoo-296feb41fc063071d4df2dee73fb6e9831d71ee9.zip |
media-video/motion: add new ebuild for version 4, mostly based upon the ebuild from William Breathitt Gray <vilhelm.gray@gmail.com> (bug #475120)
Package-Manager: portage-2.3.0
Diffstat (limited to 'media-video')
-rw-r--r-- | media-video/motion/Manifest | 1 | ||||
-rw-r--r-- | media-video/motion/files/motion.conf | 1 | ||||
-rw-r--r-- | media-video/motion/files/motion.confd-r1 | 9 | ||||
-rw-r--r-- | media-video/motion/files/motion.initd-r3 | 43 | ||||
-rw-r--r-- | media-video/motion/files/motion.service | 20 | ||||
-rw-r--r-- | media-video/motion/files/motion_at.service | 20 | ||||
-rw-r--r-- | media-video/motion/metadata.xml | 3 | ||||
-rw-r--r-- | media-video/motion/motion-4.0.1.ebuild | 81 |
8 files changed, 178 insertions, 0 deletions
diff --git a/media-video/motion/Manifest b/media-video/motion/Manifest index a8e665f89c35..3334e86bd860 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 000000000000..f032d874f0ca --- /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 000000000000..dfff31beb45d --- /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 000000000000..d893a8211b08 --- /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 000000000000..559b94b6b29a --- /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 000000000000..87df91132486 --- /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 bd52de83b0de..cf2e1ad94504 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 000000000000..e82099351ae5 --- /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 +} |