packaging: Add bluemoon to bluez.spec
[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 install -D -m 0755 tools/bluemoon $RPM_BUILD_ROOT/%{_bindir}/
138
139 install -D -m 0755 tools/obexctl %{buildroot}%{_bindir}/obexctl
140
141 %post -n libbluetooth -p /sbin/ldconfig
142
143 %postun -n libbluetooth -p /sbin/ldconfig
144
145 %files
146 %manifest %{name}.manifest
147 %defattr(-, root, root)
148 %license COPYING 
149 %{_bindir}/hcitool
150 %{_bindir}/l2ping
151 %{_bindir}/obexctl
152 %{_bindir}/rfcomm
153 %{_bindir}/sdptool
154 %{_bindir}/ciptool
155 #%{_bindir}/dfutool
156 %{_bindir}/hciattach
157 %{_bindir}/hciconfig
158 /lib/bluetooth/bluetoothd
159 %{_bindir}/bccmd
160 #%{_sbindir}/hid2hci
161 %dir /usr/lib/udev
162 /usr/lib/udev/*
163 %{_datadir}/dbus-1/system-services/org.bluez.service
164 %config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
165 %dir /var/lib/bluetooth
166 %dir %{_sysconfdir}/modprobe.d
167 %config(noreplace) %{_sysconfdir}/modprobe.d/50-bluetooth.conf
168 %{_unitdir}/bluetooth.service
169
170 %files devel
171 %manifest %{name}.manifest
172 %defattr(-, root, root)
173 /usr/include/bluetooth
174 %{_libdir}/libbluetooth.so
175 %{_libdir}/pkgconfig/bluez.pc
176
177 %files -n libbluetooth
178 %manifest %{name}.manifest
179 %defattr(-, root, root)
180 %{_libdir}/libbluetooth.so.*
181 %license COPYING
182
183 %files cups
184 %manifest %{name}.manifest
185 %defattr(-,root,root)
186 %dir %{cups_lib_dir}
187 %dir %{cups_lib_dir}/backend
188 %{cups_lib_dir}/backend/bluetooth
189
190 %files -n obexd
191 %defattr(-,root,root,-)
192 /lib/bluetooth/obexd
193 %{_unitdir_user}/obex.service
194 %{_datadir}/dbus-1/services/org.bluez.obex.service
195 %{_sysconfdir}/obex/root-setup.d/000_create-symlinks
196 %{_bindir}/obex-root-setup
197
198 %files test
199 %manifest %{name}.manifest
200 %defattr(-,root,root)
201 %{_libdir}/bluez/test/*
202 %{_bindir}/l2test
203 %{_bindir}/rctest
204 %{_bindir}/bluetoothctl
205 %{_bindir}/btiotest
206 %{_bindir}/mpris-player
207 %{_bindir}/bluetooth-player
208 %{_bindir}/btmon
209 %{_bindir}/hcidump
210 %{_bindir}/btmgmt
211 %{_bindir}/scotest
212 %{_bindir}/bluemoon
213
214 %docs_package
215
216 %changelog