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