%define crosswalk_extensions tizen-extensions-crosswalk
+%define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions}
+
Name: webapi-plugins
Version: 0.21
Release: 0
export GYP_GENERATORS='ninja'
GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=%{profile} -Dprivilege_engine=%{tizen_privilege_engine}"
GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
+GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
# feature flags
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_is_emulator=%{?tizen_is_emulator}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_feature_system_info_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_feature_system_setting_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_feature_telephony_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{tizen_feature_time_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_feature_time_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_feature_inputdevice_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_feature_web_setting_support}"
GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_feature_wi_fi_support}"
cat LICENSE.BSD-2.0 >> %{buildroot}/usr/share/license/%{name}
# Extensions.
-mkdir -p %{buildroot}%{_libdir}/%{crosswalk_extensions}
-install -p -m 644 out/Default/libtizen*.so %{buildroot}%{_libdir}/%{crosswalk_extensions}
+mkdir -p %{buildroot}%{crosswalk_extensions_path}
+install -p -m 644 out/Default/libtizen*.so %{buildroot}%{crosswalk_extensions_path}
# devel files
mkdir -p %{buildroot}%{_libdir}/pkgconfig
cp -a tools/slimit %{buildroot}%{_includedir}/%{name}/tools/slimit
# execute desc_gentool
-LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir}/%{crosswalk_extensions} out/Default/desc_gentool %{buildroot}%{_libdir}/%{crosswalk_extensions} > plugins.json
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path} out/Default/desc_gentool \
+ %{crosswalk_extensions_path} \
+ %{buildroot}%{crosswalk_extensions_path} > plugins.json
# temporary plugins description for lazy loading
-install -p -m 644 plugins.json %{buildroot}%{_libdir}/%{crosswalk_extensions}/plugins.json
+install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/plugins.json
%files
-%{_libdir}/%{crosswalk_extensions}/libtizen*.so
-%{_libdir}/%{crosswalk_extensions}/plugins.json
+%{crosswalk_extensions_path}/libtizen*.so
+%{crosswalk_extensions_path}/plugins.json
%{_datadir}/license/%{name}
%manifest webapi-plugins.manifest
static std::string prefix_ = "libtizen";
static std::string postfix_ = ".so";
-static std::string target_path_ = "/usr/lib/tizen-extensions-crosswalk/";
static std::vector<std::string> apinamespaces = {"tizen", "xwalk"};
typedef common::Extension *(*CreateExtensionFunc)(void);
}
int main(int argc, char* argv[]) {
- if (argc < 2) {
+ if (argc < 3) {
std::cerr << "Need tizen crosswalk path" << std::endl;
return -1;
}
- std::string tce_path = argv[1];
-
- if (tce_path.empty()) {
+ std::string lib_path = argv[1];
+ if (lib_path.empty()) {
+ std::cerr << "Invalid libpath for tec." << std::endl;
+ return -1;
+ }
+
+ std::string tec_path = argv[2];
+ if (tec_path.empty()) {
std::cerr << "Invalid tizen crosswalk path" << std::endl;
return -1;
}
DIR * dir;
struct dirent *ent;
- if ((dir = opendir(tce_path.c_str())) != NULL) {
+ if ((dir = opendir(tec_path.c_str())) != NULL) {
while ((ent = readdir(dir)) != NULL) {
std::string fname = ent->d_name;
!fname.compare(0, prefix_.size(), prefix_) &&
!fname.compare(fname.size() - postfix_.size(), postfix_.size(),
postfix_)) {
- std::string so_path = tce_path + "/" + fname;
+ std::string so_path = tec_path + "/" + fname;
char* error;
void *handle = dlopen(so_path.c_str(), RTLD_LAZY);
if ((error = dlerror()) != NULL) {
} else {
ext++;
descriptions[ext] = module_description();
- descriptions[ext].lib = target_path_ + fname;
+ descriptions[ext].lib = lib_path + "/" + fname;
int ret = initialize(ext, get_interface);
if (ret != XW_OK) {
std::cerr << "Error loading extension " << fname << std::endl;
print_json();
} else {
- std::cerr << "path not exist : " << tce_path << std::endl;
+ std::cerr << "path not exist : " << tec_path << std::endl;
return -1;
}