Revert "Remove bt-dev-start.sh / bt-dev-end.sh installation on no-firmware package"
[platform/core/connectivity/bluetooth-tools.git] / packaging / bluetooth-tools.spec
1 Name:       bluetooth-tools
2 Summary:    Bluetooth-tools
3 Version:    0.2.37
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 CXXFLAGS+=" -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         -DTIZEN_IVI=NO \
49 %else
50 %if "%{profile}" == "wearable"
51         -DTIZEN_MOBILE=NO \
52         -DTIZEN_WEARABLE=YES \
53         -DTIZEN_IVI=NO \
54 %else
55 %if "%{profile}" == "ivi"
56         -DTIZEN_MOBILE=NO \
57         -DTIZEN_WEARABLE=NO \
58         -DTIZEN_IVI=YES \
59 %else
60         -DTIZEN_MOBILE=NO \
61         -DTIZEN_WEARABLE=NO \
62         -DTIZEN_IVI=NO \
63 %endif
64 %endif
65 %endif
66
67 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
68 %__make %{?_smp_mflags}
69 #cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
70 #make %{?jobs:-j%jobs}
71
72 %install
73 rm -rf %{buildroot}
74 %make_install
75
76 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d
77 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d
78 ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-address %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
79 ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-address %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address
80
81 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
82 install -m 0644 %{SOURCE1001} %{buildroot}%{_unitdir}
83 ln -s ../bluetooth-address.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-address.service
84
85 mkdir -p %{buildroot}%{_prefix}/etc/bluetooth/
86 install -m 0755 scripts/bt-dev-start.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-start.sh
87 install -m 0755 scripts/bt-dev-end.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-end.sh
88 install -D -m 0644 LICENSE.APLv2 %{buildroot}%{_datadir}/license/bluetooth-tools
89
90 %files
91 %manifest %{name}.manifest
92 %defattr(-,root,root,-)
93 %if "%{profile}" == "mobile" || "%{profile}" == "wearable" || "%{profile}" == "ivi"
94 %exclude %{_sysconfdir}/rc.d/init.d/bluetooth-address
95 %else
96 %{_sysconfdir}/rc.d/init.d/bluetooth-address
97 %endif
98 %{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
99 %{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address
100 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-stack-up.sh
101 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-stack-down.sh
102 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-reset-env.sh
103 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-on.sh
104 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-dev-up.sh
105 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-mode-on.sh
106 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-off.sh
107 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-hci-logdump.sh
108 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-run-hcidump.sh
109 %if "%{profile}" == "mobile"
110 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-stack-down-with-radio.sh
111 %endif
112 %{_datadir}/license/bluetooth-tools
113 %{_unitdir}/multi-user.target.wants/bluetooth-address.service
114 %{_unitdir}/bluetooth-address.service
115
116 %files no-firmware
117 %manifest %{name}.manifest
118 %defattr(-, root, root)
119 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
120 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start.sh