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.

244 lines
6.9KB

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