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