a9996d38c54b55b4e1a15d75de701a4fb487d4c8
[platform/upstream/bluez.git] / packaging / bluez.spec
1 %define with_libcapng --enable-capng
2
3 Name:           bluez
4 BuildRequires:  pkgconfig(dbus-1)
5 BuildRequires:  flex
6 BuildRequires:  libcap-ng-devel
7 BuildRequires:  systemd
8 %{?systemd_requires}
9 BuildRequires:  pkgconfig(alsa)
10 BuildRequires:  automake
11 BuildRequires:  check-devel
12 BuildRequires:  glib2-devel >= 2.16
13 BuildRequires:  libsndfile-devel
14 BuildRequires:  libtool
15 BuildRequires:  libudev-devel
16 BuildRequires:  libusb-devel
17 BuildRequires:  pkg-config
18 BuildRequires:  readline-devel
19 BuildRequires:  udev
20 BuildRequires:  pkgconfig(libnl-1)
21 BuildRequires:  libical-devel
22 BuildRequires:  pkgconfig(libtzplatform-config)
23 Url:            http://www.bluez.org
24 Version:        5.19
25 Release:        0
26 Summary:        Bluetooth Stack for Linux
27 License:        GPL-2.0+
28 Group:          Network & Connectivity/Bluetooth
29 Source:         bluez-%{version}.tar.gz
30 Source2:        bluez-coldplug.init
31 Source3:        bluetooth.sysconfig
32 Source4:        bluetooth.sh
33 Source5:        baselibs.conf
34 Source7:        bluetooth.modprobe
35 Source101:      obex-root-setup
36 Source102:      create-symlinks
37 Source1001:     bluez.manifest
38
39 %define cups_lib_dir %{_prefix}/lib/cups
40
41 %description
42 The Bluetooth stack for Linux.
43
44 %package devel
45 Summary:        Files needed for BlueZ development
46 License:        GPL-2.0+
47 Group:          Development/Libraries
48 Requires:       libbluetooth = %{version}
49
50 %description devel
51 Files needed to develop applications for the BlueZ Bluetooth protocol
52 stack.
53
54 %package -n libbluetooth
55 Summary:        Bluetooth Libraries
56 License:        GPL-2.0+
57 Group:          Network & Connectivity/Bluetooth
58
59 %description -n libbluetooth
60 Bluetooth protocol stack libraries.
61
62 %package cups
63 Summary:        CUPS Driver for Bluetooth Printers
64 License:        GPL-2.0+
65 Group:          Network & Connectivity/Bluetooth
66 Requires:       libbluetooth = %{version}
67
68 %description cups
69 Contains the files required by CUPS for printing to Bluetooth-connected
70 printers.
71
72 %package -n obexd
73 Summary:        OBEX Server A basic OBEX server implementation
74 Group:          Network & Connectivity/Bluetooth
75 Requires:       tizen-platform-config-tools
76
77 %description -n obexd
78 OBEX Server A basic OBEX server implementation.
79
80 %package test
81 Summary:        Tools for testing of various Bluetooth-functions
82 License:        GPL-2.0+ and MIT
83 Group:          Development/Tools
84 Requires:       dbus-python
85 Requires:       libbluetooth = %{version}
86 Requires:       python-gobject
87
88 %description test
89 Contains a few tools for testing various bluetooth functions. The
90 BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A.
91
92 %prep
93 %setup -q
94 cp %{SOURCE1001} .
95
96 %build
97 autoreconf -fiv
98
99 export CFLAGS="${CFLAGS} -D__TIZEN_PATCH__ -D__BROADCOM_PATCH__"
100 %configure  --with-pic \
101             --libexecdir=/lib \
102             --disable-usb       \
103             --enable-test       \
104             --enable-library    \
105             --enable-experimental       \
106             --enable-readline   \
107             --with-systemdunitdir=%{_unitdir}   \
108             %{?with_libcapng}
109 make %{?_smp_mflags} all V=1
110
111 %check
112 make check
113
114 %install
115 %make_install
116
117 # bluez-test
118 rm -rvf $RPM_BUILD_ROOT/%{_libdir}/gstreamer-*
119 install --mode=0755 -D %{S:4} $RPM_BUILD_ROOT/usr/lib/udev/bluetooth.sh
120 install --mode=0644 -D %{S:7} $RPM_BUILD_ROOT/%{_sysconfdir}/modprobe.d/50-bluetooth.conf
121 if ! test -e %{buildroot}%{cups_lib_dir}/backend/bluetooth
122 then if test -e %{buildroot}%{_libdir}/cups/backend/bluetooth
123      then mkdir -p %{buildroot}%{cups_lib_dir}/backend
124           mv %{buildroot}%{_libdir}/cups/backend/bluetooth %{buildroot}%{cups_lib_dir}/backend/bluetooth
125      fi
126 fi
127 # no idea why this is suddenly necessary...
128 install --mode 0755 -d $RPM_BUILD_ROOT/var/lib/bluetooth
129
130 install -D -m 0755 %SOURCE101 %{buildroot}%{_bindir}/obex-root-setup
131 install -D -m 0755 %SOURCE102 %{buildroot}%{_sysconfdir}/obex/root-setup.d/000_create-symlinks
132 install -D -m 0755 tools/btiotest $RPM_BUILD_ROOT/%{_bindir}/
133 install -D -m 0755 tools/bluetooth-player $RPM_BUILD_ROOT/%{_bindir}/
134 install -D -m 0755 tools/mpris-player $RPM_BUILD_ROOT/%{_bindir}/
135 install -D -m 0755 tools/btmgmt $RPM_BUILD_ROOT/%{_bindir}/
136 install -D -m 0755 tools/scotest $RPM_BUILD_ROOT/%{_bindir}/
137
138 install -D -m 0755 tools/obexctl %{buildroot}%{_bindir}/obexctl
139
140 %post -n libbluetooth -p /sbin/ldconfig
141
142 %postun -n libbluetooth -p /sbin/ldconfig
143
144 %files
145 %manifest %{name}.manifest
146 %defattr(-, root, root)
147 %license COPYING 
148 %{_bindir}/hcitool
149 %{_bindir}/l2ping
150 %{_bindir}/obexctl
151 %{_bindir}/rfcomm
152 %{_bindir}/sdptool
153 %{_bindir}/ciptool
154 #%{_bindir}/dfutool
155 %{_bindir}/hciattach
156 %{_bindir}/hciconfig
157 /lib/bluetooth/bluetoothd
158 %{_bindir}/bccmd
159 #%{_sbindir}/hid2hci
160 %dir /usr/lib/udev
161 /usr/lib/udev/*
162 %{_datadir}/dbus-1/system-services/org.bluez.service
163 %config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
164 %dir /var/lib/bluetooth
165 %dir %{_sysconfdir}/modprobe.d
166 %config(noreplace) %{_sysconfdir}/modprobe.d/50-bluetooth.conf
167 %{_unitdir}/bluetooth.service
168
169 %files devel
170 %manifest %{name}.manifest
171 %defattr(-, root, root)
172 /usr/include/bluetooth
173 %{_libdir}/libbluetooth.so
174 %{_libdir}/pkgconfig/bluez.pc
175
176 %files -n libbluetooth
177 %manifest %{name}.manifest
178 %defattr(-, root, root)
179 %{_libdir}/libbluetooth.so.*
180 %license COPYING
181
182 %files cups
183 %manifest %{name}.manifest
184 %defattr(-,root,root)
185 %dir %{cups_lib_dir}
186 %dir %{cups_lib_dir}/backend
187 %{cups_lib_dir}/backend/bluetooth
188
189 %files -n obexd
190 %defattr(-,root,root,-)
191 /lib/bluetooth/obexd
192 %{_unitdir_user}/obex.service
193 %{_datadir}/dbus-1/services/org.bluez.obex.service
194 %{_sysconfdir}/obex/root-setup.d/000_create-symlinks
195 %{_bindir}/obex-root-setup
196
197 %files test
198 %manifest %{name}.manifest
199 %defattr(-,root,root)
200 %{_libdir}/bluez/test/*
201 %{_bindir}/l2test
202 %{_bindir}/rctest
203 %{_bindir}/bluetoothctl
204 %{_bindir}/btiotest
205 %{_bindir}/mpris-player
206 %{_bindir}/bluetooth-player
207 %{_bindir}/btmon
208 %{_bindir}/hcidump
209 %{_bindir}/btmgmt
210 %{_bindir}/scotest
211 %{_bindir}/bluezutils.py
212 %{_bindir}/dbusdef.py
213
214 %docs_package
215
216 %changelog