Advertisement
barjac

zm.spec

Aug 20th, 2011
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.97 KB | None | 0 0
  1. %define zmuid $(id -un)
  2. %define zmgid $(id -gn)
  3. %define zmuid_final apache
  4. %define zmgid_final apache
  5.  
  6. Name: zoneminder
  7. Version: 1.24.4
  8. Release: 0%{?dist}
  9. Summary: A camera monitoring and analysis tool
  10. Group: System Environment/Daemons
  11. # jscalendar is LGPL (any version): http://www.dynarch.com/projects/calendar/
  12. # Mootools is under the MIT license: http://mootools.net/
  13. License: GPLv2+ and LGPLv2+ and MIT
  14. URL: http://www.zoneminder.com/
  15. # BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  16.  
  17. Source: http://www.zoneminder.com/fileadmin/downloads/ZoneMinder-%{version}.tar.gz
  18.  
  19. #Source1: http://www.charliemouse.com/code/cambozola/cambozola-0.92.tar.gz
  20. Source1: cambozola-0.92.tar.gz
  21. Source2: zoneminder.conf
  22. Source3: redalert.wav
  23. Source4: README.Mageia
  24. Source5: http://downloads.sourceforge.net/jscalendar/jscalendar-1.0.zip
  25. Source6: http://mootools.net/download/get/mootools-1.2.3-core-yc.js
  26. #Patch1: zoneminder-1.24.2-dbinstall.patch
  27. #Patch2: zoneminder-1.24.1-runlevel.patch
  28. #Patch3: zoneminder-1.24.2-noffmpeg.patch
  29. #Patch4: zoneminder-1.24.1-perldep.patch
  30. #Patch10: zoneminder-1.22.3-installfix.patch
  31. #Patch11: zoneminder-1.24.2-gcc44.patch
  32. Patch12: zm_rtsp.patch
  33. Patch13: zm_signal.patch
  34.  
  35. Conflicts: zm <= 1.22.3
  36.  
  37. BuildRequires: automake gnutls-devel
  38. BuildRequires: mysql-devel pcre-devel perl-DBD-mysql perl-Date-Manip
  39. BuildRequires: ffmpeg ffmpeg-devel perl-Device-SerialPort perl-Archive-Zip
  40. BuildRequires: perl-MIME-Lite perl-MIME-tools perl-Archive-Tar perl-libwww-perl
  41. BuildRequires: perl-PHP-Serialization
  42.  
  43.  
  44. Requires: httpd php php-mysql
  45. Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
  46. Requires: perl-DBD-mysql perl-Archive-Tar perl-Archive-Zip perl-Date-Manip
  47. Requires: perl-Net-FTP-Common perl-MIME-Lite
  48. Requires(post): /sbin/chkconfig
  49. Requires(preun): /sbin/chkconfig
  50. Requires(preun): /sbin/service
  51. Requires(postun): /sbin/service
  52.  
  53.  
  54. %description
  55. ZoneMinder is a set of applications which is intended to provide a complete
  56. solution allowing you to capture, analyse, record and monitor any cameras you
  57. have attached to a Linux based machine. It is designed to run on kernels which
  58. support the Video For Linux (V4L) interface and has been tested with cameras
  59. attached to BTTV cards, various USB cameras and IP network cameras. It is
  60. designed to support as many cameras as you can attach to your computer without
  61. too much degradation of performance. This package includes cambozola.jar.
  62.  
  63.  
  64. %prep
  65. %setup -q -n ZoneMinder-%{version}
  66.  
  67. # Unpack jscalendar and move some files around
  68. %setup -q -D -T -a 5 -n ZoneMinder-%{version}
  69. mkdir jscalendar-doc
  70. pushd jscalendar-1.0
  71. mv *html *php doc/* README ../jscalendar-doc
  72. rmdir doc
  73. popd
  74. %patch12 -p0
  75. %patch13 -p0
  76. # %patch1 -p0 -b .dbinstall
  77. # %patch2 -p0 -b .runlevel
  78. # %patch3 -p0 -b .noffmpeg
  79. # %patch4 -p0 -b .perldep
  80. # %patch10 -p0 -b .installfix
  81. # %patch11 -p0 -b .gcc44
  82. gunzip -c %{SOURCE1} | tar xf - cambozola-0.92/dist/cambozola.jar
  83. cp %{SOURCE4} README.Mageia
  84.  
  85. cat <<EOF >> db/zm_create.sql.in
  86. update Config set Value = '/cgi-bin/zm/nph-zms' where Name = 'ZM_PATH_ZMS';
  87. use mysql;
  88. grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass';
  89. EOF
  90.  
  91.  
  92. %build
  93. autoreconf
  94.  
  95. OPTS=""
  96. %ifnarch %{ix86} x86_64
  97. OPTS="$OPTS --disable-crashtrace"
  98. %endif
  99.  
  100. %configure \
  101. --with-libarch=%{_lib} \
  102. --with-mysql=%{_prefix} \
  103. --with-webdir=%{_datadir}/%{name}/www \
  104. --with-cgidir=%{_libexecdir}/%{name}/cgi-bin \
  105. --with-webuser=%{zmuid} \
  106. --with-webgroup=%{zmgid} \
  107. --disable-debug \
  108. --enable-mmap=no \
  109. --disable-debug \
  110. "$OPTS" \
  111. CPPFLAGS="-D__STDC_CONSTANT_MACROS" \
  112.  
  113. make %{?_smp_mflags}
  114.  
  115. %{__perl} -pi -e 's/(ZM_WEB_USER=).*$/${1}%{zmuid_final}/;' \
  116. -e 's/(ZM_WEB_GROUP=).*$/${1}%{zmgid_final}/;' zm.conf
  117.  
  118.  
  119. %install
  120. rm -rf $RPM_BUILD_ROOT
  121.  
  122. install -d $RPM_BUILD_ROOT%{_localstatedir}/run
  123. make install DESTDIR=$RPM_BUILD_ROOT \
  124. INSTALLDIRS=vendor
  125. rm -rf $RPM_BUILD_ROOT%{perl_vendorarch} $RPM_BUILD_ROOT%{perl_archlib}
  126. rm -f $RPM_BUILD_ROOT%{_bindir}/zmx10.pl
  127.  
  128. install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/log/zoneminder
  129. for dir in events images temp
  130. do
  131. install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/lib/zoneminder/$dir
  132. rmdir $RPM_BUILD_ROOT%{_datadir}/%{name}/www/$dir
  133. ln -sf ../../../..%{_localstatedir}/lib/zoneminder/$dir $RPM_BUILD_ROOT%{_datadir}/%{name}/www/$dir
  134. done
  135. install -D -m 755 scripts/zm $RPM_BUILD_ROOT%{_initrddir}/zoneminder
  136. install -D -m 644 cambozola-*/dist/cambozola.jar $RPM_BUILD_ROOT%{_datadir}/%{name}/www/cambozola.jar
  137. install -D -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/zoneminder.conf
  138. install -D -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/%{name}/www/sounds/redalert.wav
  139.  
  140. # Install jscalendar - this really should be in its own package
  141. install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/www/jscalendar
  142. cp -rp jscalendar-1.0/* $RPM_BUILD_ROOT%{_datadir}/%{name}/www/jscalendar
  143.  
  144. # Install mootools
  145. pushd $RPM_BUILD_ROOT%{_datadir}/%{name}/www
  146. install -m 644 %{SOURCE6} mootools-1.2.3-core-yc.js
  147. ln -s mootools-1.2.3-core-yc.js mootools.js
  148. popd
  149.  
  150. %clean
  151. rm -rf $RPM_BUILD_ROOT
  152.  
  153.  
  154. %post
  155. /sbin/chkconfig --add zoneminder
  156.  
  157.  
  158. %preun
  159. if [ $1 -eq 0 ]; then
  160. /sbin/service zoneminder stop > /dev/null 2>&1 || :
  161. /sbin/chkconfig --del zoneminder
  162. fi
  163.  
  164.  
  165. %postun
  166. if [ $1 -ge 1 ]; then
  167. /sbin/service zoneminder condrestart > /dev/null 2>&1 || :
  168. fi
  169.  
  170.  
  171. %files
  172. %defattr(-,root,root,-)
  173. %doc AUTHORS COPYING README README.Fedora jscalendar-doc
  174. %config(noreplace) %attr(640,root,%{zmgid_final}) %{_sysconfdir}/zm.conf
  175. %config(noreplace) %attr(644,root,root) %{_sysconfdir}/httpd/conf.d/zoneminder.conf
  176. %attr(755,root,root) %{_initrddir}/zoneminder
  177.  
  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.  
  194. %{perl_vendorlib}/ZoneMinder*
  195. %{_mandir}/man*/*
  196. %dir %{_libexecdir}/%{name}
  197. %{_libexecdir}/%{name}/cgi-bin
  198. %dir %{_datadir}/%{name}
  199. %{_datadir}/%{name}/db
  200. %{_datadir}/%{name}/www
  201.  
  202. %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_localstatedir}/lib/zoneminder
  203. %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_localstatedir}/lib/zoneminder/events
  204. %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_localstatedir}/lib/zoneminder/images
  205. %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_localstatedir}/lib/zoneminder/temp
  206. %dir %attr(755,%{zmuid_final},%{zmgid_final}) %{_localstatedir}/log/zoneminder
  207.  
  208.  
  209. %changelog
  210. * Wed Jun 02 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.24.2-5
  211. - Mass rebuild with perl-5.12.0
  212.  
  213. * Fri Dec 4 2009 Stepan Kasal <skasal@redhat.com> - 1.24.2-4
  214. - rebuild against perl 5.10.1
  215. - use Perl vendorarch and archlib variables correctly
  216.  
  217. * Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.2-3
  218. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  219.  
  220. * Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-2
  221. - Bump release since 1.24.2-1 was mistakenly tagged a few months ago.
  222.  
  223. * Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-1
  224. - Initial update to 1.24.2.
  225. - Rebase patches.
  226. - Update mootools download location.
  227. - Update to mootools 1.2.3.
  228. - Add additional dependencies for some optional features.
  229.  
  230. * Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-3
  231. - Remove unused Sys::Mmap perl dependency RPM is finding
  232.  
  233. * Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-2
  234. - Update gcc44 patch to disable -frepo, seems to be broken with gcc44
  235. - Added noffmpeg patch to make building outside mock easier
  236.  
  237. * Sat Mar 21 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-1
  238. - Patch for gcc 4.4 compilation errors
  239. - Upgrade to 1.24.1
  240.  
  241. * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23.3-4
  242. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  243.  
  244. * Sat Jan 24 2009 Caolán McNamara <caolanm@redhat.com> - 1.23.3-3
  245. - rebuild for dependencies
  246.  
  247. * Mon Dec 15 2008 Martin Ebourne <martin@zepler.org> - 1.23.3-2
  248. - Fix permissions on zm.conf
  249.  
  250. * Fri Jul 11 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.23.3-1
  251. - Initial attempt at packaging 1.23.
  252.  
  253. * Tue Jul 1 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-15
  254. - Add perl module compat dependency, bz #453590
  255.  
  256. * Tue May 6 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-14
  257. - Remove default runlevel, bz #441315
  258.  
  259. * Mon Apr 28 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.22.3-13
  260. - Backport patch for CVE-2008-1381 from 1.23.3 to 1.22.3.
  261.  
  262. * Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.22.3-12
  263. - Autorebuild for GCC 4.3
  264.  
  265. * Thu Jan 3 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-11
  266. - Fix compilation on gcc 4.3
  267.  
  268. * Thu Dec 6 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-10
  269. - Rebuild for new openssl
  270.  
  271. * Thu Aug 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-8
  272. - Fix licence tag
  273.  
  274. * Thu Jul 12 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-7
  275. - Fixes from testing by Jitz including missing dependencies and database creation
  276.  
  277. * Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-6
  278. - Disable crashtrace on ppc
  279.  
  280. * Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-5
  281. - Fix uid for directories in /var/lib/zoneminder
  282.  
  283. * Tue Jun 26 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-4
  284. - Added perl Archive::Tar dependency
  285. - Disabled web interface due to lack of access control on the event images
  286.  
  287. * Sun Jun 10 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-3
  288. - Changes recommended in review by Jason Tibbitts
  289.  
  290. * Mon Apr 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-2
  291. - Standardised on package name of zoneminder
  292.  
  293. * Thu Dec 28 2006 Martin Ebourne <martin@zepler.org> - 1.22.3-1
  294. - 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