SAM: remove Global Variable violations
[platform/framework/web/download-provider.git] / packaging / download-provider.spec
1 Name:       download-provider
2 Summary:    Download the contents in background
3 Version:    2.1.121
4 Release:    0
5 Group:      Development/Libraries
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Requires(post): sqlite
9 Requires(post): connman
10 Requires: security-config
11 BuildRequires:  cmake
12 BuildRequires:  pkgconfig(dlog)
13 BuildRequires:  pkgconfig(gobject-2.0)
14 BuildRequires:  pkgconfig(xdgmime)
15 BuildRequires:  pkgconfig(vconf)
16 BuildRequires:  pkgconfig(sqlite3)
17 BuildRequires:  pkgconfig(bundle)
18 BuildRequires:  pkgconfig(capi-base-common)
19 BuildRequires:  pkgconfig(capi-appfw-app-manager)
20 BuildRequires:  pkgconfig(capi-appfw-application)
21 BuildRequires:  pkgconfig(capi-network-connection)
22 BuildRequires:  pkgconfig(appsvc)
23 BuildRequires:  pkgconfig(libcurl)
24 BuildRequires:  pkgconfig(capi-content-mime-type)
25 BuildRequires:  gettext-devel
26 BuildRequires:  pkgconfig(libsystemd-daemon)
27 BuildRequires:  pkgconfig(capi-network-wifi-direct)
28 %if "%{?profile}" != "wearable"
29 BuildRequires:  pkgconfig(notification)
30 %endif
31 BuildRequires:  pkgconfig(storage)
32 BuildRequires:  pkgconfig(cynara-client)
33 BuildRequires:  pkgconfig(cynara-client-async)
34 BuildRequires:  pkgconfig(cynara-creds-socket)
35 BuildRequires:  pkgconfig(cynara-creds-dbus)
36 BuildRequires:  pkgconfig(libtzplatform-config)
37
38 %if 0%{?gtests:1}
39 BuildRequires:  pkgconfig(gmock)
40 %endif
41
42 %description
43 Description: Download the contents in background
44
45 %package devel
46 Summary:    download-provider
47 Group:      Development/Libraries
48 Requires:   %{name} = %{version}-%{release}
49
50 %description devel
51 Description: Download the contents in background (development files)
52
53 %prep
54 %setup -q
55
56 %define _data_install_path %{TZ_SYS_GLOBALUSER_DATA}/%{name}
57 %define _resource_install_path /usr/share/%{name}
58 %define _imagedir %{_resource_install_path}/images
59 %define _localedir %{_resource_install_path}/locales
60 %define _databasedir %{_data_install_path}/database
61 %define _database_client_dir %{_databasedir}/clients
62 %define _notifydir %{_data_install_path}/notify
63 %define _ipc_socket /tmp/.download-provider.sock
64 %define _logdump_script_dir %{TZ_SYS_ETC}/dump.d/module.d
65 %define _http_lib libcurl
66 %define _manifest_name %{name}.manifest
67 %if "%{?tizen_profile_name}" == "tv"
68 %define _ca_cert /opt/data/cert/vdca.pem
69 %define _ca_path /opt/data/cert/user/
70 %endif
71
72 %build
73 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
74 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
75 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
76
77 %if 0%{?gcov:1}
78 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
79 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
80 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
81 export LDFLAGS+=" -lgcov"
82 %endif
83
84 %cmake -DTZ_SYS_GLOBALUSER_DATA=%TZ_SYS_GLOBALUSER_DATA \
85         -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
86         -DBIN_INSTALL_DIR:PATH=%{_bindir} \
87         -DLIB_INSTALL_DIR:PATH=%{_libdir} \
88         -DLIB_AGENT_PATH="/usr/%{?_lib}/libdownloadagent2.so.0.1.0" \
89         -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \
90         -DPKG_NAME=%{name} \
91         -DPKG_VERSION=%{version} \
92         -DPKG_RELEASE=%{release} \
93         -DIPC_SOCKET:PATH=%{_ipc_socket} \
94         -DPROVIDER_DIR:PATH=%{_data_install_path} \
95         -DNOTIFY_DIR:PATH=%{_notifydir} \
96         -DDATABASE_DIR:PATH=%{_databasedir} \
97         -DDATABASE_CLIENT_DIR:PATH=%{_database_client_dir} \
98         -DIMAGE_DIR:PATH=%{_imagedir} \
99         -DLOCALE_DIR:PATH=%{_localedir} \
100         -DSUPPORT_WIFI_DIRECT:BOOL=OFF \
101         -DSUPPORT_DOWNLOAD_BOOSTER:BOOL=OFF \
102 %if "%{?profile}" == "wearable"
103         -DSUPPORT_NOTIFICATION:BOOL=OFF \
104 %else
105         -DSUPPORT_NOTIFICATION:BOOL=ON \
106 %endif
107         -DSUPPORT_LOG_MESSAGE:BOOL=ON \
108         -DSUPPORT_OMA_DRM:BOOL=OFF \
109         -DSUPPORT_COMPANION_MODE:BOOL=OFF \
110 %if "%{?profile}" == "wearable"
111         -DSUPPORT_MULTILINGUAL:BOOL=ON \
112 %else
113         -DSUPPORT_MULTILINGUAL:BOOL=OFF \
114 %endif
115         -DCMAKE_LOG_DUMP_SCRIPT_DIR=%{_logdump_script_dir} \
116         -DHTTP_LIB=%{_http_lib} \
117 %if "%{?_lib}" == "lib64"
118         %{?_cmake_lib_suffix64} \
119 %endif
120         %{?_cmake_skip_rpath} \
121         -DBUILD_SHARED_LIBS:BOOL=ON \
122         -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
123         -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} \
124         -DSUPPORT_LARGE_FILE:BOOL=ON \
125 %if "%{?tizen_profile_name}" == "tv"
126         -DCA_CERT=%{_ca_cert} \
127         -DCA_PATH=%{_ca_path} \
128 %endif
129         .
130
131 make %{?jobs:-j%jobs}
132
133 %install
134 rm -rf %{buildroot}
135 %make_install
136 %if "%{?tizen_profile_name}" == "tv"
137 mkdir -p %{buildroot}/etc/notstrip/
138 install -m 644 packaging/download-provider.notstrip %{buildroot}/etc/notstrip/download-provider.notstrip
139 %endif
140
141 ## container_enable
142 mkdir -p %{buildroot}/etc/vasum/vsmzone.resource/
143 mv %{buildroot}/usr/share/download-provider/download-provider.res %{buildroot}/etc/vasum/vsmzone.resource/
144
145 mkdir -p %{buildroot}/lib/systemd/system/sockets.target.wants
146 ln -s ../download-provider.socket %{buildroot}/lib/systemd/system/sockets.target.wants/
147
148 %post
149 #make notify dir in post section for smack
150 mkdir %{TZ_SYS_GLOBALUSER_DATA}/download-provider
151 mkdir -p %{_notifydir}
152 chown -R web_fw:web_fw %{_notifydir}
153 chsmack -a 'System::Shared' %{_notifydir}
154 chsmack -t %{_notifydir}
155 mkdir -p --mode=0700 %{_databasedir}
156 chown -R web_fw:web_fw %{_databasedir}
157 chsmack -a 'System' %{_databasedir}
158 mkdir -p --mode=0700 %{_database_client_dir}
159 chsmack -a 'System' %{_database_client_dir}
160 chown -R web_fw:web_fw %{_database_client_dir}
161 chown -R web_fw:web_fw %{_data_install_path}
162
163 %files
164 %defattr(-,root,root,-)
165 %manifest %{_manifest_name}
166 %{_imagedir}/*.png
167 %{_localedir}/*/*/download-provider.mo
168 %{_libdir}/*.so.*
169 /lib/systemd/system/download-provider.service
170 /lib/systemd/system/download-provider.socket
171 /lib/systemd/system/sockets.target.wants/download-provider.socket
172 %{_bindir}/%{name}
173 %attr(0544,root,root) %{_logdump_script_dir}/dump-%{name}.sh
174 ## container_enable
175 %attr(0644,root,root) /etc/vasum/vsmzone.resource/download-provider.res
176 %if "%{?tizen_profile_name}" == "tv"
177 /etc/notstrip/download-provider.notstrip
178 %endif
179 %license LICENSE.APLv2
180
181 %files devel
182 %defattr(-,root,root,-)
183 %{_bindir}/%{name}
184 %{_libdir}/*.so
185 %{_libdir}/pkgconfig/download-provider.pc
186 %{_libdir}/pkgconfig/download-provider-interface.pc
187 %{_libdir}/pkgconfig/download-agent.pc
188 %{_includedir}/download-provider/download-provider.h
189 %{_includedir}/download-provider/download-provider-interface.h
190 %{_includedir}/download-provider/download-agent-interface.h
191
192 %if 0%{?gtests:1}
193 %{_bindir}/gtest*
194 %endif