jack1 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

279 lines
7.8KB

  1. # $Id$
  2. # set to 0 to build rpms without capabilities support
  3. %define enable_capabilities 1
  4. # set to 1 to enable alternate jack temporary directory
  5. # mounted as tmpfs
  6. %define enable_tmpdir 1
  7. %if %{enable_tmpdir}
  8. %define jack_tmpdir /var/lib/jack/tmp
  9. %endif
  10. # use port audio
  11. %define port_audio 0
  12. # use oss
  13. %define oss 1
  14. # strip binaries
  15. %define strip_jackd 1
  16. # use premmption check
  17. %define preemption_check 1
  18. Summary: the Jack Audio Connection Kit
  19. Name: @PACKAGE@
  20. Version: @VERSION@
  21. Release: 1
  22. License: GPL
  23. Group: System Environment/Daemons
  24. Source0: %{name}-%{version}.tar.gz
  25. URL: http://jackit.sourceforge.net
  26. BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(id -u -n)
  27. BuildRequires: automake >= 1.6 libsndfile-devel >= 1.0.0
  28. %if %{port_audio}
  29. BuildRequires: portaudio >= 18.1
  30. %endif
  31. %description
  32. JACK is a low-latency audio server, written primarily for the Linux
  33. operating system. It can connect a number of different applications to
  34. an audio device, as well as allowing them to share audio between
  35. themselves. Its clients can run in their own processes (ie. as a
  36. normal application), or can they can run within a JACK server (ie. a
  37. "plugin").
  38. JACK is different from other audio server efforts in that it has been
  39. designed from the ground up to be suitable for professional audio
  40. work. This means that it focuses on two key areas: synchronous
  41. execution of all clients, and low latency operation.
  42. %package devel
  43. Summary: Header files for Jack
  44. Group: Development/Libraries
  45. Requires: %{name} = %{version}
  46. %description devel
  47. Header files for the Jack Audio Connection Kit.
  48. %package example-clients
  49. Summary: Example clients that use Jack
  50. Group: Applications/Multimedia
  51. Requires: %{name} = %{version}
  52. %description example-clients
  53. Small example clients that use the Jack Audio Connection Kit.
  54. %prep
  55. %setup -q
  56. %build
  57. %configure --enable-optimize \
  58. %if %{enable_tmpdir}
  59. --with-default-tmpdir=%{jack_tmpdir} \
  60. %endif
  61. %if %{enable_capabilities}
  62. --enable-capabilities \
  63. %endif
  64. %if %{preemption_check}
  65. --enable-preemption-check \
  66. %endif
  67. %if ! %{port_audio}
  68. --disable-portaudio \
  69. %endif
  70. %if ! %{oss}
  71. --disable-oss \
  72. %endif
  73. %if %{strip_jackd}
  74. --enable-stripped-jackd
  75. %endif
  76. make
  77. %install
  78. [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
  79. make install DESTDIR=$RPM_BUILD_ROOT
  80. %if %{enable_capabilities}
  81. # make jackstart suid root
  82. chmod 04755 $RPM_BUILD_ROOT%{_bindir}/jackstart
  83. %endif
  84. %if %{enable_tmpdir}
  85. # create jack temporary directory
  86. mkdir -p $RPM_BUILD_ROOT%{jack_tmpdir}
  87. %endif
  88. # remove extra install of the documentation
  89. rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/*
  90. %if %{enable_tmpdir}
  91. %preun
  92. if [ "$1" = "0" ] ; then
  93. # try to unmount the tmpfs filesystem
  94. umount %{jack_tmpdir} >/dev/null 2>&1
  95. # remove any leftover files after the mount is gone
  96. rm -rf %{jack_tmpdir}/* >/dev/null 2>&1
  97. fi
  98. %endif
  99. %post
  100. /sbin/ldconfig
  101. %if %{enable_tmpdir}
  102. # add jack temporary directory mount point to fstab
  103. if [ -f /etc/fstab ] ; then
  104. if grep 'jack' /etc/fstab >/dev/null 2>&1 ; then
  105. if ! grep '%{jack_tmpdir}' /etc/fstab >/dev/null 2>&1 ; then
  106. echo
  107. echo "A line containing \"jack\" was found in /etc/fstab. The mount point"
  108. echo "does not match the one needed by this package, so the tmpfs mount line"
  109. echo "was not automatically added. Edit /etc/fstab (be very careful!) and"
  110. echo "add the following line:"
  111. echo " \"none %{jack_tmpdir} tmpfs defaults 0 0\""
  112. echo
  113. fi
  114. else
  115. # add the mount point
  116. echo "Adding jack tmpfs entry to /etc/fstab..."
  117. NEWLINES=$(wc -l /etc/fstab|awk '{print $1}' 2> /dev/null)
  118. LINES=$(grep -c '^.*$' /etc/fstab 2> /dev/null)
  119. if [ $NEWLINES -lt $LINES ] ; then
  120. echo '' >> /etc/fstab || \
  121. { echo "failed to add jack tmpfs entry to /etc/fstab" 1>&2 ; exit 0 ; }
  122. fi
  123. echo 'none %{jack_tmpdir} tmpfs defaults 0 0' \
  124. >> /etc/fstab || \
  125. { echo "failed to add jack tmpfs entry to /etc/fstab" 1>&2 ; exit 0 ; }
  126. echo "Mounting jack tmpfs temporary directory..."
  127. mount %{jack_tmpdir} >/dev/null 2>&1 || \
  128. { echo "failed to mount jack tmpfs temporary directory" 1>&2 ; exit 0 ; }
  129. fi
  130. fi
  131. %endif
  132. %postun
  133. /sbin/ldconfig
  134. %if %{enable_tmpdir}
  135. if [ "$1" = "0" ] ; then
  136. if grep "%{jack_tmpdir}" /etc/fstab >/dev/null 2>&1 ; then
  137. echo "Deleting jack tmpfs fstab entry..."
  138. TMP=$(mktemp /tmp/fstab.XXXXXX)
  139. grep -v "%{jack_tmpdir}" /etc/fstab > $TMP
  140. if [ "$?" == "0" -a -f $TMP -a -s $TMP ] ; then
  141. cat $TMP > /etc/fstab
  142. else
  143. echo "failed to erase jack tmpfs entry from /etc/fstab"
  144. fi
  145. rm -f $TMP
  146. fi
  147. fi
  148. %endif
  149. %clean
  150. [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
  151. %files
  152. %defattr(-,root,root)
  153. %doc AUTHORS TODO COPYING*
  154. %if %{enable_capabilities}
  155. %attr(4755, root, root) %{_bindir}/jackstart
  156. %endif
  157. %{_bindir}/jackd
  158. %{_bindir}/jack_load
  159. %{_bindir}/jack_unload
  160. %{_bindir}/jack_bufsize
  161. %{_bindir}/jack_freewheel
  162. %{_bindir}/jack_transport
  163. %{_libdir}/libjack.so
  164. %{_libdir}/libjack.so.0
  165. %{_libdir}/libjack.so.0.0.*
  166. %{_libdir}/jack/inprocess.so
  167. %{_libdir}/jack/intime.so
  168. %{_libdir}/jack/jack_alsa.so
  169. %{_libdir}/jack/jack_dummy.so
  170. %if %{port_audio}
  171. %{_libdir}/jack/jack_portaudio.so
  172. %endif
  173. %if %{oss}
  174. %{_libdir}/jack/jack_oss.so
  175. %endif
  176. %{_mandir}/man1/*
  177. %if %{enable_tmpdir}
  178. %dir %{jack_tmpdir}
  179. %attr(0777, root, root) %{jack_tmpdir}
  180. %endif
  181. %files devel
  182. %defattr(-,root,root)
  183. %doc doc/reference
  184. %{_libdir}/libjack.la
  185. %{_libdir}/jack/inprocess.la
  186. %{_libdir}/jack/intime.la
  187. %{_libdir}/jack/jack_alsa.la
  188. %{_libdir}/jack/jack_dummy.la
  189. %if %{port_audio}
  190. %{_libdir}/jack/jack_portaudio.la
  191. %endif
  192. %if %{oss}
  193. %{_libdir}/jack/jack_oss.la
  194. %endif
  195. %{_includedir}/jack/jack.h
  196. %{_includedir}/jack/ringbuffer.h
  197. %{_includedir}/jack/timestamps.h
  198. %{_includedir}/jack/transport.h
  199. %{_includedir}/jack/types.h
  200. %{_includedir}/jack/thread.h
  201. %{_includedir}/jack/intclient.h
  202. %{_includedir}/jack/statistics.h
  203. %{_libdir}/pkgconfig/jack.pc
  204. %files example-clients
  205. %defattr(-,root,root)
  206. %{_bindir}/jackrec
  207. %{_bindir}/jack_connect
  208. %{_bindir}/jack_disconnect
  209. %{_bindir}/jack_impulse_grabber
  210. %{_bindir}/jack_lsp
  211. %{_bindir}/jack_metro
  212. %{_bindir}/jack_monitor_client
  213. %{_bindir}/jack_showtime
  214. %{_bindir}/jack_simple_client
  215. %changelog
  216. * Thu Jan 3 2005 Rui Nuno Capela <rncbc@rncbc.org> - 0.99.44-1
  217. - add jack/statistics.h to devel package
  218. * Thu Dec 28 2004 Rui Nuno Capela <rncbc@rncbc.org> - 0.99.41-1
  219. - merge integration of usx2y (rawusb) driver into alsa backend
  220. - enable preemption check feature of 2.6 RT kernels
  221. - add jack/intclient.h to devel package
  222. - add jack/thread.h to devel package
  223. - moved doc/reference to devel package
  224. - set default tmpdir to /var/lib/jack/tmp
  225. - include oss backend driver if available
  226. * Sat May 22 2004 Pete Bessman <ninjadroid@gazuga.net> - 0.98.1-1
  227. - changes to accomodate jack_oss and RPM's fascist build policy
  228. * Mon Nov 13 2003 Lawrie Abbott <lawrieabbott@iinet.net.au>
  229. - update based on Planet CCRMA 0.80.0 release
  230. * Thu May 23 2002 Fernando Lopez-Lezcano <nando@ccrma.stanford.edu>
  231. - added configuration variable to build with/without capabilities
  232. * Tue May 21 2002 Fernando Lopez-Lezcano <nando@ccrma.stanford.edu>
  233. - split the examples into a different package so that the base
  234. package does not depend on, for example, fltk.
  235. - disable stripping of binaries
  236. * Mon May 13 2002 Fernando Lopez-Lezcano <nando@ccrma.stanford.edu>
  237. - do not compress documentation, added doxygen docs directory
  238. - changed defattr directives
  239. - added libdir/jack*, libdir/*.a and libdir/*.so.* to files
  240. - moved all so's to libs, jack will not start without jack_alsa.so
  241. - merged base and libs packages
  242. * Sat May 4 2002 Christian Fredrik Kalager Schaller <uraeus@linuxrising.org>
  243. - initial release of jack sound server package for GStreamer