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