Fix wearable build error
[platform/core/connectivity/bluetooth-tools.git] / packaging / bluetooth-tools.spec
1 Name:       bluetooth-tools
2 Summary:    Bluetooth-tools
3 Version:    0.2.35
4 Release:    0
5 Group:      Network & Connectivity/Bluetooth
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001: bluetooth-address.service
9 BuildRequires:  cmake
10 Suggests:       bluetooth-share
11 Requires:       tizen-platform-config-tools
12 %if "%{profile}" != "mobile"
13 Requires :      bluetooth-tools-no-firmware
14 %endif
15
16 %description
17 Tools fo bluetooth run/stop and set address
18
19 %package no-firmware
20 Summary:    On/Off Bluetooth adapter
21 Group:      Network & Connectivity/Bluetooth
22 Requires:   %{name} = %{version}-%{release}
23 Requires:   rfkill
24 Conflicts:  bluetooth-firmware-bcm
25
26 %description no-firmware
27 On/Off bluetooth device
28
29 %prep
30 %setup -q
31
32 %build
33 export CFLAGS+=" -fpie -fvisibility=hidden"
34 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
35
36 %if "%{profile}" == "mobile"
37 export CFLAGS="$CFLAGS -DTIZEN_MOBILE"
38 %else
39 %if "%{profile}" == "wearable"
40 export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
41 %endif
42 %endif
43
44 %cmake \
45 %if "%{profile}" == "mobile"
46         -DTIZEN_MOBILE=YES \
47         -DTIZEN_WEARABLE=NO \
48 %else
49 %if "%{profile}" == "wearable"
50         -DTIZEN_MOBILE=NO \
51         -DTIZEN_WEARABLE=YES \
52 %else
53         -DTIZEN_MOBILE=NO \
54         -DTIZEN_WEARABLE=NO \
55 %endif
56 %endif
57
58 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
59 %__make %{?_smp_mflags}
60 #cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
61 #make %{?jobs:-j%jobs}
62
63 %install
64 rm -rf %{buildroot}
65 %make_install
66
67 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d
68 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d
69 ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-address %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
70 ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-address %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address
71
72 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
73 install -m 0644 %{SOURCE1001} %{buildroot}%{_unitdir}
74 ln -s ../bluetooth-address.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-address.service
75
76 mkdir -p %{buildroot}%{_prefix}/etc/bluetooth/
77 install -m 0755 scripts/bt-dev-start.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-start.sh
78 install -m 0755 scripts/bt-dev-end.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-end.sh
79 install -D -m 0644 LICENSE.APLv2 %{buildroot}%{_datadir}/license/bluetooth-tools
80
81 %files
82 %manifest %{name}.manifest
83 %defattr(-,root,root,-)
84 %if "%{profile}" == "mobile" || "%{profile}" == "wearable"
85 %exclude %{_sysconfdir}/rc.d/init.d/bluetooth-address
86 %else
87 %{_sysconfdir}/rc.d/init.d/bluetooth-address
88 %endif
89 %{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
90 %{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address
91 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-stack-up.sh
92 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-stack-down.sh
93 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-reset-env.sh
94 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-on.sh
95 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-dev-up.sh
96 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-mode-on.sh
97 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-off.sh
98 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-hci-logdump.sh
99 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-run-hcidump.sh
100 %{_datadir}/license/bluetooth-tools
101 %{_unitdir}/multi-user.target.wants/bluetooth-address.service
102 %{_unitdir}/bluetooth-address.service
103
104 %files no-firmware
105 %manifest %{name}.manifest
106 %defattr(-, root, root)
107 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
108 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start.sh