summaryrefslogtreecommitdiff
path: root/packaging/capi-network-bluetooth.spec
blob: 7fee3e7758b5ebcf36608b838395990f07460477 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
Name:       capi-network-bluetooth
Summary:    Network Bluetooth Framework
Version:    0.1.52
Release:    1
Group:      Connectivity/API
License:    Apache-2.0
Source0:    %{name}-%{version}.tar.gz
Source1001:	%{name}.manifest
Source1002:	%{name}-devel.manifest
#Requires(post): /sbin/ldconfig
#Requires(postun): /sbin/ldconfig

BuildRequires:  pkgconfig(dbus-glib-1)
BuildRequires:  pkgconfig(dlog)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(vconf)
%if "%{?profile}" == "tv"
BuildRequires:  pkgconfig(bluetooth-api)
BuildRequires:  pkgconfig(db-util)
%else
BuildRequires:  pkgconfig(bluetooth-api)
%endif
BuildRequires:  pkgconfig(capi-base-common)
BuildRequires:  cmake

%description
Network Bluetooth Framework

%package devel
Summary:    Network Bluetooth Framework (DEV)
Group:      Development/Connectivit
Requires:   %{name} = %{version}-%{release}

%description devel
Network Bluetooth Framework.

%devel_desc

%package test
Summary: Network Bluetooth Framework test application
Group:   TO_BE/FILLED
Requires: %{name} = %{version}-%{release}

%description test
This package is C-API test application.

%prep
%setup -q
cp %{SOURCE1001} %{SOURCE1002} .

%build

%if "%{?_with_emulator}" == "1"
export CFLAGS="$CFLAGS -DTIZEN_BT_DISABLE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_BT_DISABLE"
export FFLAGS="$FFLAGS -DTIZEN_BT_DISABLE"

%if "%{?profile}" == "wearable"
export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_WEARABLE"
export FFLAGS="$FFLAGS -DTIZEN_WEARABLE"
%else
export CFLAGS="$CFLAGS -DTIZEN_PBAP_DISABLE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_PBAP_DISABLE"
export FFLAGS="$FFLAGS -DTIZEN_PBAP_DISABLE"
%endif

%else # _with_emulator
export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE -DTIZEN_ENGINEER_MODE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE -DTIZEN_ENGINEER_MODE"
export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE -DTIZEN_ENGINEER_MODE"

%if "%{?profile}" == "tv"
export CFLAGS="$CFLAGS -DTIZEN_OPP_CLIENT_DISABLE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_OPP_CLIENT_DISABLE"
export FFLAGS="$FFLAGS -DTIZEN_OPP_CLIENT_DISABLE"

export CFLAGS="$CFLAGS -DTIZEN_OPP_SERVER_DISABLE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_OPP_SERVER_DISABLE"
export FFLAGS="$FFLAGS -DTIZEN_OPP_SERVER_DISABLE"

export CFLAGS="$CFLAGS -DTIZEN_HFP_DISABLE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_HFP_DISABLE"
export FFLAGS="$FFLAGS -DTIZEN_HFP_DISABLE"
%endif


%if "%{?profile}" == "mobile"
export CFLAGS="$CFLAGS -DBT_ENABLE_LEGACY_GATT_CLIENT -DTIZEN_MOBILE"
export CXXFLAGS="$CXXFLAGS -DBT_ENABLE_LEGACY_GATT_CLIENT -DTIZEN_MOBILE"
export FFLAGS="$FFLAGS -DBT_ENABLE_LEGACY_GATT_CLIENT -DTIZEN_MOBILE"
%endif

export CFLAGS="$CFLAGS -DTIZEN_AUDIO_HF_DISABLE -DTIZEN_IPSP_SUPPORT"
export CXXFLAGS="$CXXFLAGS -DTIZEN_AUDIO_HF_DISABLE -DTIZEN_IPSP_SUPPORT"
export FFLAGS="$FFLAGS -DTIZEN_AUDIO_HF_DISABLE -DTIZEN_IPSP_SUPPORT"

%if "%{?profile}" == "wearable"
export CFLAGS="$CFLAGS -DTIZEN_HFP_DISABLE -DTELEPHONY_DISABLED -DTIZEN_HDP_DISABLE -DTIZEN_HID_HOST_DISABLE -DTIZEN_OPP_CLIENT_DISABLE -DTIZEN_OPP_SERVER_DISABLE -DTIZEN_WEARABLE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_HFP_DISABLE -DTELEPHONY_DISABLED -DTIZEN_HDP_DISABLE -DTIZEN_HID_HOST_DISABLE -DTIZEN_OPP_CLIENT_DISABLE -DTIZEN_OPP_SERVER_DISABLE -DTIZEN_WEARABLE"
export FFLAGS="$FFLAGS -DTIZEN_HFP_DISABLE -DTELEPHONY_DISABLED -DTIZEN_HDP_DISABLE -DTIZEN_HID_HOST_DISABLE -DTIZEN_OPP_CLIENT_DISABLE -DTIZEN_OPP_SERVER_DISABLE -DTIZEN_WEARABLE"
%endif
%endif # _with_emulator

%ifarch aarch64
echo arch64
export CFLAGS+=" -DARCH64"
export CXXFLAGS+=" -DARCH64"
export FFLAGS+=" -DARCH64"
%endif

%ifarch x86_64
echo x86_64
export CFLAGS+=" -DARCH64"
export CXXFLAGS+=" -DARCH64"
export FFLAGS+=" -DARCH64"
%endif

%cmake \
%if "%{?profile}" == "wearable"
	-DTIZEN_WEARABLE=YES \
%else
%if "%{?profile}" == "tv"
	-DTIZEN_TV=YES \
%else
%if "%{?profile}" == "mobile"
	-DTIZEN_WEARABLE=NO \
	-DTIZEN_MOBILE=YES \
%endif
%endif
%endif

MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}

make %{?jobs:-j%jobs}

%install
rm -rf %{buildroot}
%make_install
install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/capi-network-bluetooth
install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/capi-network-bluetooth-devel


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%manifest %{name}.manifest
#%license LICENSE.APLv2 LICENSE
%{_libdir}/libcapi-network-bluetooth.so.*
%{_datadir}/license/capi-network-bluetooth
%{_datadir}/license/capi-network-bluetooth-devel

%files test
%manifest %{name}.manifest
%if "%{?profile}" != "tv"
%{_bindir}/bt_unit_test
%endif
#%{_bindir}/bt_onoff
#/etc/smack/accesses.d/capi-network-bluetooth-test.efl

%files devel
%manifest %{name}-devel.manifest
%{_includedir}/network/bluetooth.h
%{_includedir}/network/bluetooth_internal.h
%{_includedir}/network/bluetooth_type.h
%{_includedir}/network/bluetooth_type_internal.h
%{_includedir}/network/bluetooth_extension.h
%{_includedir}/network/bluetooth_type_extension.h

%{_libdir}/pkgconfig/capi-network-bluetooth.pc
%{_libdir}/libcapi-network-bluetooth.so

#%{_datadir}/license/capi-network-bluetooth-devel