summaryrefslogtreecommitdiff
path: root/jack.spec.in
blob: 8fd4c2fa5f84d573a45dfa509bb76a02e9d98217 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# $Id$
# set to 0 to build rpms without capabilities support
%define enable_capabilities 0
# strip binaries 
%define strip_jackd 0
# set to 1 to enable alternate jack temporary
# directory mounted as tmpfs
%define enable_tmpdir 1
%if %{enable_tmpdir}
%define jack_tmpdir /var/lib/jack/tmp
%endif
# use port audio
%define port_audio 0
# use oss
%define oss 1
# use preemption check
%define preemption_check 0


Summary:	the Jack Audio Connection Kit
Name:		@PACKAGE@
Version:	@VERSION@
Release:	2
License:	GPL
Group:		System Environment/Daemons
Source0:	%{name}-%{version}.tar.gz
URL:		http://jackit.sourceforge.net
BuildRoot:	%{_tmppath}/%{name}-%{version}-root-%(id -u -n)

BuildRequires: automake >= 1.6 libsndfile-devel >= 1.0.0

%if %{port_audio}
BuildRequires: portaudio >= 18.1
%endif

%description
JACK is a low-latency audio server, written primarily for the Linux
operating system. It can connect a number of different applications to
an audio device, as well as allowing them to share audio between
themselves. Its clients can run in their own processes (ie. as a
normal application), or can they can run within a JACK server (ie. a
"plugin").

JACK is different from other audio server efforts in that it has been
designed from the ground up to be suitable for professional audio
work. This means that it focuses on two key areas: synchronous
execution of all clients, and low latency operation.

%package devel
Summary:	Header files for Jack 
Group:		Development/Libraries
Requires:	%{name} = %{version}

%description devel
Header files for the Jack Audio Connection Kit.

%package example-clients
Summary:	Example clients that use Jack 
Group:		Applications/Multimedia
Requires:	%{name} = %{version}

%description example-clients
Small example clients that use the Jack Audio Connection Kit.

%prep
%setup -q

%build
%configure \
%if %{enable_capabilities}
	--enable-capabilities \
%if %{strip_jackd}
	--enable-stripped-jackd \
%endif
%endif
%if %{enable_tmpdir}
	--with-default-tmpdir=%{jack_tmpdir} \
%endif
%if ! %{port_audio}
	--disable-portaudio \
%endif
%if ! %{oss}
	--disable-oss \
%endif
%if %{preemption_check}
	--enable-preemption-check \
%endif
	--enable-optimize
make


%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

%if %{enable_capabilities}
# make jackstart suid root
chmod 04755 $RPM_BUILD_ROOT%{_bindir}/jackstart
%endif

%if %{enable_tmpdir}
# create jack temporary directory
mkdir -p $RPM_BUILD_ROOT%{jack_tmpdir}
%endif

# remove extra install of the documentation
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/*

%if %{enable_tmpdir}
%preun
if [ "$1" = "0" ] ; then
    # try to unmount the tmpfs filesystem
    umount %{jack_tmpdir} >/dev/null 2>&1
    # remove any leftover files after the mount is gone
    rm -rf %{jack_tmpdir}/* >/dev/null 2>&1
fi
%endif

%post
/sbin/ldconfig
%if %{enable_tmpdir}
# add jack temporary directory mount point to fstab
if [ -f /etc/fstab ] ; then
    if grep 'jack' /etc/fstab >/dev/null 2>&1 ; then
        if ! grep '%{jack_tmpdir}' /etc/fstab >/dev/null 2>&1 ; then
            echo
            echo "A line containing \"jack\" was found in /etc/fstab. The mount point"
            echo "does not match the one needed by this package, so the tmpfs mount line"
            echo "was not automatically added. Edit /etc/fstab (be very careful!) and"
            echo "add the following line:"
            echo "    \"none %{jack_tmpdir} tmpfs defaults 0 0\""
            echo
        fi
    else
        # add the mount point
        echo "Adding jack tmpfs entry to /etc/fstab..."
        NEWLINES=$(wc -l /etc/fstab|awk '{print $1}' 2> /dev/null)
        LINES=$(grep -c '^.*$' /etc/fstab 2> /dev/null)
        if [ $NEWLINES -lt $LINES ] ; then
            echo '' >> /etc/fstab || \
            { echo "failed to add jack tmpfs entry to /etc/fstab" 1>&2 ; exit 0 ; }
        fi
        echo 'none                    %{jack_tmpdir}       tmpfs   defaults         0 0' \
        >> /etc/fstab || \
        { echo "failed to add jack tmpfs entry to /etc/fstab" 1>&2 ; exit 0 ; }
        echo "Mounting jack tmpfs temporary directory..."
        mount %{jack_tmpdir} >/dev/null 2>&1 || \
        { echo "failed to mount jack tmpfs temporary directory" 1>&2 ; exit 0 ; }
    fi
fi
%endif

%postun
/sbin/ldconfig
%if %{enable_tmpdir}
if [ "$1" = "0" ] ; then
    if grep "%{jack_tmpdir}" /etc/fstab >/dev/null 2>&1 ; then
        echo "Deleting jack tmpfs fstab entry..."
        TMP=$(mktemp /tmp/fstab.XXXXXX)
        grep -v "%{jack_tmpdir}" /etc/fstab > $TMP
        if [ "$?" == "0" -a -f $TMP -a -s $TMP ] ; then
            cat $TMP > /etc/fstab
        else
            echo "failed to erase jack tmpfs entry from /etc/fstab"
        fi
        rm -f $TMP
    fi
fi
%endif

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%files 
%defattr(-,root,root)
%doc AUTHORS TODO COPYING*
%if %{enable_capabilities}
%attr(4755, root, root) %{_bindir}/jackstart
%endif
%{_bindir}/jackd
%{_bindir}/jack_load
%{_bindir}/jack_unload
%{_bindir}/jack_bufsize
%{_bindir}/jack_freewheel
%{_bindir}/jack_transport
%{_libdir}/libjack.so
%{_libdir}/libjack.so.0
%{_libdir}/libjack.so.0.0.*
%{_libdir}/jack/inprocess.so
%{_libdir}/jack/intime.so
%{_libdir}/jack/jack_alsa.so
%{_libdir}/jack/jack_dummy.so
%if %{port_audio}
%{_libdir}/jack/jack_portaudio.so
%endif
%if %{oss}
%{_libdir}/jack/jack_oss.so
%endif
%{_mandir}/man1/*
%if %{enable_tmpdir}
%dir %{jack_tmpdir}
%attr(0777, root, root) %{jack_tmpdir}
%endif

%files devel
%defattr(-,root,root)
%doc doc/reference
%{_libdir}/libjack.la
%{_libdir}/jack/inprocess.la
%{_libdir}/jack/intime.la
%{_libdir}/jack/jack_alsa.la
%{_libdir}/jack/jack_dummy.la
%if %{port_audio}
%{_libdir}/jack/jack_portaudio.la
%endif
%if %{oss}
%{_libdir}/jack/jack_oss.la
%endif
%{_includedir}/jack/jack.h
%{_includedir}/jack/ringbuffer.h
%{_includedir}/jack/timestamps.h
%{_includedir}/jack/transport.h
%{_includedir}/jack/types.h
%{_includedir}/jack/thread.h
%{_includedir}/jack/intclient.h
%{_includedir}/jack/statistics.h
%{_libdir}/pkgconfig/jack.pc


%files example-clients
%defattr(-,root,root)
%{_bindir}/jackrec
%{_bindir}/jack_connect
%{_bindir}/jack_disconnect
%{_bindir}/jack_impulse_grabber
%{_bindir}/jack_lsp
%{_bindir}/jack_metro
%{_bindir}/jack_monitor_client
%{_bindir}/jack_showtime
%{_bindir}/jack_simple_client


%changelog

* Thu Oct 30 2005 Rui Nuno Capela <rncbc@rncbc.org> - 0.100.7-2
- omitted enable-capabilities, stripped-binaries and preemption
  check from default.

* Thu Jan  3 2005 Rui Nuno Capela <rncbc@rncbc.org> - 0.99.44-1
- add jack/statistics.h to devel package

* Thu Dec 28 2004 Rui Nuno Capela <rncbc@rncbc.org> - 0.99.41-1
- merge integration of usx2y (rawusb) driver into alsa backend
- enable preemption check feature of 2.6 RT kernels
- add jack/intclient.h to devel package
- add jack/thread.h to devel package
- moved doc/reference to devel package
- set default tmpdir to /var/lib/jack/tmp
- include oss backend driver if available

* Sat May 22 2004 Pete Bessman <ninjadroid@gazuga.net> - 0.98.1-1
- changes to accomodate jack_oss and RPM's fascist build policy

* Mon Nov 13  2003 Lawrie Abbott <lawrieabbott@iinet.net.au>      
- update based on Planet CCRMA 0.80.0 release

* Thu May 23 2002 Fernando Lopez-Lezcano <nando@ccrma.stanford.edu>
- added configuration variable to build with/without capabilities

* Tue May 21 2002 Fernando Lopez-Lezcano <nando@ccrma.stanford.edu>
- split the examples into a different package so that the base
  package does not depend on, for example, fltk. 
- disable stripping of binaries

* Mon May 13 2002 Fernando Lopez-Lezcano <nando@ccrma.stanford.edu>
- do not compress documentation, added doxygen docs directory
- changed defattr directives
- added libdir/jack*, libdir/*.a and libdir/*.so.* to files
- moved all so's to libs, jack will not start without jack_alsa.so
- merged base and libs packages

* Sat May  4 2002 Christian Fredrik Kalager Schaller <uraeus@linuxrising.org> 
- initial release of jack sound server package for GStreamer