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