Advertisement
barjac

zoneminder.spec

Sep 10th, 2011
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.01 KB | None | 0 0
  1. %bcond_without tainted
  2. %bcond_with debug
  3.  
  4. %define name zoneminder
  5. %define version 1.24.4
  6. %define release %mkrel 0
  7. %define zmuid apache
  8. %define zmgid apache
  9. %define initdir /etc/rc.d/init.d
  10.  
  11. Name: %{name}
  12. Version: %{version}
  13. Release: %{release}
  14. Summary: Video Camera and CCTV Security with Motion Detection
  15. Group: Video
  16. License: GPLv2+ and LGPLv2+ and MIT
  17. # jscalendar is LGPL (any version): http://www.dynarch.com/projects/calendar/old/
  18. # Mootools is under the MIT license: http://mootools.net/
  19. URL: http://www.zoneminder.com/
  20.  
  21. Source: http://www.zoneminder.com/fileadmin/downloads/ZoneMinder-%{version}.tar.gz
  22. Source1: cambozola.jar
  23. Source2: zoneminder.conf
  24. Source3: redalert.wav
  25. Source4: README.Mageia
  26. Source5: http://downloads.sourceforge.net/jscalendar/jscalendar-1.0.zip
  27. Source6: http://mootools.net/download/get/mootools-1.2.3-core-yc.js
  28. Source7: zmsetup
  29. Source8: zm_perf.sql
  30.  
  31. Patch1: zm_1_24_4-perfpatch_v1m.patch
  32. Patch2: zm_1_24_4-zm_image.h.patch
  33. Patch3: zm_1_24_4-chown.patch
  34. Patch4: zm_1_24_4-zm_create.sql.patch
  35.  
  36. BuildRequires: automake gnutls-devel
  37. BuildRequires: mysql-devel pcre-devel perl-DBD-mysql perl-Date-Manip
  38. BuildRequires: ffmpeg ffmpeg-devel perl-Device-SerialPort perl-Archive-Zip
  39. BuildRequires: perl-MIME-Lite perl-MIME-tools perl-Archive-Tar perl-libwww-perl
  40. BuildRequires: perl-PHP-Serialization perl-Sys-Mmap libjpeg-static-devel
  41.  
  42. Requires: apache mysql php php-mysql apache-mod_php
  43. Requires: perl-DBD-mysql perl-Archive-Tar perl-Archive-Zip perl-Date-Manip
  44. Requires: perl-Net-FTP-Common perl-MIME-Lite perl-Sys-Mmap
  45.  
  46. %if %{with tainted}
  47. Requires: ffmpeg lame
  48. %endif
  49.  
  50. %description
  51. ZoneMinder is intended for use in single or multi-camera video security applications,
  52. including commercial or home CCTV. It supports capture, analysis, recording, and monitoring
  53. of video data coming from one or more video or network cameras attached to a Linux system.
  54. ZoneMinder also supports web and semi-automatic control of Pan/Tilt/Zoom cameras using a
  55. variety of protocols.
  56. It is designed to run on distributions which support the Video For Linux (V4L) interface
  57. and has been tested with video cameras attached to BTTV cards, various USB cameras and also
  58. supports most IP network cameras. This package includes cambozola.jar and the performance patch by Kfir Itzhak.
  59.  
  60. %pre
  61. cat /proc/cpuinfo | grep -q sse2
  62. if [[ $? != 0 ]]; then
  63. echo "This package requires a cpu with sse2 support"
  64. exit 1
  65. fi
  66.  
  67. %prep
  68. %setup -q -n ZoneMinder-%{version}
  69.  
  70. # Unpack jscalendar and move some files around
  71. %setup -q -D -T -a 5 -n ZoneMinder-%{version}
  72. mkdir jscalendar-doc
  73. pushd jscalendar-1.0
  74. mv *html *php doc/* README ../jscalendar-doc
  75. rmdir doc
  76. popd
  77.  
  78. %patch1 -p1 -b .zm_1_24_4-perfpatch_v1m.patch
  79. %patch2 -p0 -b .zm_1_24_4-zm_image.h.patch
  80. %patch3 -p1 -b .zm_1_24_4-chown.patch
  81. %patch4 -p0 -b .zm_1_24_4-zm_create.sql.patch
  82.  
  83. cp %{SOURCE4} README.Mageia
  84.  
  85. %build
  86. aclocal
  87. autoconf
  88. automake
  89.  
  90. ./configure \
  91. --prefix=%{_prefix} \
  92. --mandir=%{_datadir}/man \
  93. --infodir=%{_datadir}/info \
  94. --datadir=%{_datadir} \
  95. --sysconfdir=%{_sysconfdir} \
  96. --localstatedir=%{_localstatedir}/lib \
  97. --with-libarch=lib \
  98. --with-mysql=%{_prefix} \
  99. --with-webdir=%{_localstatedir}/www/html/zm \
  100. --with-cgidir=%{_localstatedir}/www/cgi-bin \
  101. --with-webuser=%{zmuid} \
  102. --with-webgroup=%{zmgid} \
  103. --enable-mmap=yes \
  104. %if %{with debug}
  105. --enable-debug=yes \
  106. --enable-crashtrace=yes \
  107. %else
  108. --disable-debug \
  109. --disable-crashtrace \
  110. %endif
  111. %if %{with tainted}
  112. --with-ffmpeg=%{_prefix} \
  113. --with-extralibs="-lmp3lame" \
  114. %endif
  115. CPPFLAGS="-D__STDC_CONSTANT_MACROS -msse2" \
  116. LDFLAGS="$LDFLAGS -Wl,--build-id"
  117.  
  118. %make
  119.  
  120. %{__perl} -pi -e 's/(ZM_WEB_USER=).*$/${1}%{zmuid}/;' \
  121. -e 's/(ZM_WEB_GROUP=).*$/${1}%{zmgid}/;' zm.conf
  122.  
  123. %install
  124. rm -rf $RPM_BUILD_ROOT
  125.  
  126. install -d $RPM_BUILD_ROOT/var/run
  127.  
  128. make install DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor
  129. rm -rf $RPM_BUILD_ROOT%{perl_vendorarch} $RPM_BUILD_ROOT%{perl_archlib}
  130. rm -f $RPM_BUILD_ROOT%{_bindir}/zmx10.pl
  131.  
  132. for dir in events images temp
  133. do
  134. install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/www/html/zm/$dir
  135. done
  136.  
  137. install -D -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_localstatedir}/www/html/zm/cambozola.jar
  138. install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/log/zoneminder
  139. install -D -m 755 scripts/zm $RPM_BUILD_ROOT%{initdir}/zoneminder
  140.  
  141. install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
  142. install -D -m 755 db/zm_create.sql $RPM_BUILD_ROOT%{_datadir}/%{name}/zm_create.sql
  143. install -D -m 755 %{SOURCE8} $RPM_BUILD_ROOT%{_datadir}/%{name}/zm_perf.sql
  144.  
  145. install -D -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/zoneminder.conf
  146. install -D -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{_localstatedir}/www/html/zm/sounds/redalert.wav
  147. install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/log/zm
  148. install -D -m 755 %{SOURCE7} $RPM_BUILD_ROOT%{_bindir}/zmsetup
  149.  
  150. # Install jscalendar
  151. install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/www/jscalendar
  152. cp -rp jscalendar-1.0/* $RPM_BUILD_ROOT%{_localstatedir}/www/jscalendar
  153.  
  154. # Install mootools
  155. pushd $RPM_BUILD_ROOT%{_localstatedir}/www/html/zm
  156. install -m 644 %{SOURCE6} mootools-1.2.3-core-yc.js
  157. ln -s mootools-1.2.3-core-yc.js mootools.js
  158. popd
  159.  
  160. %post
  161. /sbin/chkconfig --add zoneminder
  162.  
  163. %preun
  164. if [ $1 -eq 0 ]; then
  165. /sbin/service zoneminder stop > /dev/null 2>&1 || :
  166. /sbin/chkconfig --del zoneminder
  167. fi
  168.  
  169. %postun
  170. if [ $1 -ge 1 ]; then
  171. /sbin/service zoneminder condrestart > /dev/null 2>&1 || :
  172. fi
  173.  
  174. %files
  175. %doc AUTHORS COPYING README README.Mageia jscalendar-doc
  176. %config(noreplace) %attr(640,root,%{zmgid}) %{_sysconfdir}/zm.conf
  177. %config(noreplace) %attr(644,root,root) %{_sysconfdir}/httpd/conf.d/zoneminder.conf
  178. %{_bindir}/zma
  179. %{_bindir}/zmaudit.pl
  180. %{_bindir}/zmc
  181. %{_bindir}/zmcontrol.pl
  182. %{_bindir}/zmdc.pl
  183. %{_bindir}/zmf
  184. %{_bindir}/zmfilter.pl
  185. %attr(4755,root,root) %{_bindir}/zmfix
  186. %{_bindir}/zmpkg.pl
  187. %{_bindir}/zmtrack.pl
  188. %{_bindir}/zmtrigger.pl
  189. %{_bindir}/zmu
  190. %{_bindir}/zmupdate.pl
  191. %{_bindir}/zmvideo.pl
  192. %{_bindir}/zmwatch.pl
  193. %{_bindir}/zmstreamer
  194. %{_bindir}/zmsetup
  195. %{perl_vendorlib}/ZoneMinder*
  196. %{_mandir}/man*/*
  197. %{_localstatedir}/www/cgi-bin
  198. %{_datadir}/%{name}
  199. %attr(755,%{zmuid},%{zmgid}) %{_localstatedir}/www/jscalendar
  200. %attr(755,%{zmuid},%{zmgid}) %{_localstatedir}/www/html/zm
  201. %dir %attr(755,%{zmuid},%{zmgid}) %{_localstatedir}/log/zm
  202. %attr(755,root,root) %{initdir}/zoneminder
  203.  
  204. # Uncomment to keep buildroot
  205. # %clean
  206.  
  207. %changelog
  208. * Thu Sep 8 2011 Barry Jackson <zen25000@zen.co.uk> - 1.24.4-0
  209. - Complete re-package (using some elements of a Fedora spec)
  210. - and version update for Mageia.
  211. - Includes the performance patch by Kfir Itzhak :-
  212. - http://www.zoneminder.com/forums/viewtopic.php?f=9&t=17652
  213.  
  214. * Wed Jun 02 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.24.2-5
  215. - Mass rebuild with perl-5.12.0
  216.  
  217. * Fri Dec 4 2009 Stepan Kasal <skasal@redhat.com> - 1.24.2-4
  218. - rebuild against perl 5.10.1
  219. - use Perl vendorarch and archlib variables correctly
  220.  
  221. * Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.2-3
  222. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  223.  
  224. * Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-2
  225. - Bump release since 1.24.2-1 was mistakenly tagged a few months ago.
  226.  
  227. * Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-1
  228. - Initial update to 1.24.2.
  229. - Rebase patches.
  230. - Update mootools download location.
  231. - Update to mootools 1.2.3.
  232. - Add additional dependencies for some optional features.
  233.  
  234. * Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-3
  235. - Remove unused Sys::Mmap perl dependency RPM is finding
  236.  
  237. * Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-2
  238. - Update gcc44 patch to disable -frepo, seems to be broken with gcc44
  239. - Added noffmpeg patch to make building outside mock easier
  240.  
  241. * Sat Mar 21 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-1
  242. - Patch for gcc 4.4 compilation errors
  243. - Upgrade to 1.24.1
  244.  
  245. * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23.3-4
  246. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  247.  
  248. * Sat Jan 24 2009 Caolรกn McNamara <caolanm@redhat.com> - 1.23.3-3
  249. - rebuild for dependencies
  250.  
  251. * Mon Dec 15 2008 Martin Ebourne <martin@zepler.org> - 1.23.3-2
  252. - Fix permissions on zm.conf
  253.  
  254. * Fri Jul 11 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.23.3-1
  255. - Initial attempt at packaging 1.23.
  256.  
  257. * Tue Jul 1 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-15
  258. - Add perl module compat dependency, bz #453590
  259.  
  260. * Tue May 6 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-14
  261. - Remove default runlevel, bz #441315
  262.  
  263. * Mon Apr 28 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.22.3-13
  264. - Backport patch for CVE-2008-1381 from 1.23.3 to 1.22.3.
  265.  
  266. * Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.22.3-12
  267. - Autorebuild for GCC 4.3
  268.  
  269. * Thu Jan 3 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-11
  270. - Fix compilation on gcc 4.3
  271.  
  272. * Thu Dec 6 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-10
  273. - Rebuild for new openssl
  274.  
  275. * Thu Aug 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-8
  276. - Fix licence tag
  277.  
  278. * Thu Jul 12 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-7
  279. - Fixes from testing by Jitz including missing dependencies and database creation
  280.  
  281. * Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-6
  282. - Disable crashtrace on ppc
  283.  
  284. * Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-5
  285. - Fix uid for directories in /var/lib/zoneminder
  286.  
  287. * Tue Jun 26 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-4
  288. - Added perl Archive::Tar dependency
  289. - Disabled web interface due to lack of access control on the event images
  290.  
  291. * Sun Jun 10 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-3
  292. - Changes recommended in review by Jason Tibbitts
  293.  
  294. * Mon Apr 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-2
  295. - Standardised on package name of zoneminder
  296.  
  297. * Thu Dec 28 2006 Martin Ebourne <martin@zepler.org> - 1.22.3-1
  298. - First version. Uses some parts from zm-1.20.1 by Corey DeLasaux and Serg Oskin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement