]> git.pld-linux.org Git - packages/zoneminder.git/blob - zoneminder.spec
- release 7 (by relup.sh)
[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.25.0
12 Release:        7
13 License:        GPL v2
14 Group:          Applications/Graphics
15 Source0:        http://www.zoneminder.com/downloads/ZoneMinder-%{version}.tar.gz
16 # Source0-md5:  eaefa14befd482154970541252aa1a39
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 Patch0:         zm-fedora.patch
25 Patch1:         %{name}-xlib_shm.patch
26 Patch2:         %{name}-build.patch
27 Patch3:         %{name}-init.patch
28 Patch4:         %{name}-1.25.0-gcc47.patch
29 Patch5:         %{name}-1.25.0-gcrypt.patch
30 Patch6:         %{name}-1.25.0-kernel35.patch
31 Patch7:         ffmpeg10.patch
32 Patch8:         format-security.patch
33 Patch9:         am.patch
34 Patch10:        ffmpeg-2.0.patch
35 URL:            http://www.zoneminder.com/
36 BuildRequires:  autoconf
37 BuildRequires:  automake
38 BuildRequires:  bzip2-devel
39 BuildRequires:  ffmpeg-devel >= 0.4.9-4.20090225
40 BuildRequires:  gnutls-devel
41 BuildRequires:  libjpeg-devel
42 BuildRequires:  libstdc++-devel
43 BuildRequires:  mysql-devel
44 BuildRequires:  pcre-devel
45 BuildRequires:  perl-devel
46 BuildRequires:  perl-DBD-mysql
47 BuildRequires:  perl-DBI
48 BuildRequires:  perl-Date-Manip
49 BuildRequires:  perl-libwww
50 BuildRequires:  perl-PHP-Serialization
51 BuildRequires:  perl-Sys-Mmap
52 BuildRequires:  rpmbuild(macros) >= 1.268
53 BuildRequires:  xorg-lib-libXv-devel
54 Requires(post,preun):   /sbin/chkconfig
55 Requires:       perl-DBD-mysql
56 Requires:       perl-Date-Manip
57 Requires:       perl-MIME-tools
58 Requires:       perl-PHP-Serialization
59 Requires:       perl-Sys-Mmap
60 Requires:       php(mysql)
61 Requires:       php(pcre)
62 Requires:       rc-scripts
63 Requires:       webapps
64 Requires:       webserver(php)
65 Suggests:       cambozola
66 Suggests:       perl-MIME-Lite
67 Obsoletes:      zm
68 Obsoletes:      zm-X10
69 Obsoletes:      zoneminder-X10
70 Obsoletes:      zm-control
71 Obsoletes:      zoneminder-control
72 Conflicts:      apache-base < 2.4.0-1
73 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
74
75 %define         specflags       -D__STDC_CONSTANT_MACROS
76
77 %define         _webapps        /etc/webapps
78 %define         _webapp         %{name}
79 %define         _appdir         %{_datadir}/%{_webapp}
80
81 %description
82 ZoneMinder is a set of applications which is intended to provide a
83 complete solution allowing you to capture, analyse, record and monitor
84 any cameras you have attached to a Linux based machine. It is designed
85 to run on kernels which support the Video For Linux (V4L) interface
86 and has been tested with cameras attached to BTTV cards, various USB
87 cameras and IP network cameras.
88
89 %description -l pl.UTF-8
90 ZoneMinder to zestaw aplikacji mających dostarczyć kompletne
91 rozwiązanie pozwalające na przechwytywanie, analizę, nagrywanie i
92 monitorowanie kamer podłączonych do maszyny z Linuksem. Jest
93 zaprojektowany do działania z jądrami obsługującymi interfejs Video
94 For Linux (V4L) i był testowany z kamerami podłączonymi do kart BTTV,
95 różnymi kamerami USB i sieciowymi kamerami IP.
96
97 %prep
98 %setup -q -n ZoneMinder-%{version} -a4
99 %undos scripts/zm.in
100
101 %patch0 -p1
102 cd xlib_shm-*
103 %patch1 -p1
104 cd ..
105 %patch2 -p1
106 %patch3 -p1
107 %patch4 -p1
108 %patch5 -p1
109 %patch6 -p1
110 %patch7 -p1
111 %patch8 -p1
112 %patch9 -p1
113 %patch10 -p1
114
115 sed -i -e 's#-frepo##g' src/Makefile.am
116 sed -i -e 's#chown#true#g' -e 's#chmod#true#g' *.am */*.am */*/*.am
117
118 cat <<'EOF' >> db/zm_create.sql.in
119 UPDATE Config SET Value = '/cgi-bin/zoneminder/nph-zms' WHERE Name = 'ZM_PATH_ZMS';
120 UPDATE Config SET Value = '/var/run/zoneminder' WHERE Name = 'ZM_PATH_SOCKS';
121 UPDATE Config SET Value = '/var/log/zoneminder' WHERE Name = 'ZM_PATH_LOGS';
122 GRANT SELECT,INSERT,UPDATE,DELETE ON zm.* TO 'zmuser'@localhost IDENTIFIED BY 'zmpass';
123 EOF
124
125 %build
126 %{__aclocal}
127 %{__autoconf}
128 %{__automake}
129 %configure \
130         --with-libarch=%{_lib} \
131 %ifarch %{ix86} %{x8664}
132         --enable-crashtrace \
133 %else
134         --disable-crashtrace \
135 %endif
136         --enable-mmap=yes \
137         --disable-debug \
138         --with-mysql=%{_prefix} \
139         --with-ffmpeg           \
140         --with-webgroup=http    \
141         --with-webuser=http              \
142         --with-webdir=%{_appdir}/www    \
143         --with-cgidir=%{_libdir}/%{name}/cgi-bin
144
145 %{__make}
146
147 %{__perl} -pi \
148                 -e 's/(ZM_WEB_USER=).*$/${1}http/;' \
149                 -e 's/(ZM_WEB_GROUP=).*$/${1}http/;' zm.conf
150
151 %{__cc} %{rpmcflags} %{rpmldflags} xlib_shm-*/xlib_shm.c -lXv -lXext -lX11 -lmysqlclient -o zm_xlib_shm
152
153 %install
154 rm -rf $RPM_BUILD_ROOT
155 install -d $RPM_BUILD_ROOT{%{_localstatedir}/{run,log/zoneminder},/etc/logrotate.d} \
156         $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
157
158 %{__make} install \
159         DESTDIR=$RPM_BUILD_ROOT \
160         INSTALLDIRS=vendor
161
162 rm -rf $RPM_BUILD_ROOT%{_prefix}/%{_lib}/perl5/vendor_perl/*.*/*-*
163 rm -rf $RPM_BUILD_ROOT%{_prefix}/%{_lib}/perl5/*.*/*-*
164 rm -f $RPM_BUILD_ROOT%{_bindir}/zmx10.pl
165
166 install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/log/zoneminder
167 for dir in events images temp
168 do
169         install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/lib/zoneminder/$dir
170         rm -rf $RPM_BUILD_ROOT%{_appdir}/www/$dir
171         ln -sf ../../../..%{_localstatedir}/lib/zoneminder/$dir $RPM_BUILD_ROOT%{_appdir}/www/$dir
172 done
173 install -D -m 755 scripts/zm $RPM_BUILD_ROOT/etc/rc.d/init.d/zoneminder
174 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
175 install %{SOURCE5} $RPM_BUILD_ROOT%{_appdir}/www
176
177 install zm_xlib_shm $RPM_BUILD_ROOT%{_bindir}
178
179 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
180
181 %clean
182 rm -rf $RPM_BUILD_ROOT
183
184 %post
185 /sbin/chkconfig --add zoneminder
186
187 %preun
188 if [ "$1" = "0" ]; then
189         %service zoneminder stop
190         /sbin/chkconfig --del zoneminder
191 fi
192
193 %triggerin -- apache-base
194 %webapp_register httpd %{_webapp}
195
196 %triggerun -- apache-base
197 %webapp_unregister httpd %{_webapp}
198
199 %triggerpostun -- %{name} < 1.25.0-6
200 if [ -f %{_sysconfdir}/httpd/conf.d/zoneminder.conf.rpmsave ]; then
201         mv %{_sysconfdir}/httpd/conf.d/zoneminder.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf.rpmsave
202         echo "Old apache config has been saved as %{_webapps}/%{_webapp}/httpd.conf.rpmsave"
203 fi
204 exit 0
205
206 %files
207 %defattr(644,root,root,755)
208 %doc AUTHORS README
209 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
210 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
211 %config(noreplace) %attr(640,root,http) %{_sysconfdir}/zm.conf
212 %config(noreplace) /etc/logrotate.d/%{name}
213 %attr(754,root,root) /etc/rc.d/init.d/zoneminder
214 %attr(4755,root,root) %{_bindir}/zmfix
215 %attr(755,root,root) %{_bindir}/zma
216 %attr(755,root,root) %{_bindir}/zmaudit.pl
217 %attr(755,root,root) %{_bindir}/zmcontrol.pl
218 %attr(755,root,root) %{_bindir}/zmc
219 %attr(755,root,root) %{_bindir}/zmdc.pl
220 %attr(755,root,root) %{_bindir}/zmf
221 %attr(755,root,root) %{_bindir}/zmfilter.pl
222 %attr(755,root,root) %{_bindir}/zmpkg.pl
223 %attr(755,root,root) %{_bindir}/zmstreamer
224 %attr(755,root,root) %{_bindir}/zmtrack.pl
225 %attr(755,root,root) %{_bindir}/zmtrigger.pl
226 %attr(755,root,root) %{_bindir}/zmu
227 %attr(755,root,root) %{_bindir}/zmupdate.pl
228 %attr(755,root,root) %{_bindir}/zmvideo.pl
229 %attr(755,root,root) %{_bindir}/zmwatch.pl
230 %attr(755,root,root) %{_bindir}/zm_xlib_shm
231 %dir %{_datadir}/ZoneMinder
232 %{_datadir}/ZoneMinder/db
233 %dir %{_appdir}
234 %dir %{_appdir}/www
235 %{_appdir}/www/*.*
236 %{_appdir}/www/ajax
237 %{_appdir}/www/css
238 %dir %{_appdir}/www/events
239 %{_appdir}/www/graphics
240 %dir %{_appdir}/www/images
241 %{_appdir}/www/includes
242 %{_appdir}/www/js
243 %{_appdir}/www/lang
244 %{_appdir}/www/skins
245 %{_appdir}/www/sounds
246 %dir %{_appdir}/www/temp
247 %{_appdir}/www/tools
248 %{_appdir}/www/views
249 %dir %{_libdir}/%{name}
250 %dir %{_libdir}/%{name}/cgi-bin
251 %attr(755,root,root) %{_libdir}/%{name}/cgi-bin/nph-zms
252 %attr(755,root,root) %{_libdir}/%{name}/cgi-bin/zms
253
254 %dir %attr(770,root,http) /var/log/zoneminder
255 %dir %attr(750,root,http) /var/lib/zoneminder
256 %dir %attr(770,root,http) /var/lib/zoneminder/events
257 %dir %attr(770,root,http) /var/lib/zoneminder/images
258 %dir %attr(770,root,http) /var/lib/zoneminder/temp
259
260 %{perl_vendorlib}/ZoneMinder
261 %{perl_vendorlib}/*.pm
262 %{_mandir}/man3/ZoneMinder*3pm*
This page took 0.081935 seconds and 3 git commands to generate.