Name: motion Version: 4.6.0 Release: 1%{?dist} Summary: A motion detection system License: GPL-2.0-or-later URL: https://motion-project.github.io/ Source0: https://github.com/Motion-Project/motion/archive/release-%{version}.tar.gz#/%{name}-release-%{version}.tar.gz Source1: motion.service Source2: motion.tmpfiles BuildRequires: autoconf BuildRequires: automake BuildRequires: gettext-devel BuildRequires: ffmpeg-free-devel BuildRequires: libtool BuildRequires: libjpeg-turbo-devel BuildRequires: libmicrohttpd-devel BuildRequires: libwebp-devel BuildRequires: libzip-devel BuildRequires: pkgconfig(sqlite3) BuildRequires: systemd-units BuildRequires: zlib-devel #This requires comes from the startup script, it will be there until motion supports libv4l calls in the code Requires: libv4l # Needed for MIPI cameras Requires: libcamera-v4l2 Requires(pre): shadow-utils Requires(post): systemd Requires(preun):systemd Requires(postun):systemd %description Motion is a software motion detector. It grabs images from video4linux devices and/or from webcams (such as the axis network cameras). Motion is the perfect tool for keeping an eye on your property keeping only those images that are interesting. Motion is strictly command line driven and can run as a daemon with a rather small footprint. This version is built with ffmpeg support but without MySQL and PostgreSQL support. %prep %autosetup -p1 -n %{name}-release-%{version} %build autoreconf -vif %configure \ --without-optimizecpu \ --with-ffmpeg \ --without-mysql \ --without-pgsql \ --with-webp %make_build %install %make_install mv %{buildroot}%{_sysconfdir}/%{name}/motion-dist.conf %{buildroot}%{_sysconfdir}/%{name}/motion.conf mv %{buildroot}%{_sysconfdir}/%{name}/camera1-dist.conf %{buildroot}%{_sysconfdir}/%{name}/camera1.conf mv %{buildroot}%{_sysconfdir}/%{name}/camera2-dist.conf %{buildroot}%{_sysconfdir}/%{name}/camera2.conf mv %{buildroot}%{_sysconfdir}/%{name}/camera3-dist.conf %{buildroot}%{_sysconfdir}/%{name}/camera3.conf mv %{buildroot}%{_sysconfdir}/%{name}/camera4-dist.conf %{buildroot}%{_sysconfdir}/%{name}/camera4.conf # Change the PID file path to match the startup script sed -i 's|/var/run/motion/motion.pid|/var/run/motion.pid|g' %{buildroot}%{_sysconfdir}/%{name}/motion.conf # Set the log file and target directory sed -i 's|;logfile /tmp/motion.log|logfile /var/log/motion.log|g' %{buildroot}%{_sysconfdir}/%{name}/motion.conf sed -i 's|target_dir /tmp/motion|target_dir /var/motion|g' %{buildroot}%{_sysconfdir}/%{name}/motion.conf # Install the startup script install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service # Install tmpfiles configuration install -D -m 0755 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf %find_lang %{name} %pre getent passwd motion >/dev/null || \ useradd -r -g video -d /run/motion -s /sbin/nologin \ -c "Motion Setection System" motion exit 0 %post /usr/bin/systemd-tmpfiles --create %{_tmpfilesdir}/%{name}.conf %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %files -f %{name}.lang %license LICENSE %doc README.md %doc %{_docdir}/%{name}/ %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/*.conf %{_bindir}/%{name} %{_mandir}/man1/%{name}.1* %{_unitdir}/%{name}.service %{_tmpfilesdir}/%{name}.conf %changelog * Sun Jun 23 2024 Peter Robinson - 4.6.0-1 - Initial package