%bcond_without fftw3 %ifarch s390x ppc64le %bcond_with libcamera %else %bcond_without libcamera %endif %bcond_without mariadb %bcond_with mysql %bcond_with opencv %bcond_with postgresql %bcond_without pulse %bcond_without sqlite # TODO: # - /run/motion can be managed with RuntimeDirectory=motion in motion.service, # instead of tmpfiles snippet #%%global _lto_cflags %%{nil} Name: motionplus Version: 0.2.2 Release: 0%{?dist}.1sunshine Summary: A motion detection system License: GPL-2.0-or-later URL: https://motion-project.github.io/ Source0: https://github.com/Motion-Project/motionplus/archive/release-%{version}.tar.gz#/%{name}-release-%{version}.tar.gz Source1: motionplus.service Source2: motionplus.tmpfiles BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: gcc-c++ BuildRequires: make BuildRequires: systemd-units BuildRequires: gettext-devel # BuildRequires: ffmpeg-devel BuildRequires: pkgconfig(libavutil) pkgconfig(libavformat) pkgconfig(libavcodec) pkgconfig(libswscale) pkgconfig(libavdevice) BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libmicrohttpd) BuildRequires: pkgconfig(libwebp) BuildRequires: pkgconfig(libwebpmux) BuildRequires: zlib-devel %if %{with fftw3} BuildRequires: fftw3-devel %endif %if %{with libcamera} BuildRequires: pkgconfig(libcamera) %endif %if %{with mariadb} BuildRequires: mariadb-devel %endif %if %{with mysql} BuildRequires: mysql-devel %endif %if %{with postgresql} BuildRequires: libpq-devel %endif %if %{with opencv} BuildRequires: opencv-devel %endif %if %{with pulse} BuildRequires: pulseaudio-libs-devel %endif %if %{with sqlite} BuildRequires: pkgconfig(sqlite3) %endif # libsdl1.2-dev, # libv4l-dev, #This requires comes from the startup script, it will be there until motion supports libv4l calls in the code Requires: libv4l 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} autoreconf -fiv %build export AR=%{_bindir}/gcc-ar export RANLIB=%{_bindir}/gcc-ranlib export NM=%{_bindir}/gcc-nm %configure \ --without-optimizecpu \ --without-alsa \ --with-ffmpeg \ %if %{with fftw3} --with-fftw3 \ %else --without-fftw3 \ %endif %if %{with libcamera} --with-libcam \ %else --without-libcam \ %endif %if %{with mariadb} --with-mariadb \ %else --without-mariadb \ %endif %if %{with mysql} --with-mysql \ %else --without-mysql \ %endif %if %{with opencv} --with-opencv \ %else --without-opencv \ %endif %if %{with pulse} --with-pulse \ %else --without-pulse \ %endif %if %{with postgresql} --with-pgsql \ %else --without-pgsql \ %endif %if %{with sqlite} --with-sqlite \ %else --without-sqlite \ %endif --with-webp %make_build V=1 %install %make_install #We rename the configuration files mv %{buildroot}%{_sysconfdir}/%{name}/motionplus-dist.conf %{buildroot}%{_sysconfdir}/%{name}/motionplus.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}/sound1-dist.conf %{buildroot}%{_sysconfdir}/%{name}/sound1.conf #Delete doc directory rm -rf %{buildroot}%{_datadir}/doc #We change the PID file path to match the one in the startup script sed -i 's|/var/run/motionplus/motionplus.pid|/var/run/motionplus.pid|g' %{buildroot}%{_sysconfdir}/%{name}/motionplus.conf #We change the config directory sed -i 's|/usr/etc/motionplus/|/etc/motionplus/|g' %{buildroot}%{_sysconfdir}/%{name}/*.conf #We set the log file and target directory - logging is for 3.3 branch sed -i 's|;logfile /tmp/motionplus.log|logfile /var/log/motionplus.log|g' %{buildroot}%{_sysconfdir}/%{name}/motionplus.conf sed -i 's|target_dir /tmp/motionplus|target_dir /var/motionplus|g' %{buildroot}%{_sysconfdir}/%{name}/motionplus.conf #We install our startup script install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service #We install tmpfiles configuration install -D -m 0755 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf #We remove versioned docs rm -rf %{buildroot}%{_docdir}/%{name}-%{version} %find_lang %{name} %pre getent passwd motionplus >/dev/null || \ useradd -r -g video -d /run/motionplus -s /sbin/nologin \ -c "motionplus motion detection system" motionplus 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 %triggerun -- motionplus < 3.3.0-trunkREV557.8 # we never shipped /var/motionplus directory, but it was set as # default target_dir in config file. Be nice to admin and migrate # ownership at the same time as we switch to running as user if [ -d /var/motionplus ]; then find /var/motionplus -user root -group root -exec chown motionplus:video '{}' ';' fi %files -f %{name}.lang %doc doc/changelog README.md doc/motionplus_*.html doc/*.gif doc/samplepage.html %license LICENSE %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/*.conf %{_bindir}/%{name} %{_mandir}/man1/%{name}.1* %{_unitdir}/%{name}.service %{_tmpfilesdir}/%{name}.conf %changelog * Tue Sep 10 2024 Moritz Barsnick 0.2.2-0.1sunshine - update to 0.2.2 * Thu Sep 05 2024 Moritz Barsnick 0.2.1-0.4sunshine - disable opencv, it pulls in ~800 MB of packages * Thu Sep 05 2024 Moritz Barsnick 0.2.1-0.3sunshine - disable libcamera on s390x ppc64le, it is not provided there * Thu Sep 05 2024 Moritz Barsnick 0.2.1-0.2sunshine - enable opencv and mariadb support * Thu Sep 05 2024 Moritz Barsnick 0.2.1-0.1sunshine - initial package for motionplus * Fri Aug 02 2024 RPM Fusion Release Engineering - 4.6.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Sun Feb 04 2024 RPM Fusion Release Engineering - 4.6.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Nov 13 2023 Vasiliy N. Glazov - 4.6.0-1 - Update to 4.6.0 * Fri Aug 04 2023 Vasiliy N. Glazov - 4.5.1-4 - Fix Build with webp * Wed Aug 02 2023 RPM Fusion Release Engineering - 4.5.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Wed Mar 01 2023 Leigh Scott - 4.5.1-2 - Rebuild for new ffmpeg * Tue Dec 20 2022 Vasiliy N. Glazov - 4.5.1-1 - Update to 4.5.1 * Sun Nov 20 2022 Sérgio Basto - 4.5.0-1 - Update motion to 4.5.0 * Sun Aug 07 2022 RPM Fusion Release Engineering - 4.4.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild and ffmpeg 5.1 * Wed Feb 09 2022 RPM Fusion Release Engineering - 4.4.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Fri Nov 12 2021 Leigh Scott - 4.4.0-2 - Rebuilt for new ffmpeg snapshot * Mon Oct 25 2021 Vasiliy N. Glazov - 4.4.0-1 - Update to 4.4.0 * Tue Aug 03 2021 RPM Fusion Release Engineering - 4.3.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Wed Feb 03 2021 RPM Fusion Release Engineering - 4.3.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Fri Jan 1 2021 Leigh Scott - 4.3.2-2 - Rebuilt for new ffmpeg snapshot * Mon Oct 26 2020 Vasiliy N. Glazov - 4.3.2-1 - Update to 4.3.2 * Tue Aug 18 2020 RPM Fusion Release Engineering - 4.3.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Mon Apr 13 2020 Vasiliy N. Glazov - 4.3.1-1 - Update to 4.3.1 * Sat Feb 22 2020 RPM Fusion Release Engineering - 4.3.0-3 - Rebuild for ffmpeg-4.3 git * Wed Feb 05 2020 RPM Fusion Release Engineering - 4.3.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Tue Jan 14 2020 Vasiliy N. Glazov - 4.3.0-1 - Update to 4.3.0 * Thu Nov 07 2019 Vasiliy N. Glazov - 4.2.2-4 - Enable LTO * Wed Aug 07 2019 Leigh Scott - 4.2.2-3 - Rebuild for new ffmpeg version * Fri Mar 22 2019 Vasiliy N. Glazov - 4.2.2-2 - Update to 4.2.2 - Enable Webp Support * Mon Mar 04 2019 RPM Fusion Release Engineering - 4.1.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Tue Nov 13 2018 Antonio Trande - 4.1.1-6 - Rebuild for ffmpeg-3.4.5 on el7 * Fri Jul 27 2018 RPM Fusion Release Engineering - 4.1.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Thu Mar 08 2018 RPM Fusion Release Engineering - 4.1.1-4 - Rebuilt for new ffmpeg snapshot * Thu Mar 01 2018 RPM Fusion Release Engineering - 4.1.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Thu Jan 18 2018 Leigh Scott - 4.1.1-2 - Rebuilt for ffmpeg-3.5 git * Wed Jan 10 2018 Leigh Scott - 4.1.1-1 - Update to 4.1.1 release - Fix perms on motion.service (rfbz 4753) * Fri Nov 24 2017 Leigh Scott - 4.1-1 - Update to 4.1 release * Thu Aug 31 2017 RPM Fusion Release Engineering - 4.0.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Wed May 17 2017 Leigh Scott - 4.0.1-5 - Rebuild for ffmpeg update * Sun May 07 2017 Sérgio Basto - 4.0.1-4 - Patch from rfbz#4321 applied * Sat Apr 29 2017 Leigh Scott - 4.0.1-3 - Rebuild for ffmpeg update * Mon Mar 20 2017 RPM Fusion Release Engineering - 4.0.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Mon Mar 13 2017 Leigh Scott - 4.0.1-1 - Update to 4.0.1 release - Clean up spec file * Sat Jul 30 2016 Julian Sikorski - 3.3.0.trunkREV561-3 - Rebuilt for ffmpeg-3.1.1 * Sun Jul 17 2016 Leigh Scott - 3.3.0.trunkREV561-2 - patch for ffmpeg-3 * Wed Nov 18 2015 Sérgio Basto - 3.3.0.trunkREV561-1 - Update motion to runkREV561 . - Use only ffmpeg-devel, drop ffmpeg-compat-devel. - Use autoreconf to generate ./configure and patch configure with real version. - Some spec clean ups. - Drop upstreamed patch. * Sun Dec 14 2014 Tomasz Torcz - 3.3.0.trunkREV557-10 - restore lost changes (should fix #3460): * Sat Jan 11 2014 Tomasz Torcz - 3.3.0-trunkREV557.9 - use the same sources and BRs as F-19 (trunkREV557.11) branch (fixes #3106) - adjust for UnversionedDocdirs * Sat Oct 11 2014 Sérgio Basto - 3.3.0.trunkREV557-9 - Rebuild for new gcc https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - Change naming, NamingGuideline http://fedoraproject.org/wiki/Packaging:NamingGuidelines#Pre-Release_packages, since it is a forever pre-release. I adopt name version with pre-release tag, %{next_version}.trunkREV557 The motivation: rpmdev-bumpspec wasn't working correctly * Sat Apr 20 2013 Tomasz Torcz - 3.3.0-trunkREV557.8 - migrate from running as root to running as motion:video (fixes #1935) - don't ship INSTALL file * Fri Apr 19 2013 Tomasz Torcz - 3.3.0-trunkREV557.7 - re-introduce ffmpeg-compat-devel * Fri Apr 19 2013 Tomasz Torcz - 3.3.0-trunkREV557.6 - drop changelog entries before 2012 from .spec; dates were wrong and build failed - drop changelog entries before 2012 from .spec; dates were wrong and build failed * Fri Apr 19 2013 Tomasz Torcz - 3.3.0-trunkREV557.5 - bump again; I hate CVS * Fri Apr 19 2013 Tomasz Torcz - 3.3.0-trunkREV557.4 - add missing unit file and bump rel * Fri Apr 19 2013 Tomasz Torcz - 3.3.0-trunkREV557.3 - migrate to systemd unit file * Fri Apr 19 2013 Tomasz Torcz - 3.3.0-trunkREV557.2 - synchronize with F-18 version: - patches for ARM compilation and newest ffmpeg (this undoes ffmpeg-compat support) - logrotate fixes * Wed Mar 20 2013 Nicolas Chauvet - 3.3.0-trunkREV534.7 - Move to ffmpeg-compat support - Add sqlite3 * Sun Mar 03 2013 Nicolas Chauvet - 3.3.0-trunkREV534.6 - Mass rebuilt for Fedora 19 Features * Wed Jan 30 2013 Nicolas Chauvet - 3.3.0-trunkREV534.5 - Rebuilt for ffmpeg * Sat Nov 24 2012 Nicolas Chauvet - 3.3.0-trunkREV534.4 - Rebuilt for FFmpeg 1.0 * Tue Jun 26 2012 Nicolas Chauvet - 3.3.0-trunkREV534.3 - Rebuilt for FFmpeg * Tue Feb 28 2012 Nicolas Chauvet - 3.3.0-trunkREV534.2 - Rebuilt for x264/FFmpeg * Wed Jan 25 2012 Nicolas Chauvet - 3.3.0-trunkREV534.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild