summaryrefslogtreecommitdiff
path: root/packaging/download-provider.spec
blob: 06b893cc8571fa1677a1b60af8bfe85a84fd4f74 (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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
%define _ux_define tizen2.3
Name:       download-provider
Summary:    Download the contents in background
Version:    2.1.23
Release:    0
Group:      Development/Libraries
License:    Apache License, Version 2.0
Source0:    %{name}-%{version}.tar.gz
Requires(post): sys-assert
Requires(post): libdevice-node
Requires(post): sqlite
Requires(post): connman
BuildRequires:  cmake
BuildRequires:  pkgconfig(dlog)
BuildRequires:  pkgconfig(gobject-2.0)
BuildRequires:  pkgconfig(xdgmime)
BuildRequires:  pkgconfig(vconf)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(bundle)
BuildRequires:  pkgconfig(capi-base-common)
BuildRequires:  pkgconfig(capi-appfw-app-manager)
BuildRequires:  pkgconfig(capi-appfw-application)
BuildRequires:  pkgconfig(capi-network-connection)
BuildRequires:  pkgconfig(appsvc)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(capi-content-mime-type)
BuildRequires:  pkgconfig(libsmack)
BuildRequires:  gettext-devel
BuildRequires:  pkgconfig(libsystemd-daemon)
BuildRequires:  pkgconfig(capi-network-wifi-direct)
BuildRequires:  pkgconfig(libresourced)
#BuildRequires:  model-build-features T30
BuildRequires:  pkgconfig(storage)
%if "%{?tizen_profile_name}" == "wearable"
BuildRequires:  pkgconfig(security-server)
%else if "%{?tizen_profile_name}" == "mobile"
BuildRequires:  pkgconfig(notification)
%endif

%description
Description: Download the contents in background

%package devel
Summary:    download-provider
Group:      Development/Libraries
Requires:   %{name} = %{version}-%{release}

%description devel
Description: Download the contents in background (development files)

%prep
%setup -q

%define _data_install_path /opt/usr/data/%{name}
%define _resource_install_path /usr/share/%{name}
%define _imagedir %{_resource_install_path}/images 
%define _localedir %{_resource_install_path}/locales
%define _databasedir %{_data_install_path}/database
%define _database_client_dir %{_databasedir}/clients
%define _notifydir %{_data_install_path}/notify
%define _ipc_socket /opt/data/%{name}/%{name}.sock
%define _licensedir /usr/share/license
%define _logdump_script_dir /opt/etc/dump.d/module.d
%define _http_lib libcurl

%define download_booster OFF
%define sys_resource OFF
%define support_oma_drm OFF
%define wifi_direct ON
%define support_security_privilege OFF
%define support_companion_mode OFF
%define support_notification ON
%define support_knox ON
%define _manifest_name %{name}.manifest

%if 0%{?model_build_feature_wlan_p2p_disable }
%define wifi_direct OFF
%endif
%if "%{?tizen_profile_name}" == "wearable"
%define download_booster OFF
%define support_notification OFF
%define _manifest_name %{name}-w.manifest
%endif
%if 0%{?sec_product_feature_container_enable}
%define support_knox ON
%endif

%define cmake \
	CFLAGS="${CFLAGS:-%optflags} -fPIC -D_REENTRANT -fvisibility=hidden"; export CFLAGS \
	FFLAGS="${FFLAGS:-%optflags} -fPIC -fvisibility=hidden"; export FFLAGS \
	LDFLAGS+=" -Wl,--as-needed -Wl,--hash-style=both"; export LDFLAGS \
	%__cmake \\\
		-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\
		-DBIN_INSTALL_DIR:PATH=%{_bindir} \\\
		-DLIB_INSTALL_DIR:PATH=%{_libdir} \\\
		-DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\
		-DPKG_NAME=%{name} \\\
		-DPKG_VERSION=%{version} \\\
		-DPKG_RELEASE=%{release} \\\
		-DIPC_SOCKET:PATH=%{_ipc_socket} \\\
		-DPROVIDER_DIR:PATH=%{_data_install_path} \\\
		-DNOTIFY_DIR:PATH=%{_notifydir} \\\
		-DDATABASE_DIR:PATH=%{_databasedir} \\\
		-DDATABASE_CLIENT_DIR:PATH=%{_database_client_dir} \\\
		-DIMAGE_DIR:PATH=%{_imagedir} \\\
		-DLOCALE_DIR:PATH=%{_localedir} \\\
		-DLICENSE_DIR:PATH=%{_licensedir} \\\
		-DSUPPORT_WIFI_DIRECT:BOOL=OFF \\\
		%if "%{?sys_resource}" == "ON" \
		-DSUPPORT_SYS_RESOURCE:BOOL=ON \\\
		%else \
		-DSUPPORT_SYS_RESOURCE:BOOL=OFF \\\
		%endif \
		%if "%{?download_booster}" == "ON" \
		-DSUPPORT_DOWNLOAD_BOOSTER:BOOL=ON \\\
		%else \
		-DSUPPORT_DOWNLOAD_BOOSTER:BOOL=OFF \\\
		%endif \
		%if "%{?support_notification}" == "ON" \
		-DSUPPORT_NOTIFICATION:BOOL=ON \\\
		%else \
		-DSUPPORT_NOTIFICATION:BOOL=OFF \\\
		%endif \
		-DSUPPORT_LOG_MESSAGE:BOOL=ON \\\
		%if "%{?support_oma_drm}" == "ON" \
		-DSUPPORT_OMA_DRM:BOOL=ON \\\
		%else \
		-DSUPPORT_OMA_DRM:BOOL=OFF \\\
		%endif \
		%if "%{?support_security_privilege}" == "ON" \
		-DSUPPORT_SECURITY_PRIVILEGE:BOOL=ON \\\
		%else \
		-DSUPPORT_SECURITY_PRIVILEGE:BOOL=OFF \\\
		%endif \
		%if "%{?support_companion_mode}" == "ON" \
		-DSUPPORT_COMPANION_MODE:BOOL=ON \\\
		%else \
		-DSUPPORT_COMPANION_MODE:BOOL=OFF \\\
		%endif \
		%if "%{?support_knox}" == "ON" \
		-DSUPPORT_KNOX:BOOL=ON \\\
		%else \
		-DSUPPORT_KNOX:BOOL=OFF \\\
		%endif \
		%if "%{?_ux_define}" == "tizen2.3" \
		-DTIZEN_2_3_UX:BOOL=ON \\\
		%endif \
		-DCMAKE_LOG_DUMP_SCRIPT_DIR=%{_logdump_script_dir} \\\
		-DHTTP_LIB=%{_http_lib} \\\
		%if "%{?_lib}" == "lib64" \
		%{?_cmake_lib_suffix64} \\\
		%endif \
		%{?_cmake_skip_rpath} \\\
		-DBUILD_SHARED_LIBS:BOOL=ON

%build
export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
%cmake .
make %{?jobs:-j%jobs}

%install
rm -rf %{buildroot}
%make_install

#%if 0%{?sec_product_feature_container_enable}
mkdir -p %{buildroot}/etc/vasum/vsmzone.resource/
mv %{buildroot}/usr/share/download-provider/download-provider.res %{buildroot}/etc/vasum/vsmzone.resource/
#%endif

mkdir -p %{buildroot}%{_licensedir}
mkdir -p %{buildroot}%{_libdir}/systemd/system/graphical.target.wants
mkdir -p %{buildroot}%{_libdir}/systemd/system/sockets.target.wants
ln -s ../download-provider.service %{buildroot}%{_libdir}/systemd/system/graphical.target.wants/
ln -s ../download-provider.socket %{buildroot}%{_libdir}/systemd/system/sockets.target.wants/

%post
#make notify dir in post section for smack
mkdir -p %{_notifydir}
mkdir -p --mode=0700 %{_databasedir}
chsmack -a 'download-provider' %{_databasedir}
mkdir -p --mode=0700 %{_database_client_dir}
chsmack -a 'download-provider' %{_database_client_dir}

%files
%defattr(-,root,root,-)
%manifest %{_manifest_name}
%{_imagedir}/*.png
%{_localedir}/*/*/download-provider.mo
%{_libdir}/libdownloadagent2.so.0.1.0
%{_libdir}/libdownloadagent2.so
%{_libdir}/systemd/system/download-provider.service
%{_libdir}/systemd/system/graphical.target.wants/download-provider.service
%{_libdir}/systemd/system/download-provider.socket
%{_libdir}/systemd/system/sockets.target.wants/download-provider.socket
%{_libdir}/libdownload-provider-interface.so.%{version}
%{_libdir}/libdownload-provider-interface.so.0
%{_bindir}/%{name}
%{_licensedir}/%{name}
%attr(0544,root,root) %{_logdump_script_dir}/dump-%{name}.sh
#%if 0%{?sec_product_feature_container_enable}
%attr(0644,root,root) /etc/vasum/vsmzone.resource/download-provider.res
#%endif

%files devel
%defattr(-,root,root,-)
%{_libdir}/libdownloadagent2.so.0.1.0
%{_libdir}/libdownloadagent2.so
%{_libdir}/libdownload-provider-interface.so
%{_includedir}/download-provider/download-provider.h
%{_includedir}/download-provider/download-provider-interface.h
%{_bindir}/%{name}
%{_libdir}/pkgconfig/download-provider.pc
%{_libdir}/pkgconfig/download-provider-interface.pc