1 |
commit: 58c1002e91e59ca9edba1a4781f3024b0dbdf99e |
2 |
Author: Hans Fernhout <hfern <AT> fernhout <DOT> info> |
3 |
AuthorDate: Thu Jun 4 07:09:24 2020 +0000 |
4 |
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jun 4 07:14:12 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=58c1002e |
7 |
|
8 |
media-video/motion: version bump to 4.3.1 |
9 |
|
10 |
Summary of changes: |
11 |
- support new version 4.3.1 |
12 |
- EAPI6 to EAPI7 |
13 |
- GLEP81 support: user and group management via dedicated packages |
14 |
- untangled support for mariadb and mysql |
15 |
- remove libav |
16 |
- confd support for commandline options, umask and work dir |
17 |
- initd checkpre function to check existence of work dir and log dir |
18 |
- support for OpenRC's supervise-daemon via a local use flag |
19 |
- added myself as proxy-maintainer |
20 |
|
21 |
Closes: https://bugs.gentoo.org/665930 |
22 |
Closes: https://bugs.gentoo.org/673410 |
23 |
Closes: https://bugs.gentoo.org/717312 |
24 |
Signed-off-by: Johannes Willem Fernhout <hfern <AT> fernhout.info> |
25 |
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> |
26 |
|
27 |
media-video/motion/Manifest | 1 + |
28 |
media-video/motion/files/motion.confd-r4 | 28 ++++++ |
29 |
media-video/motion/files/motion.initd-r4 | 30 ++++++ |
30 |
media-video/motion/files/motion.service | 4 +- |
31 |
.../files/{motion.service => motion.service-r4} | 14 ++- |
32 |
media-video/motion/metadata.xml | 10 ++ |
33 |
media-video/motion/motion-4.3.1.ebuild | 104 +++++++++++++++++++++ |
34 |
7 files changed, 185 insertions(+), 6 deletions(-) |
35 |
|
36 |
diff --git a/media-video/motion/Manifest b/media-video/motion/Manifest |
37 |
index 00403820c80..2ea48fa4c59 100644 |
38 |
--- a/media-video/motion/Manifest |
39 |
+++ b/media-video/motion/Manifest |
40 |
@@ -1 +1,2 @@ |
41 |
DIST motion-release-4.1.1.tar.gz 447795 BLAKE2B 8c7dfdad89f49ba8ec39689d268b4bc95c6a8bd85d4bd333f66638b2e815b3c59b2e42dd93811601b2ee7870100a0a21eaa789633056f74a5cc9f39f4f92229f SHA512 3b08d464f9243ccfc4b53b16cfc2001d1e0d206bf0295d55d8914914bc14ad0248ce5ac622cb7eb89ed32e1913a9a10add1b56497c4094ba876f7f85d6ad4143 |
42 |
+DIST motion-release-4.3.1.tar.gz 849633 BLAKE2B 33039d9b8b6db0698767892997be958d84a881cc56e8cdc31d8c27242c972e629d328197c92f91c1b71a957d85807877dc602f474d430384b1e27c9213ddc697 SHA512 17033dab055c4f1d9e2912a27d0a5b419d325b0781def98428a6117e38c62201b87199210071ba93d6c4dae514733b749e39cbc1befe6242f157d4583e07dcc6 |
43 |
|
44 |
diff --git a/media-video/motion/files/motion.confd-r4 b/media-video/motion/files/motion.confd-r4 |
45 |
new file mode 100644 |
46 |
index 00000000000..8a200d14928 |
47 |
--- /dev/null |
48 |
+++ b/media-video/motion/files/motion.confd-r4 |
49 |
@@ -0,0 +1,28 @@ |
50 |
+# Copyright 1999-2020 Gentoo Authors |
51 |
+# Distributed under the terms of the GNU General Public License v2 |
52 |
+# |
53 |
+# Motion OpenRC conf.d file |
54 |
+# All settings are optional |
55 |
+ |
56 |
+# Set the user and group under which motion will be run |
57 |
+#MOTION_USER="motion" |
58 |
+#MOTION_GROUP="motion" |
59 |
+ |
60 |
+#Set motion's config file: |
61 |
+#MOTION_CONFIGFILE="/etc/motion/motion.conf" |
62 |
+ |
63 |
+#Set motion's log file. Leave unset for syslog: |
64 |
+#MOTION_LOGFILE="/var/log/motion/motion.log" |
65 |
+ |
66 |
+#Set log type: 1-9 for COR, STR, ENC, NET, DBL, EVT, TRK, VID, ALL |
67 |
+#MOTION_LOGTYPE="9" |
68 |
+ |
69 |
+#Set log level: 1-9 for EMG, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL |
70 |
+#MOTION_LOGLEVEL="6" |
71 |
+ |
72 |
+#Set a default dir where motion places its output |
73 |
+#MOTION_DIR="/var/lib/motion" |
74 |
+ |
75 |
+#Set the umask for the output files, for additonal security |
76 |
+#MOTION_UMASK="007" |
77 |
+ |
78 |
|
79 |
diff --git a/media-video/motion/files/motion.initd-r4 b/media-video/motion/files/motion.initd-r4 |
80 |
new file mode 100644 |
81 |
index 00000000000..30d5e25cb08 |
82 |
--- /dev/null |
83 |
+++ b/media-video/motion/files/motion.initd-r4 |
84 |
@@ -0,0 +1,30 @@ |
85 |
+#!/sbin/openrc-run |
86 |
+# Copyright 1999-2020 Gentoo Authors |
87 |
+# Distributed under the terms of the GNU General Public License v2 |
88 |
+ |
89 |
+: ${MOTION_USER:="motion"} |
90 |
+: ${MOTION_GROUP:="motion"} |
91 |
+ |
92 |
+[ "${MOTION_UMASK}" ] && umask="${MOTION_UMASK}" |
93 |
+[ "${MOTION_CONFIGFILE}" ] && command_args="-c ${MOTION_CONFIGFILE}" |
94 |
+[ "${MOTION_LOGFILE}" ] && command_args="${command_args} -l ${MOTION_LOGFILE}" |
95 |
+[ "${MOTION_LOGTYPE}" ] && command_args="${command_args} -k ${MOTION_LOGTYPE}" |
96 |
+[ "${MOTION_LOGLEVEL}" ] && command_args="${command_args} -d ${MOTION_LOGLEVEL}" |
97 |
+ |
98 |
+command=/usr/bin/motion |
99 |
+command_user="${MOTION_USER}:${MOTION_GROUP}" |
100 |
+ |
101 |
+start_pre() { |
102 |
+ if [ "${MOTION_DIR}" ] ; then |
103 |
+ mkdir -p "${MOTION_DIR}" |
104 |
+ checkpath -d -o "${MOTION_USER}" "${MOTION_DIR}" |
105 |
+ directory="${MOTION_DIR}" |
106 |
+ fi |
107 |
+ if [ "${MOTION_LOGFILE}" ] ; then |
108 |
+ local LOGFILE=${MOTION_LOGFILE##*/} |
109 |
+ local LOGDIR=${MOTION_LOGFILE%$LOGFILE} |
110 |
+ mkdir -p "${LOGDIR}" |
111 |
+ checkpath -d -o "${MOTION_USER}" "${LOGDIR}" |
112 |
+ fi |
113 |
+} |
114 |
+ |
115 |
|
116 |
diff --git a/media-video/motion/files/motion.service b/media-video/motion/files/motion.service |
117 |
index 559b94b6b29..d4755bdb48e 100644 |
118 |
--- a/media-video/motion/files/motion.service |
119 |
+++ b/media-video/motion/files/motion.service |
120 |
@@ -8,13 +8,13 @@ Type=simple |
121 |
ExecStart=/usr/bin/motion -n -c /etc/motion/motion.conf |
122 |
StandardError=null |
123 |
|
124 |
-User=motion |
125 |
+#User=motion |
126 |
Group=video |
127 |
|
128 |
#RuntimeDirectory=motion |
129 |
#RuntimeDirectoryMode=0750 |
130 |
|
131 |
-WorkingDirectory=/var/lib/motion |
132 |
+#WorkingDirectory=/var/lib/motion |
133 |
|
134 |
[Install] |
135 |
WantedBy=multi-user.target |
136 |
|
137 |
diff --git a/media-video/motion/files/motion.service b/media-video/motion/files/motion.service-r4 |
138 |
similarity index 56% |
139 |
copy from media-video/motion/files/motion.service |
140 |
copy to media-video/motion/files/motion.service-r4 |
141 |
index 559b94b6b29..1564fb2699c 100644 |
142 |
--- a/media-video/motion/files/motion.service |
143 |
+++ b/media-video/motion/files/motion.service-r4 |
144 |
@@ -1,3 +1,9 @@ |
145 |
+# Copyright 1999-2020 Gentoo Authors |
146 |
+# Distributed under the terms of the GNU General Public License v2 |
147 |
+# |
148 |
+# Motion OpenRC systemd service file |
149 |
+ |
150 |
+ |
151 |
[Unit] |
152 |
Description=Motion detection daemon |
153 |
After=local-fs.target network.target |
154 |
@@ -9,12 +15,12 @@ ExecStart=/usr/bin/motion -n -c /etc/motion/motion.conf |
155 |
StandardError=null |
156 |
|
157 |
User=motion |
158 |
-Group=video |
159 |
+Group=motion |
160 |
|
161 |
-#RuntimeDirectory=motion |
162 |
-#RuntimeDirectoryMode=0750 |
163 |
+UMask=007 |
164 |
+WorkingDirectory=-/var/lib/motion |
165 |
|
166 |
-WorkingDirectory=/var/lib/motion |
167 |
|
168 |
[Install] |
169 |
WantedBy=multi-user.target |
170 |
+ |
171 |
|
172 |
diff --git a/media-video/motion/metadata.xml b/media-video/motion/metadata.xml |
173 |
index b1389a2954b..301a7616abb 100644 |
174 |
--- a/media-video/motion/metadata.xml |
175 |
+++ b/media-video/motion/metadata.xml |
176 |
@@ -1,11 +1,21 @@ |
177 |
<?xml version="1.0" encoding="UTF-8"?> |
178 |
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
179 |
<pkgmetadata> |
180 |
+ <maintainer type="person"> |
181 |
+ <email>hfern@××××××××.info</email> |
182 |
+ <name>Hans Fernhout</name> |
183 |
+ </maintainer> |
184 |
+ <maintainer type="project"> |
185 |
+ <email>proxy-maint@g.o</email> |
186 |
+ <name>Proxy Maintainers</name> |
187 |
+ </maintainer> |
188 |
<maintainer type="project"> |
189 |
<email>media-video@g.o</email> |
190 |
</maintainer> |
191 |
<use> |
192 |
+ <flag name="mariadb">Add mariadb database support</flag> |
193 |
<flag name="mmal">Enables Multi-Media Abstraction Layer (MMAL) decoding support: Available e.g. on the Raspberry Pi.</flag> |
194 |
+ <flag name="supervise-daemon">Add experimental suppport for OpenRC's supervise-daemon process supervision</flag> |
195 |
</use> |
196 |
<upstream> |
197 |
<remote-id type="github">Motion-Project/motion</remote-id> |
198 |
|
199 |
diff --git a/media-video/motion/motion-4.3.1.ebuild b/media-video/motion/motion-4.3.1.ebuild |
200 |
new file mode 100644 |
201 |
index 00000000000..41e650e61fd |
202 |
--- /dev/null |
203 |
+++ b/media-video/motion/motion-4.3.1.ebuild |
204 |
@@ -0,0 +1,104 @@ |
205 |
+# Copyright 1999-2020 Gentoo Authors |
206 |
+# Distributed under the terms of the GNU General Public License v2 |
207 |
+ |
208 |
+EAPI=7 |
209 |
+ |
210 |
+inherit autotools readme.gentoo-r1 systemd |
211 |
+ |
212 |
+DESCRIPTION="A software motion detector" |
213 |
+HOMEPAGE="https://motion-project.github.io" |
214 |
+SRC_URI="https://github.com/Motion-Project/${PN}/archive/release-${PV}.tar.gz -> ${PN}-release-${PV}.tar.gz" |
215 |
+ |
216 |
+LICENSE="GPL-2" |
217 |
+SLOT="0" |
218 |
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" |
219 |
+IUSE="ffmpeg mariadb mmal mysql postgres sqlite supervise-daemon v4l webp" |
220 |
+ |
221 |
+RDEPEND=" |
222 |
+ acct-group/motion |
223 |
+ acct-user/motion |
224 |
+ virtual/jpeg:= |
225 |
+ ffmpeg? ( media-video/ffmpeg:0= ) |
226 |
+ mariadb? ( dev-db/mariadb-connector-c ) |
227 |
+ mmal? ( media-libs/raspberrypi-userland ) |
228 |
+ mysql? ( dev-db/mysql-connector-c ) |
229 |
+ postgres? ( dev-db/postgresql:= ) |
230 |
+ sqlite? ( dev-db/sqlite:3 ) |
231 |
+ webp? ( media-libs/libwebp:= ) |
232 |
+" |
233 |
+DEPEND="${RDEPEND} |
234 |
+ net-libs/libmicrohttpd |
235 |
+ v4l? ( |
236 |
+ media-libs/libv4l |
237 |
+ virtual/os-headers |
238 |
+ ) |
239 |
+" |
240 |
+ |
241 |
+DISABLE_AUTOFORMATTING="yes" |
242 |
+DOC_CONTENTS=" |
243 |
+You need to setup a configuraton file (/etc/motion/motion.conf) before |
244 |
+running motion for the first time. |
245 |
+ |
246 |
+If motion is built with the mysql or mariadb use flags then please make |
247 |
+sure to configure a matching database_type in the config file. |
248 |
+ |
249 |
+Motion runs by default under user motion and group motion: |
250 |
+- change this if needed in /etc/conf.d/motion |
251 |
+- or add users who need access to the output files to the motion group |
252 |
+ |
253 |
+To install motion as a service, use: |
254 |
+- rc-update add motion default # with OpenRC |
255 |
+- systemctl enable motion.service # with systemd |
256 |
+" |
257 |
+ |
258 |
+S="${WORKDIR}"/${PN}-release-${PV} |
259 |
+ |
260 |
+src_prepare() { |
261 |
+ default |
262 |
+ eautoreconf |
263 |
+} |
264 |
+ |
265 |
+src_configure() { |
266 |
+ econf \ |
267 |
+ $(use_with ffmpeg) \ |
268 |
+ $(use_with mariadb) \ |
269 |
+ $(use_with mmal) \ |
270 |
+ $(use_with mysql) \ |
271 |
+ $(use_with postgres pgsql) \ |
272 |
+ $(use_with sqlite sqlite3) \ |
273 |
+ $(use_with v4l v4l2) \ |
274 |
+ $(use_with webp) \ |
275 |
+ --without-optimizecpu |
276 |
+} |
277 |
+ |
278 |
+src_install() { |
279 |
+ emake \ |
280 |
+ DESTDIR="${D}" \ |
281 |
+ docdir=/usr/share/doc/${PF} \ |
282 |
+ examplesdir=/usr/share/doc/${PF}/examples \ |
283 |
+ install |
284 |
+ |
285 |
+ # build INITDAD string cwto be added to initd based on use flags, eg |
286 |
+ # "depend() { |
287 |
+ # use mysql |
288 |
+ # } |
289 |
+ # |
290 |
+ # supervisor=supervise-daemon" |
291 |
+ local INITDADJ="" |
292 |
+ ( use mysql || use mariadb ) && INITDADJ=" use mysql\n" |
293 |
+ use postgres && INITDADJ="${INITDADJ} use postgresql\n" |
294 |
+ [ "${#INITDADJ}" -gt 0 ] && INITDADJ="depend() {\n${INITDADJ}}\n" |
295 |
+ if use supervise-daemon ; then |
296 |
+ INITDADJ="${INITDADJ}\nsupervisor=supervise-daemon\n" |
297 |
+ else |
298 |
+ INITDADJ="${INITDADJ}\npidfile=/run/\${RC_SVCNAME}.pid\ncommand_background=true\n" |
299 |
+ fi |
300 |
+ cp "${FILESDIR}/${PN}.initd-r4" "${T}/initd" || die |
301 |
+ echo -e ${INITDADJ} >> "${T}/initd" || die |
302 |
+ |
303 |
+ newinitd "${T}/initd" ${PN} |
304 |
+ newconfd "${FILESDIR}/${PN}.confd-r4" ${PN} |
305 |
+ systemd_newunit "${FILESDIR}/${PN}.service-r4" "${PN}.service" |
306 |
+ readme.gentoo_create_doc |
307 |
+ readme.gentoo_print_elog |
308 |
+} |