]> git.pld-linux.org Git - packages/btsco.git/blob - btsco.spec
3959534ed670853c253695e6c360c1ff107cedf9
[packages/btsco.git] / btsco.spec
1 #
2 # Conditional build:
3 %bcond_without  dist_kernel     # without kernel from distribution
4 %bcond_without  kernel          # don't build kernel modules
5 %bcond_without  userspace       # don't build userspace utilities
6 %bcond_without  smp             # don't build SMP module
7 %bcond_with     verbose         # verbose build (V=1)
8 #
9 Summary:        Bluetooth-alsa Project
10 Summary(pl):    Projekt Bluetooth-alsa
11 Name:           btsco
12 Version:        0.4
13 %define rel     1
14 Release:        %{rel}
15 License:        GPL
16 Group:          Applications/Sound
17 Source0:        http://dl.sourceforge.net/bluetooth-alsa/%{name}-%{version}.tar.gz
18 # Source0-md5:  3f46d45db6f0e399044ae6a31b1f23c7
19 Patch0:         %{name}-readme-pl.diff
20 URL:            http://sourceforge.net/projects/bluetooth-alsa/
21 BuildRequires:  autoconf
22 BuildRequires:  automake
23 BuildRequires:  libtool
24 %if %{with kernel}
25 %{?with_dist_kernel:BuildRequires:      kernel-module-build}
26 %endif
27 %if %{with userspace}
28 BuildRequires:  alsa-driver-devel >= 1.0.9-1
29 BuildRequires:  alsa-lib-devel >= 1.0.9-1
30 BuildRequires:  bluez-libs-devel >= 2.21-1
31 BuildRequires:  libao-devel >= 0.8.6-1
32 %endif
33 ExclusiveArch:  %{ix86}
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %description
37 This project provides a way to use a bluetooth headset with Linux. We
38 do this currently by making an alsa kernel driver which uses bluez to
39 reach the headset. It works well enough now to get voice-quality audio
40 to and from most headsets.
41
42 %description -l pl
43 Dziêki temu oprogramowaniu mo¿na u¿ywaæ zestawów s³uchawkowych
44 Bluetooth Headset z Linuksem. Osi±gniêto to dziêki zbudowaniu alsowego
45 modu³u do j±dra, który to u¿ywa systemu bluez do komunikacji z takim
46 zestawem. Wspó³pracuje z wiêkszo¶ci± zestawów, ograniczeniem w
47 komunikacji jest czêsto urz±dzenie USB, które to mo¿e mieæ
48 nieobs³ugiwane czê¶ciowo protoko³y, wskazówka: hciconfig hciXXX
49 revision. W skrajnym wypadku mo¿na próbowaæ u¿yæ innego urz±dzenia
50 USB.
51
52 %package -n kernel-char-btsco
53 Summary:        Linux ALSA kernel driver for Bluetooth Headset
54 Summary(pl):    Sterownik ALSA do j±dra Linuksa dla Bluetooth Headset
55 Release:        %{rel}@%{_kernel_ver_str}
56 Group:          Base/Kernel
57 %{?with_dist_kernel:%requires_releq_kernel_up}
58 Requires(post,postun):  /sbin/depmod
59 Requires:       kernel-sound-alsa
60
61 %description -n kernel-char-btsco
62 Linux ALSA kernel driver for Bluetooth Headset named snd_bt_sco.
63
64 %description -n kernel-char-btsco -l pl
65 Sterownik ALSA do j±dra Linuksa dla Bluetooth Headset o nazwie
66 snd_bt_sco.
67
68 %package -n kernel-smp-char-btsco
69 Summary:        Linux ALSA kernel driver for Bluetooth Headset (SMP)
70 Summary(pl):    Sterownik ALSA do j±dra Linuksa dla Bluetooth Headset (SMP)
71 Release:        %{rel}@%{_kernel_ver_str}
72 Group:          Base/Kernel
73 %{?with_dist_kernel:%requires_releq_kernel_smp}
74 Requires(post,postun):  /sbin/depmod
75 Requires:       kernel-smp-sound-alsa
76
77 %description -n kernel-smp-char-btsco
78 Linux ALSA kernel (SMP) driver for Bluetooth Headset named snd_bt_sco.
79
80 %description -n kernel-smp-char-btsco -l pl
81 Sterownik ALSA do j±dra Linuksa SMP dla Bluetooth Headset o nazwie
82 snd_bt_sco.
83
84 %prep
85 %setup -q
86 %patch0 -p1
87
88 %build
89 %{__libtoolize}
90 %{__aclocal}
91 %{__autoconf}
92 %{__automake}
93 %configure
94
95 %if %{with userspace}
96 %{__make}
97 %endif
98
99 %if %{with kernel}
100 cd kernel
101 # kernel module(s)
102 for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do
103         if [ ! -r "%{_kernelsrcdir}/config-$cfg" ]; then
104                 exit 1
105         fi
106         rm -rf include
107         install -d include/{linux,config}
108         ln -sf %{_kernelsrcdir}/config-$cfg .config
109         ln -sf %{_kernelsrcdir}/include/linux/autoconf-$cfg.h include/linux/autoconf.h
110         ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
111         ln -sf %{_kernelsrcdir}/Module.symvers-$cfg Module.symvers
112         touch include/config/MARKER
113
114         # patching/creating makefile(s) (optional)
115         %{__make} -C %{_kernelsrcdir} clean \
116                 RCS_FIND_IGNORE="-name '*.ko' -o" \
117                 M=$PWD O=$PWD \
118                 %{?with_verbose:V=1}
119         %{__make} -C %{_kernelsrcdir} modules \
120                 CC="%{__cc}" CPP="%{__cpp}" \
121                 M=$PWD O=$PWD \
122                 %{?with_verbose:V=1}
123         for mod in *.ko; do
124                 mod=$(echo "$mod" | sed -e 's#\.ko##g')
125                 mv $mod.ko ../$mod-$cfg.ko
126         done
127 done
128 %endif
129
130 %install
131 rm -rf $RPM_BUILD_ROOT
132
133 %if %{with userspace}
134 install -d $RPM_BUILD_ROOT%{_bindir}
135
136 for file in avdtp/avtest sbc/rcplay sbc/sbcenc sbc/sbcinfo a2play btsco2 btsco ; do
137         install $file $RPM_BUILD_ROOT%{_bindir}
138 done
139 %endif
140
141 %if %{with kernel}
142 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
143         %if %{without dist_kernel}
144         for mod in *-nondist.ko; do
145                 nmod=$(echo "$mod" | sed -e 's#-nondist##g')
146                 pwd
147                 install $mod $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/$nmod
148         done
149         %else
150         for mod in *-up.ko; do
151                 nmod=$(echo "$mod" | sed -e 's#-up##g')
152                 pwd
153                 install $mod $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc/$nmod
154         done
155         %endif
156
157         %if %{with smp}
158         for mod in *-smp.ko; do
159                 nmod=$(echo "$mod" | sed -e 's#-smp##g')
160                 pwd
161                 install $mod $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/$nmod
162         done
163         %endif
164 %endif
165
166 %clean
167 rm -rf $RPM_BUILD_ROOT
168
169 %post -n kernel-char-btsco
170 %depmod %{_kernel_ver}
171 echo "after install this package, remember add lines like this:"
172 echo "alias snd-card-1 snd-bt-sco"
173 echo "alias sound-slot-1 snd-bt-sco"
174 echo "to %{_sysconfdir}/modprobe.conf"
175
176 %postun -n kernel-char-btsco
177 %depmod %{_kernel_ver}
178
179 %post -n kernel-smp-char-btsco
180 %depmod %{_kernel_ver}
181 echo "after install this package, remember add lines like this:"
182 echo "alias snd-card-1 snd-bt-sco"
183 echo "alias sound-slot-1 snd-bt-sco"
184 echo "to %{_sysconfdir}/modprobe.conf"
185
186 %postun -n kernel-smp-char-btsco
187 %depmod %{_kernel_ver}
188
189 %if %{with userspace}
190 %files
191 %defattr(644,root,root,755)
192 %doc COPYING README README.PL.txt NEWS AUTHORS ChangeLog INSTALL
193 %attr(755,root,root) %{_bindir}/*
194 %endif
195
196 %if %{with kernel}
197 %files -n kernel-char-btsco
198 %defattr(644,root,root,755)
199 /lib/modules/%{_kernel_ver}/misc/snd-bt-sco.ko.gz
200 %endif
201
202 %if %{with smp}
203 %files -n kernel-smp-char-btsco
204 %defattr(644,root,root,755)
205 /lib/modules/%{_kernel_ver}smp/misc/snd-bt-sco.ko.gz
206 %endif
This page took 0.070388 seconds and 2 git commands to generate.