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