]> git.pld-linux.org Git - packages/zoneminder.git/blob - zoneminder.spec
- fix/update patch
[packages/zoneminder.git] / zoneminder.spec
1 # TODO:
2 # - files check
3 # - no globs for suid/sgid files
4 # - it requires some magick to work with cambozola
5 # - check default configuration in zm_create.sql (wrong paths: /tmp/, /usr/local/bin)
6 # - fix Group(?)
7 #
8 Summary:        Zone Minder is a software motion detector with nice WWW GUI
9 Summary(pl.UTF-8):      Zone Minder - programowy wykrywacz ruchu z miłym GUI przez WWW
10 Name:           zoneminder
11 Version:        1.28.0
12 Release:        6
13 License:        GPL v2
14 Group:          Applications/Graphics
15 Source0:        https://github.com/ZoneMinder/ZoneMinder/archive/v%{version}.tar.gz
16 # Source0-md5:  b0317c6fe003de9a0c7c76078b0adc2b
17 Source1:        zm-init
18 Source2:        zm.conf
19 Source3:        zm-logrotate_d
20 Source4:        http://dig.hopto.org/xlib_shm/xlib_shm-0.6.3.tar.bz2
21 # Source4-md5:  469a65bdf658e68e23445f5cc6f07f07
22 # http://mootools.net/download
23 Source5:        mootools.js
24 Source6:        %{name}-tmpfiles.conf
25 Source7:        http://downloads.sourceforge.net/jscalendar/jscalendar-1.0.zip
26 # Source7-md5:  10f2160fe68294013efcd1473cd36f72
27 Patch1:         %{name}-xlib_shm.patch
28 Patch2:         %{name}-build.patch
29 Patch3:         %{name}-init.patch
30 Patch4:         ffmpeg3.patch
31 Patch5:         %{name}-types.patch
32 Patch6:         ffmpeg4.patch
33 URL:            http://www.zoneminder.com/
34 BuildRequires:  autoconf >= 2.59
35 BuildRequires:  automake
36 BuildRequires:  bzip2-devel
37 BuildRequires:  curl-devel
38 BuildRequires:  ffmpeg-devel >= 0.4.9-4.20090225
39 # scanf m modifier
40 BuildRequires:  glibc-devel >= 6:2.7
41 BuildRequires:  gnutls-devel
42 BuildRequires:  libjpeg-devel
43 BuildRequires:  libstdc++-devel
44 BuildRequires:  libx264-devel
45 BuildRequires:  mysql-devel
46 BuildRequires:  openssl-devel
47 BuildRequires:  pcre-devel
48 BuildRequires:  perl-DBD-mysql
49 BuildRequires:  perl-DBI
50 BuildRequires:  perl-Date-Manip
51 BuildRequires:  perl-Sys-Mmap
52 BuildRequires:  perl-devel >= 1:5.6.0
53 BuildRequires:  perl-libwww
54 BuildRequires:  pkgconfig
55 BuildRequires:  polkit-devel
56 BuildRequires:  rpmbuild(macros) >= 1.268
57 BuildRequires:  vlc-devel
58 BuildRequires:  xorg-lib-libXv-devel
59 BuildRequires:  zlib-devel
60 Requires(post,preun):   /sbin/chkconfig
61 Requires:       perl-DBD-mysql
62 Requires:       perl-Date-Manip
63 Requires:       perl-PHP-Serialization
64 Requires:       perl-Sys-Mmap
65 Requires:       php(mysql)
66 Requires:       php(pcre)
67 Requires:       rc-scripts
68 Requires:       webapps
69 Requires:       webserver(php)
70 Suggests:       cambozola
71 Suggests:       perl-Archive-Zip
72 # for RS232/RS486 PTZ cameras
73 Suggests:       perl-Device-SerialPort
74 # for sftp event uploading
75 Suggests:       perl-Expect
76 # for event mail notification
77 Suggests:       perl-MIME-tools
78 Suggests:       perl-MIME-Lite
79 # for sftp event uploading
80 Suggests:       perl-Net-SFTP
81 Suggests:       perl-Net-SFTP-Foreign
82 # for PTZ cameras
83 Suggests:       perl-Module-Load
84 # for X.10 support (TODO)
85 #Suggests:      perl-X10
86 Obsoletes:      zm
87 Obsoletes:      zm-X10
88 Obsoletes:      zm-control
89 Obsoletes:      zoneminder-X10
90 Obsoletes:      zoneminder-control
91 Conflicts:      apache-base < 2.4.0-1
92 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
93
94 %define         specflags       -D__STDC_CONSTANT_MACROS
95
96 %define         _webapps        /etc/webapps
97 %define         _webapp         %{name}
98 %define         _appdir         %{_datadir}/%{_webapp}
99
100 %description
101 ZoneMinder is a set of applications which is intended to provide a
102 complete solution allowing you to capture, analyse, record and monitor
103 any cameras you have attached to a Linux based machine. It is designed
104 to run on kernels which support the Video For Linux (V4L) interface
105 and has been tested with cameras attached to BTTV cards, various USB
106 cameras and IP network cameras.
107
108 %description -l pl.UTF-8
109 ZoneMinder to zestaw aplikacji mających dostarczyć kompletne
110 rozwiązanie pozwalające na przechwytywanie, analizę, nagrywanie i
111 monitorowanie kamer podłączonych do maszyny z Linuksem. Jest
112 zaprojektowany do działania z jądrami obsługującymi interfejs Video
113 For Linux (V4L) i był testowany z kamerami podłączonymi do kart BTTV,
114 różnymi kamerami USB i sieciowymi kamerami IP.
115
116 %prep
117 %setup -q -n ZoneMinder-%{version} -a4 -a7
118 %undos scripts/zm.in
119
120 cd xlib_shm-*
121 %patch1 -p1
122 cd ..
123 %patch2 -p1
124 %patch3 -p1
125 %patch4 -p1
126 %patch5 -p1
127 %patch6 -p1
128
129 sed -i -e 's#-frepo##g' src/Makefile.am
130 sed -i -e 's#chown#true#g' -e 's#chmod#true#g' *.am */*.am */*/*.am
131
132 cat <<'EOF' >> db/zm_create.sql.in
133 UPDATE Config SET Value = '/cgi-bin/zoneminder/nph-zms' WHERE Name = 'ZM_PATH_ZMS';
134 UPDATE Config SET Value = '/var/run/zoneminder' WHERE Name = 'ZM_PATH_SOCKS';
135 UPDATE Config SET Value = '/var/log/zoneminder' WHERE Name = 'ZM_PATH_LOGS';
136 GRANT SELECT,INSERT,UPDATE,DELETE ON zm.* TO 'zmuser'@localhost IDENTIFIED BY 'zmpass';
137 EOF
138
139 install -d jscalendar-doc
140 %{__mv} jscalendar-[0-9]*/{*html,*php,doc/*,README} jscalendar-doc
141 %{__rm} -r jscalendar-[0-9]*/doc
142
143 %build
144 %{__autoheader}
145 %{__aclocal}
146 %{__autoconf}
147 %{__automake}
148 %configure \
149         ZM_RUNDIR=%{_var}/run/zoneminder \
150         ZM_SOCKDIR=%{_var}/run/zoneminder \
151         ZM_LOGDIR=%{_var}/log/zoneminder \
152         --with-libarch=%{_lib} \
153         --enable-mmap=yes \
154         --disable-debug \
155         --with-mysql=%{_prefix} \
156         --with-ffmpeg \
157         --with-webgroup=http \
158         --with-webuser=http \
159         --with-webdir=%{_appdir}/www \
160         --with-cgidir=%{_libdir}/%{name}/cgi-bin
161
162 %{__make}
163
164 %{__perl} -pi \
165                 -e 's/(ZM_WEB_USER=).*$/${1}http/;' \
166                 -e 's/(ZM_WEB_GROUP=).*$/${1}http/;' zm.conf
167
168 %{__cc} %{rpmcflags} %{rpmldflags} xlib_shm-*/xlib_shm.c -lXv -lXext -lX11 -lmysqlclient -o zm_xlib_shm
169
170 %install
171 rm -rf $RPM_BUILD_ROOT
172 install -d $RPM_BUILD_ROOT{%{_localstatedir}/{run,log/zoneminder},/etc/logrotate.d} \
173         $RPM_BUILD_ROOT{%{_webapps}/%{_webapp},%{_sysconfdir}/tmpfiles.d}
174
175 %{__make} install \
176         DESTDIR=$RPM_BUILD_ROOT \
177         INSTALLDIRS=vendor
178
179 %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/%{_lib}/perl5/vendor_perl/*.*/*-*
180 %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/%{_lib}/perl5/*.*/*-*
181 %{__rm} $RPM_BUILD_ROOT%{_bindir}/zmx10.pl
182
183 install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/log/zoneminder
184 for dir in events images temp
185 do
186         install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/lib/zoneminder/$dir
187         rm -rf $RPM_BUILD_ROOT%{_appdir}/www/$dir
188         ln -sf ../../../..%{_localstatedir}/lib/zoneminder/$dir $RPM_BUILD_ROOT%{_appdir}/www/$dir
189 done
190 install -D -m 755 scripts/zm $RPM_BUILD_ROOT/etc/rc.d/init.d/zoneminder
191 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
192 install %{SOURCE5} $RPM_BUILD_ROOT%{_appdir}/www
193
194 install zm_xlib_shm $RPM_BUILD_ROOT%{_bindir}
195
196 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
197 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/%{name}.conf
198
199 # Install jscalendar - this really should be in its own package
200 install -d -m 755 $RPM_BUILD_ROOT%{_appdir}/www/jscalendar
201 cp -rp jscalendar-[0-9]*/* $RPM_BUILD_ROOT%{_appdir}/www/jscalendar
202
203 %clean
204 rm -rf $RPM_BUILD_ROOT
205
206 %post
207 /sbin/chkconfig --add zoneminder
208
209 %preun
210 if [ "$1" = "0" ]; then
211         %service zoneminder stop
212         /sbin/chkconfig --del zoneminder
213 fi
214
215 %triggerin -- apache-base
216 %webapp_register httpd %{_webapp}
217
218 %triggerun -- apache-base
219 %webapp_unregister httpd %{_webapp}
220
221 %triggerpostun -- %{name} < 1.25.0-6
222 if [ -f %{_sysconfdir}/httpd/conf.d/zoneminder.conf.rpmsave ]; then
223         mv %{_sysconfdir}/httpd/conf.d/zoneminder.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf.rpmsave
224         echo "Old apache config has been saved as %{_webapps}/%{_webapp}/httpd.conf.rpmsave"
225 fi
226 exit 0
227
228 %files
229 %defattr(644,root,root,755)
230 %doc AUTHORS BUGS ChangeLog README.md jscalendar-doc
231 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
232 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
233 %config(noreplace) %attr(640,root,http) %{_sysconfdir}/zm.conf
234 %config(noreplace) /etc/logrotate.d/%{name}
235 %{_sysconfdir}/tmpfiles.d/%{name}.conf
236 %attr(754,root,root) /etc/rc.d/init.d/zoneminder
237 %attr(755,root,root) %{_bindir}/zma
238 %attr(755,root,root) %{_bindir}/zmaudit.pl
239 %attr(755,root,root) %{_bindir}/zmcamtool.pl
240 %attr(755,root,root) %{_bindir}/zmcontrol.pl
241 %attr(755,root,root) %{_bindir}/zmc
242 %attr(755,root,root) %{_bindir}/zmdc.pl
243 %attr(755,root,root) %{_bindir}/zmf
244 %attr(755,root,root) %{_bindir}/zmfilter.pl
245 %attr(755,root,root) %{_bindir}/zmpkg.pl
246 %attr(755,root,root) %{_bindir}/zmstreamer
247 %attr(755,root,root) %{_bindir}/zmsystemctl.pl
248 %attr(755,root,root) %{_bindir}/zmtrack.pl
249 %attr(755,root,root) %{_bindir}/zmtrigger.pl
250 %attr(755,root,root) %{_bindir}/zmu
251 %attr(755,root,root) %{_bindir}/zmupdate.pl
252 %attr(755,root,root) %{_bindir}/zmvideo.pl
253 %attr(755,root,root) %{_bindir}/zmwatch.pl
254 %attr(755,root,root) %{_bindir}/zm_xlib_shm
255 %{_datadir}/polkit-1/actions/com.zoneminder.systemctl.policy
256 %{_datadir}/polkit-1/rules.d/com.zoneminder.systemctl.rules
257 %dir %{_appdir}
258 %{_appdir}/db
259 %dir %{_appdir}/www
260 %{_appdir}/www/*.*
261 %{_appdir}/www/ajax
262 %{_appdir}/www/css
263 %dir %{_appdir}/www/events
264 %{_appdir}/www/graphics
265 %dir %{_appdir}/www/images
266 %{_appdir}/www/includes
267 %{_appdir}/www/js
268 %{_appdir}/www/jscalendar
269 %{_appdir}/www/lang
270 %{_appdir}/www/skins
271 %{_appdir}/www/sounds
272 %dir %{_appdir}/www/temp
273 %{_appdir}/www/tools
274 %{_appdir}/www/views
275 %dir %{_libdir}/%{name}
276 %dir %{_libdir}/%{name}/cgi-bin
277 %attr(755,root,root) %{_libdir}/%{name}/cgi-bin/nph-zms
278 %attr(755,root,root) %{_libdir}/%{name}/cgi-bin/zms
279
280 %dir %attr(770,root,http) /var/log/zoneminder
281 %dir %attr(750,root,http) /var/lib/zoneminder
282 %dir %attr(770,root,http) /var/lib/zoneminder/events
283 %dir %attr(770,root,http) /var/lib/zoneminder/images
284 %dir %attr(770,root,http) /var/lib/zoneminder/temp
285
286 %{perl_vendorlib}/ZoneMinder
287 %{perl_vendorlib}/ZoneMinder.pm
288 %{_mandir}/man3/ZoneMinder*.3pm*
This page took 0.146988 seconds and 4 git commands to generate.