Fix the bug : TIVI-204 Fail to connect to bluetooth network
[profile/ivi/bluez.git] / packaging / bluez.spec
1 Name:       bluez
2 Summary:    Bluetooth utilities
3 Version:    4.101
4 Release:    2
5 Group:      Applications/System
6 License:    GPLv2+
7 URL:        http://www.bluez.org/
8 Source0:    %{name}-%{version}.tar.gz
9 Source1:    bluetooth.service
10 Requires:   bluez-libs = %{version}
11 Requires:   dbus >= 0.60
12 Requires:   usbutils
13 Requires:   pciutils
14 Requires(post):   systemd   
15 Requires(postun): systemd   
16 Requires(preun):  systemd   
17 BuildRequires:  pkgconfig(dbus-1)
18 BuildRequires:  pkgconfig(alsa)
19 BuildRequires:  pkgconfig(udev)
20 BuildRequires:  pkgconfig(sndfile)
21 BuildRequires:  pkgconfig(glib-2.0)
22 BuildRequires:  pkgconfig(gstreamer-plugins-base-0.10)
23 BuildRequires:  pkgconfig(gstreamer-0.10)
24 BuildRequires:  pkgconfig(check)
25 BuildRequires:  flex
26 BuildRequires:  bison
27
28
29 %description
30 Utilities for use in Bluetooth applications:
31         --ciptool
32         --dfutool
33         --hcitool
34         --l2ping
35         --rfcomm
36         --sdptool
37         --hciattach
38         --hciconfig
39         --hid2hci
40
41 The BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A.
42
43
44
45 %package libs
46 Summary:    Libraries for use in Bluetooth applications
47 Group:      System/Libraries
48 Requires:   %{name} = %{version}-%{release}
49 Requires(post): /sbin/ldconfig
50 Requires(postun): /sbin/ldconfig
51
52 %description libs
53 Libraries for use in Bluetooth applications.
54
55 %package libs-devel
56 Summary:    Development libraries for Bluetooth applications
57 Group:      Development/Libraries
58 Requires:   %{name} = %{version}-%{release}
59 Requires:   bluez-libs = %{version}
60
61 %description libs-devel
62 bluez-libs-devel contains development libraries and headers for
63 use in Bluetooth applications.
64
65
66 %package cups
67 Summary:    CUPS printer backend for Bluetooth printers
68 Group:      System/Daemons
69 Requires:   %{name} = %{version}-%{release}
70 Requires:   bluez-libs = %{version}
71 Requires:   cups
72
73 %description cups
74 This package contains the CUPS backend
75
76 %package alsa
77 Summary:    ALSA support for Bluetooth audio devices
78 Group:      System/Daemons
79 Requires:   %{name} = %{version}-%{release}
80 Requires:   bluez-libs = %{version}
81
82 %description alsa
83 This package contains ALSA support for Bluetooth audio devices
84
85 %package gstreamer
86 Summary:    GStreamer support for SBC audio format
87 Group:      System/Daemons
88 Requires:   %{name} = %{version}-%{release}
89 Requires:   bluez-libs = %{version}
90
91 %description gstreamer
92 This package contains gstreamer plugins for the Bluetooth SBC audio format
93
94 %package test
95 Summary:    Test Programs for BlueZ
96 Group:      Development/Tools
97 Requires:   %{name} = %{version}-%{release}
98 Requires:   bluez-libs = %{version}
99 Requires:   dbus-python
100 Requires:   pygobject
101 Requires:   python-xml
102
103 %description test
104 Scripts for testing BlueZ and its functionality
105
106 %prep
107 %setup -q -n %{name}-%{version}
108
109 %reconfigure --disable-static \
110                         --localstatedir=/opt/var \
111                         --enable-pie \
112                         --enable-network \
113                         --enable-serial \
114                         --enable-input \
115                         --enable-usb=no \
116                         --enable-tools \
117                         --disable-bccmd \
118                         --enable-pcmcia=no \
119                         --enable-hid2hci=no \
120                         --enable-alsa=no \
121                         --enable-gstreamer \
122                         --disable-dfutool \
123                         --disable-cups \
124                         --enable-test \
125                         --with-telephony=ofono \
126                         --enable-dbusoob
127
128 make %{?jobs:-j%jobs}
129
130 %install
131 rm -rf %{buildroot}
132 %make_install
133
134 install -D -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/system/bluetooth.service
135 mkdir -p %{buildroot}%{_libdir}/systemd/system/bluetooth.target.wants  
136 mkdir -p %{buildroot}%{_libdir}/systemd/system/network.target.wants  
137 ln -s ../bluetooth.service %{buildroot}%{_libdir}/systemd/system/bluetooth.target.wants/bluetooth.service  
138 ln -s ../bluetooth.service %{buildroot}%{_libdir}/systemd/system/network.target.wants/bluetooth.service  
139
140 %post libs -p /sbin/ldconfig
141
142 %postun libs -p /sbin/ldconfig
143
144 %post   
145 systemctl daemon-reload  
146 systemctl restart bluetooth.service  
147    
148 %preun  
149 systemctl stop bluetooth.service  
150    
151 %postun  
152 systemctl daemon-reload  
153
154 %docs_package
155
156
157 %files
158 %defattr(-,root,root,-)
159 %{_bindir}/ciptool
160 %{_bindir}/hcitool
161 %{_bindir}/l2ping
162 %{_bindir}/rfcomm
163 %{_bindir}/sdptool
164 %{_sbindir}/*
165 %config(noreplace) %{_sysconfdir}/bluetooth/*
166 %config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
167 %{_libdir}/systemd/system/bluetooth.service
168 %{_libdir}/systemd/system/bluetooth.target.wants/bluetooth.service
169 %{_libdir}/systemd/system/network.target.wants/bluetooth.service
170 /usr/share/dbus-1/system-services/org.bluez.service
171
172 %files libs
173 %defattr(-,root,root,-)
174 %{_libdir}/libbluetooth.so.*
175 %doc COPYING
176
177 %files libs-devel
178 %defattr(-, root, root)
179 %{_libdir}/libbluetooth.so
180 %dir %{_includedir}/bluetooth
181 %{_includedir}/bluetooth/*
182 %{_libdir}/pkgconfig/bluez.pc
183
184
185 %files alsa
186 %defattr(-,root,root,-)
187 #%{_libdir}/alsa-lib/*.so
188 #%{_datadir}/alsa/bluetooth.conf
189
190 %files gstreamer
191 %defattr(-,root,root,-)
192 %{_libdir}/gstreamer-*/*.so
193
194 %files test
195 %defattr(-,root,root,-)
196 %{_bindir}/l2test
197 %{_bindir}/rctest
198 %{_libdir}/bluez/test/*