%global __provides_exclude_from ^(.*\\.tm1)$
#%define __spec_check_pre exit 0
+%define unified true
+%define certificate false
#%define with_libcapng --enable-capng
%define _libpath /usr/lib
%description
The Bluetooth stack for Linux.
+%if %{unified} == true
%package extension-bredr
Summary: Bluez extension for BREDR functionality
Requires: %{name} = %{version}-%{release}
Conflicts: %{name}-extension-bredr = %{version}-%{release}
%description extension-le
Bluez extension for LE functionality
+%endif
%package -n obexd
Summary: OBEX Server A basic OBEX server implementation
export CFLAGS_DEFAULT="$CFLAGS"
+%if %{unified} == true
# Add GCC9 exception
export CFLAGS+=" -Wno-stringop-truncation -Wno-format-truncation -Wno-address-of-packed-member"
make distclean
autoreconf -fiv
-
+%endif
export CFLAGS="$CFLAGS_DEFAULT"
# Add GCC9 exception
export CFLAGS+=" -DARCH64"
%endif
+%if %{certificate} == true
+export CFLAGS+=" -DTIZEN_CERTIFICATE"
+%endif
+
%reconfigure --disable-static \
--sysconfdir=%{_sysconfdir} \
--localstatedir=%{_localstatedir} \
%install
%make_install
+%if %{unified} == true
pushd bredr
for FILE in bluetoothd; do mv "$FILE" "%{buildroot}%{_libexecdir}/bluetooth/$FILE.bredr"; done
popd
pushd le
for FILE in bluetoothd; do mv "$FILE" "%{buildroot}%{_libexecdir}/bluetooth/$FILE.le"; done
popd
+%endif
# bluez-test
rm -rvf $RPM_BUILD_ROOT/%{_libdir}/gstreamer-*
#install --mode=0755 -D %{S:4} $RPM_BUILD_ROOT/usr/lib/udev/bluetooth.sh
+%if %{unified} == true
install --mode=0644 -D %{S:7} $RPM_BUILD_ROOT/%{_sysconfdir}/modprobe.d/50-bluetooth.conf
+%endif
# no idea why this is suddenly necessary...
install --mode 0755 -d $RPM_BUILD_ROOT/var/lib/bluetooth
install -D -m 0644 src/bluetooth.service %{buildroot}%{_libpath}/systemd/system/bluez-start.service
+%if %{unified} == true
%post -n bluez-extension-bredr
pushd %{_libexecdir}/bluetooth
for FILE in bluetoothd.bredr; do mv "$FILE" "${FILE%.bredr}"; done
for FILE in bluetoothd.le; do mv "$FILE" "${FILE%.le}"; done
popd
/sbin/ldconfig
+%endif
%files
%manifest %{name}.manifest
%{_unitdir}/bluez-start.service
%exclude %{_unitdir}/bluetooth.service
+%if %{unified} == true
%files -n bluez-extension-bredr
%manifest %{name}.manifest
%defattr(-, root, root)
%dir /var/lib/bluetooth
%dir %{_sysconfdir}/modprobe.d
%config(noreplace) %{_sysconfdir}/modprobe.d/50-bluetooth.conf
+%endif
%files mesh
%manifest %{name}.manifest