Advertisement
barjac

Untitled

Oct 30th, 2011
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.82 KB | None | 0 0
  1. %define zmuid apache
  2. %define zmgid apache
  3. %define tainted 0
  4.  
  5. %if "%distro_section" == "tainted"
  6. %global tainted 1
  7. %endif
  8.  
  9. Name: zoneminder
  10. Version: 1.25.0
  11. Release: %mkrel 1
  12. Summary: Video Camera and CCTV Security with Motion Detection
  13. Group: Video
  14. URL: http://www.zoneminder.com/
  15. License: GPLv2+ and MIT
  16. # Mootools is under the MIT license: http://mootools.net/
  17. # http://www.opensource.org/licenses/mit-license.php
  18.  
  19. Source: http://www.zoneminder.com/fileadmin/downloads/ZoneMinder-%{version}.tar.gz
  20. Source1: www.charliemouse.com/code/cambozola/cambozola-0.92.tar.gz
  21. Source2: zoneminder.conf
  22. Source3: redalert.wav
  23. Source4: README.Mageia
  24. Source5: zmrestart
  25. Source6: http://mootools.net/download/get/mootools-1.2.3-core-yc.js
  26. Source7: zmsetup
  27. Source8: zoneminder.service
  28.  
  29. # Removes hack and lets rpm set permissions
  30. Patch3: zm_1_25_0-chown.patch
  31. # Patch zm_create.sql.in (the Fedora/Mdv append method fails)
  32. Patch4: zm_1_25_0-zm_create.sql.patch
  33. # Patch for typo bug in zmupdate.pl
  34. Patch7: zm-1_25_0-zmupdate.pl.in.patch
  35.  
  36. BuildRequires: mysql-devel libjpeg-static-devel gnutls-devel
  37. BuildRequires: ant libgcrypt-devel pcre-devel
  38. BuildRequires: perl-Archive-Zip perl-Archive-Tar perl-MIME-tools perl-DBD-mysql
  39. BuildRequires: perl-Sys-Mmap perl-Device-SerialPort perl-MIME-Lite perl-Date-Manip
  40. BuildRequires: perl-libwww-perl
  41. BuildRequires: perl-X10 perl-Net-SSH-Expect perl-Net-SFTP-Foreign
  42.  
  43. %if %{tainted}
  44. BuildRequires: ffmpeg-devel ffmpeg
  45. %endif
  46.  
  47. Requires: apache mysql php php-mysql php-sockets apache-mod_php
  48. Requires: perl-Archive-Zip perl-Archive-Tar perl-MIME-tools perl-DBD-mysql
  49. Requires: perl-Sys-Mmap perl-Device-SerialPort perl-MIME-Lite perl-Date-Manip
  50. Requires: perl-libwww-perl
  51. Requires: perl-X10 perl-Net-SSH-Expect perl-Net-SFTP-Foreign
  52.  
  53.  
  54. %if %{tainted}
  55. Requires: ffmpeg lame
  56. %endif
  57.  
  58. %description
  59. A CCTV security package with remote access, motion detection and recording.
  60. ZoneMinder is intended for use in single or multi-camera video security
  61. applications, including commercial or home CCTV. It supports capture,
  62. analysis, recording, and monitoring of video data coming from one or more
  63. video or network cameras attached to a Linux system.
  64. ZoneMinder also supports web and semi-automatic control of Pan/Tilt/Zoom
  65. cameras using a variety of protocols.
  66. It is designed to run on distributions which support the Video For Linux (V4L)
  67. interface and has been tested with video cameras attached to BTTV cards,
  68. various USB cameras and also supports most IP network cameras.
  69.  
  70. %prep
  71. %setup -q -n ZoneMinder-%{version}
  72.  
  73. %patch3 -p1 -b .zm_1_24_4-chown.patch
  74. %patch4 -p0 -b .zm_1_24_4-zm_create.sql.patch
  75. %patch7 -p0 -b .zm-1_24_4-zmupdate.pl.in.patch
  76.  
  77. cp %{SOURCE4} README.Mageia
  78.  
  79. %setup -q -D -T -a 1 -n ZoneMinder-%{version}
  80. pushd cambozola-0.92
  81. %ant
  82. popd
  83.  
  84. %build
  85. aclocal
  86. autoconf
  87. automake
  88.  
  89. %configure \
  90. --prefix=%{_prefix} \
  91. --mandir=%{_datadir}/man \
  92. --infodir=%{_datadir}/info \
  93. --datadir=%{_datadir} \
  94. --sysconfdir=%{_sysconfdir} \
  95. --localstatedir=%{_localstatedir}/lib \
  96. --with-libarch=lib \
  97. --with-mysql=%{_prefix} \
  98. --with-webdir=%{_localstatedir}/www/html/zm \
  99. --with-cgidir=%{_localstatedir}/www/cgi-bin \
  100. --with-webuser=%{zmuid} \
  101. --with-webgroup=%{zmgid} \
  102. --enable-mmap=yes \
  103. --disable-debug \
  104. --disable-crashtrace \
  105. %if %{tainted}
  106. --with-ffmpeg=%{_prefix} \
  107. --with-extralibs="-lmp3lame" \
  108. %endif
  109. CPPFLAGS="-D__STDC_CONSTANT_MACROS" \
  110. LDFLAGS="$LDFLAGS -Wl,--build-id"
  111.  
  112. %make
  113.  
  114. %{__perl} -pi -e 's/(ZM_WEB_USER=).*$/${1}%{zmuid}/;' \
  115. -e 's/(ZM_WEB_GROUP=).*$/${1}%{zmgid}/;' zm.conf
  116.  
  117. %install
  118. rm -rf $RPM_BUILD_ROOT
  119.  
  120. install -d $RPM_BUILD_ROOT/var/run
  121.  
  122. make install DESTDIR=$RPM_BUILD_ROOT INSTALLDIRS=vendor
  123. rm -rf $RPM_BUILD_ROOT%{perl_vendorarch} $RPM_BUILD_ROOT%{perl_archlib}
  124. rm -f $RPM_BUILD_ROOT%{_bindir}/zmx10.pl
  125.  
  126. for dir in events images temp
  127. do
  128. install -m 755 -d $RPM_BUILD_ROOT%{_localstatedir}/www/html/zm/$dir
  129. done
  130. install -D -m 775 cambozola-0.92/dist/cambozola.jar $RPM_BUILD_ROOT%{_localstatedir}/www/html/zm/cambozola.jar
  131. install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/log/zoneminder
  132. install -D -m 755 scripts/zm $RPM_BUILD_ROOT%{_initrddir}/zoneminder
  133. install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
  134. install -d -m 755 db $RPM_BUILD_ROOT%{_datadir}/%{name}/db
  135. install -D -m 755 db/* $RPM_BUILD_ROOT%{_datadir}/%{name}/db
  136. install -D -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/zoneminder.conf
  137. install -D -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{_localstatedir}/www/html/zm/sounds/redalert.wav
  138. install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/log/zm
  139. install -D -m 755 %{SOURCE7} $RPM_BUILD_ROOT%{_bindir}/zmsetup
  140. install -D -m 755 %{SOURCE5} $RPM_BUILD_ROOT%{_bindir}/zmrestart
  141. install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
  142. install -m 644 scripts/zmlogrotate.conf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zm
  143. install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/tmp/zm
  144. install -d -m 755 $RPM_BUILD_ROOT/lib/systemd/system
  145. install -D -m 755 %{SOURCE8} $RPM_BUILD_ROOT/lib/systemd/system/zoneminder.service
  146. # Install mootools
  147. pushd $RPM_BUILD_ROOT%{_localstatedir}/www/html/zm
  148. install -m 644 %{SOURCE6} mootools-1.2.3-core-yc.js
  149. ln -s mootools-1.2.3-core-yc.js mootools.js
  150. popd
  151.  
  152. cat > README.urpmi <<EOF
  153.  
  154. ZoneMinder is now installed.
  155. Mageia has included a script to simplify setup.
  156. It will help you to create a mysql root password, a new ZoneMinder mysql
  157. database, or update from a previously installed version.
  158. It will then start mysql, Apache and ZoneMinder on completion.
  159.  
  160. To use it enter the following command as root in a terminal:-
  161.  
  162. zmsetup
  163.  
  164. EOF
  165.  
  166. %post
  167. %_post_service zoneminder
  168.  
  169. %preun
  170. %_preun_service zoneminder
  171.  
  172. %files
  173. %doc AUTHORS COPYING README README.Mageia README.urpmi
  174. %config(noreplace) %attr(640,root,%{zmgid}) %{_sysconfdir}/zm.conf
  175. %config(noreplace) %attr(644,root,root) %{_sysconfdir}/httpd/conf.d/zoneminder.conf
  176. %{_bindir}/zma
  177. %{_bindir}/zmaudit.pl
  178. %{_bindir}/zmc
  179. %{_bindir}/zmcontrol.pl
  180. %{_bindir}/zmdc.pl
  181. %{_bindir}/zmf
  182. %{_bindir}/zmfilter.pl
  183. %attr(4755,root,root) %{_bindir}/zmfix
  184. %{_bindir}/zmpkg.pl
  185. %{_bindir}/zmtrack.pl
  186. %{_bindir}/zmtrigger.pl
  187. %{_bindir}/zmu
  188. %{_bindir}/zmupdate.pl
  189. %{_bindir}/zmvideo.pl
  190. %{_bindir}/zmwatch.pl
  191. %{_bindir}/zmstreamer
  192. %{_bindir}/zmsetup
  193. %{_bindir}/zmrestart
  194. /lib/systemd/system/zoneminder.service
  195. %{perl_vendorlib}/ZoneMinder*
  196. %{_mandir}/man*/*
  197. %{_localstatedir}/www/cgi-bin
  198. %{_datadir}/%{name}/*
  199. %attr(755,%{zmuid},%{zmgid}) %{_localstatedir}/www/html/zm
  200. %dir %attr(755,%{zmuid},%{zmgid}) %{_localstatedir}/log/zm
  201. %attr(755,root,root) %{_initrddir}/zoneminder
  202. %{_sysconfdir}/logrotate.d/zm
  203. %attr(755,%{zmuid},%{zmgid}) %{_localstatedir}/tmp/zm
  204.  
  205.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement