]> git.pld-linux.org Git - SPECS.git/blob - motion.spec
SPECS updated Sun 1 Aug 15:50:02 CEST 2021
[SPECS.git] / motion.spec
1 #
2 # Conditional builds:
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 
8 #
9 Summary:        Motion is a software motion detector
10 Summary(pl.UTF-8):      Motion - programowy wykrywacz ruchu
11 Name:           motion
12 Version:        4.0.1
13 Release:        1
14 License:        GPL
15 Group:          Applications/Graphics
16 Source0:        https://github.com/Motion-Project/motion/archive/release-%{version}.tar.gz
17 # Source0-md5:  5c87f90c4118d8cf0fb14700db69118f
18 Source1:        %{name}.init
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)
31
32 %description
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.
37
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.
43
44 %package init
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}
56 Requires:       rc-scripts
57 Provides:       group(motion)
58 Provides:       user(motion)
59
60 %description init
61 Init script for Motion.
62
63 %description init -l pl.UTF-8
64 Skrypt init dla systemu Motion.
65
66 %prep
67 %setup -q  -n motion-release-%{version}
68
69 %build
70 autoreconf -fvi
71 %configure \
72         --without-optimizecpu \
73         %{?!with_mysql:--without-mysql} \
74         %{?!with_pgsql:--without-pgsql} \
75         %{?!with_sqlite:--without-pgsql} \
76         %{?!with_v4l:--without-v4l}
77
78 %{__make}
79
80 %install
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
88
89 %{__make} install \
90         DESTDIR=$RPM_BUILD_ROOT
91
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
95
96 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/motion/camera*
97
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
101
102 %clean
103 rm -rf $RPM_BUILD_ROOT
104
105
106 %pre init
107 %groupadd -g 177 motion
108 %useradd -u 177 -g motion motion
109 /usr/sbin/usermod -G video motion 1>&2 > /dev/null
110
111 %post init
112 /sbin/chkconfig --add motion
113 %service motion restart
114
115 %preun init
116 if [ "$1" = "0" ]; then
117         %service motion stop
118         /sbin/chkconfig --del motion
119 fi
120
121 %postun init
122 if [ "$1" = "0" ]; then
123         %userremove motion
124         %groupremove motion
125 fi
126
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
131 fi
132
133 %files
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
140 %{_datadir}/motion
141 %{_mandir}/man1/*
142 %attr(750,motion,motion) %dir /var/run/%{name}
143
144 %files init
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}
This page took 0.503094 seconds and 3 git commands to generate.