3 %bcond_without pgsql # build PostgreSQL support
4 %bcond_without mysql # build MySQL support
5 %bcond_without sqlite # build SQLite support
6 %bcond_without xmlrpc # build XMLRPC support
7 %bcond_without v4l # build v4l support
9 Summary: Motion is a software motion detector
10 Summary(pl.UTF-8): Motion - programowy wykrywacz ruchu
15 Group: Applications/Graphics
16 Source0: https://github.com/Motion-Project/motion/archive/release-%{version}.tar.gz
17 # Source0-md5: 5c87f90c4118d8cf0fb14700db69118f
19 Source2: %{name}.sysconfig
20 Source3: %{name}.tmpfiles
21 URL: https://motion-project.github.io/
22 BuildRequires: autoconf
23 BuildRequires: automake
24 BuildRequires: ffmpeg-devel >= 0.7.1
25 BuildRequires: libjpeg-devel
26 %{?with_mysql:BuildRequires: mysql-devel}
27 %{?with_pgsql:BuildRequires: postgresql-devel}
28 %{?with_sqlite:BuildRequires: sqlite3-devel}
29 BuildRequires: rpmbuild(macros) >= 1.268
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 Motion is a software motion detector. It grabs images from video4linux
34 devices and/or from webcams (such as the axis network cameras). Motion
35 is the perfect tool for keeping an eye on your property keeping only
36 those images that are interesting.
38 %description -l pl.UTF-8
39 Motion to programowy wykrywacz ruchu. Przechwytuje obrazy z urządzeń
40 video4linux i/lib kamer (takich jak kamery sieciowe axis). Motion jest
41 doskonałym narzędziem do doglądania swojej posiadłości, przechowując
42 tylko interesujące obrazy.
45 Summary: Init script for Motion
46 Summary(pl.UTF-8): Skrypt init dla systemu Motion
47 Group: Applications/System
48 Requires(post,preun): /sbin/chkconfig
49 Requires(postun): /usr/sbin/groupdel
50 Requires(postun): /usr/sbin/userdel
51 Requires(pre): /bin/id
52 Requires(pre): /usr/bin/getgid
53 Requires(pre): /usr/sbin/groupadd
54 Requires(pre): /usr/sbin/useradd
55 Requires: %{name} = %{version}-%{release}
57 Provides: group(motion)
58 Provides: user(motion)
61 Init script for Motion.
63 %description init -l pl.UTF-8
64 Skrypt init dla systemu Motion.
67 %setup -q -n motion-release-%{version}
72 --without-optimizecpu \
73 %{?!with_mysql:--without-mysql} \
74 %{?!with_pgsql:--without-pgsql} \
75 %{?!with_sqlite:--without-pgsql} \
76 %{?!with_v4l:--without-v4l}
81 rm -rf $RPM_BUILD_ROOT
82 install -d $RPM_BUILD_ROOT%{_datadir}/%{name} \
83 $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \
84 $RPM_BUILD_ROOT%{_sysconfdir}/%{name} \
85 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
86 $RPM_BUILD_ROOT/var/run/%{name} \
87 $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
90 DESTDIR=$RPM_BUILD_ROOT
92 mv $RPM_BUILD_ROOT%{_datadir}/doc doc
93 mv $RPM_BUILD_ROOT%{_sysconfdir}/motion/motion-dist.conf \
94 $RPM_BUILD_ROOT%{_sysconfdir}/motion/motion.conf
96 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/motion/camera*
98 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
99 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
100 install %{SOURCE3} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
103 rm -rf $RPM_BUILD_ROOT
107 %groupadd -g 177 motion
108 %useradd -u 177 -g motion motion
109 /usr/sbin/usermod -G video motion 1>&2 > /dev/null
112 /sbin/chkconfig --add motion
113 %service motion restart
116 if [ "$1" = "0" ]; then
118 /sbin/chkconfig --del motion
122 if [ "$1" = "0" ]; then
127 %triggerpostun -- motion < 3.2.6-1
128 if [ -e /etc/motion.conf.rpmsave ]; then
129 cp /etc/motion/motion.conf /etc/motion/motion.conf.rpmnew
130 cp /etc/motion.conf.rpmsave /etc/motion/motion.conf
134 %defattr(644,root,root,755)
135 %doc CHANGELOG CREDITS FAQ README.md motion_guide.html *.conf
136 %attr(755,root,root) %{_bindir}/motion
137 %dir %{_sysconfdir}/%{name}
138 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/motion/motion.conf
139 /usr/lib/tmpfiles.d/%{name}.conf
142 %attr(750,motion,motion) %dir /var/run/%{name}
145 %defattr(644,root,root,755)
146 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
147 %attr(754,root,root) /etc/rc.d/init.d/%{name}