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.

258 lines
7.1KB

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