From f3bf9bbbb38d2fa7b102f032b7b78ef6acfe7efc Mon Sep 17 00:00:00 2001 From: Baptiste DURAND Date: Thu, 30 May 2013 16:23:09 +0200 Subject: [PATCH] Fix compatibility for x64 arch -> Fix hardcoded library path in the code -> Fix hardcoded library path in a txt file preload_list_wrt.txt -> Use %cmake macro -> Fix library install directory -> Fix pc file install directory -> Fix pc file -> Fix LD FLAGS -> Fix systemd service installation --- CMakeLists.txt | 2 +- packaging/wrt.spec | 20 ++++++++++---------- pkgconfig/wrt-core.pc.in | 2 +- src/api_new/CMakeLists.txt | 2 +- src/api_new/ewk_context_manager.cpp | 2 +- src/plugin-service/CMakeLists.txt | 2 +- src/profiling/CMakeLists.txt | 2 +- src/view/webkit/injected-bundle/CMakeLists.txt | 4 ++-- src/wrt-client/wrt-client.cpp | 2 +- src/wrt-launchpad-daemon/CMakeLists.txt | 3 ++- src/wrt-launchpad-daemon/legacy/preload_list_wrt.txt | 4 ---- .../legacy/preload_list_wrt.txt.in | 4 ++++ 12 files changed, 25 insertions(+), 24 deletions(-) delete mode 100644 src/wrt-launchpad-daemon/legacy/preload_list_wrt.txt create mode 100644 src/wrt-launchpad-daemon/legacy/preload_list_wrt.txt.in diff --git a/CMakeLists.txt b/CMakeLists.txt index f079d12..7b849ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -273,7 +273,7 @@ SET(PKGCONFIG_DIR ${PROJECT_SOURCE_DIR}/pkgconfig) CONFIGURE_FILE(${PKGCONFIG_DIR}/wrt-core.pc.in ${PKGCONFIG_DIR}/wrt-core.pc @ONLY) -INSTALL(FILES ${PKGCONFIG_DIR}/wrt-core.pc DESTINATION lib/pkgconfig) +INSTALL(FILES ${PKGCONFIG_DIR}/wrt-core.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) IF(WITH_TESTS) add_subdirectory(tests) diff --git a/packaging/wrt.spec b/packaging/wrt.spec index 01e2f24..96e508e 100644 --- a/packaging/wrt.spec +++ b/packaging/wrt.spec @@ -83,13 +83,13 @@ wrt library development headers %endif %build -export LDFLAGS+="-Wl,--rpath=/usr/lib" +export LDFLAGS+="-Wl,--rpath=%{_libdir}" -cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \ - -DDPL_LOG="ON" \ - -DPROJECT_VERSION=%{version} \ - -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \ +%cmake . -DDPL_LOG="ON" \ + -DPROJECT_VERSION=%{version} \ + -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \ %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS} + make %{?jobs:-j%jobs} %install @@ -107,9 +107,9 @@ ln -sf ../../init.d/wrt_launchpad_run.sh %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/ ln -sf ../../init.d/wrt_launchpad_run.sh %{buildroot}/%{_sysconfdir}/rc.d/rc4.d/S80wrt_launchpad_run #systemd -mkdir -p %{buildroot}%{_libdir}/systemd/system/graphical.target.wants -install -m 0644 %SOURCE101 %{buildroot}%{_libdir}/systemd/system/wrt_launchpad_daemon@.service -ln -s ../wrt_launchpad_daemon@.service %{buildroot}%{_libdir}/systemd/system/graphical.target.wants/wrt_launchpad_daemon@app.service +mkdir -p %{buildroot}%{_unitdir}/graphical.target.wants +install -m 0644 %SOURCE101 %{buildroot}%{_unitdir}/wrt_launchpad_daemon@.service +ln -s ../wrt_launchpad_daemon@.service %{buildroot}%{_unitdir}/graphical.target.wants/wrt_launchpad_daemon@app.service %preun if [ $1 == 0 ]; then @@ -170,8 +170,8 @@ systemctl daemon-reload /etc/smack/accesses2.d/wrt_launchpad_daemon.rule /opt/etc/smack/accesses.d/wrt_launchpad_daemon.rule #systemd -%{_libdir}/systemd/system/graphical.target.wants/wrt_launchpad_daemon@app.service -%{_libdir}/systemd/system/wrt_launchpad_daemon@.service +%{_unitdir}/graphical.target.wants/wrt_launchpad_daemon@app.service +%{_unitdir}/wrt_launchpad_daemon@.service ############################################################################### %files devel diff --git a/pkgconfig/wrt-core.pc.in b/pkgconfig/wrt-core.pc.in index 8436f7e..66be1c1 100644 --- a/pkgconfig/wrt-core.pc.in +++ b/pkgconfig/wrt-core.pc.in @@ -1,7 +1,7 @@ prefix=/usr project_name=@CMAKE_PROJECT_NAME@ exec_prefix=${prefix} -libdir=${prefix}/lib/ +libdir=@LIB_INSTALL_DIR@ includedir=${prefix}/include/${project_name} Name: WebRuntime wrt core module diff --git a/src/api_new/CMakeLists.txt b/src/api_new/CMakeLists.txt index f5af14a..b57ca4f 100644 --- a/src/api_new/CMakeLists.txt +++ b/src/api_new/CMakeLists.txt @@ -56,7 +56,7 @@ TARGET_LINK_LIBRARIES(${TARGET_CORE_MODULE_LIB} ) INSTALL(TARGETS ${TARGET_CORE_MODULE_LIB} - DESTINATION lib/ + DESTINATION ${LIB_INSTALL_DIR}/ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ ) diff --git a/src/api_new/ewk_context_manager.cpp b/src/api_new/ewk_context_manager.cpp index d3b3c58..d1f4dfc 100644 --- a/src/api_new/ewk_context_manager.cpp +++ b/src/api_new/ewk_context_manager.cpp @@ -36,7 +36,7 @@ namespace WRT { -static const std::string bundlePath("/usr/lib/libwrt-injected-bundle.so"); +static const std::string bundlePath( LIBDIR_PREFIX "/libwrt-injected-bundle.so"); static const std::string caCertPath("/opt/usr/share/certs/ca-certificate.crt"); #ifdef __arm__ diff --git a/src/plugin-service/CMakeLists.txt b/src/plugin-service/CMakeLists.txt index ae0fc98..024e4d7 100644 --- a/src/plugin-service/CMakeLists.txt +++ b/src/plugin-service/CMakeLists.txt @@ -54,4 +54,4 @@ target_link_libraries(${TARGET_PLUGIN_MODULE_LIB} ) INSTALL(TARGETS ${TARGET_PLUGIN_MODULE_LIB} - DESTINATION lib) + DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/profiling/CMakeLists.txt b/src/profiling/CMakeLists.txt index 03cd2fb..a8d5b7e 100644 --- a/src/profiling/CMakeLists.txt +++ b/src/profiling/CMakeLists.txt @@ -33,7 +33,7 @@ TARGET_LINK_LIBRARIES(${TARGET_PROFILING_LIB} ) INSTALL(TARGETS ${TARGET_PROFILING_LIB} - DESTINATION lib + DESTINATION ${LIB_INSTALL_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) diff --git a/src/view/webkit/injected-bundle/CMakeLists.txt b/src/view/webkit/injected-bundle/CMakeLists.txt index 6df3a2a..8cffe57 100644 --- a/src/view/webkit/injected-bundle/CMakeLists.txt +++ b/src/view/webkit/injected-bundle/CMakeLists.txt @@ -63,7 +63,7 @@ TARGET_LINK_LIBRARIES( ) # for encryption -TARGET_LINK_LIBRARIES(${TARGET_INJECTED_BUNDLE_LIB} -L/usr/lib/osp -losp-appfw) +TARGET_LINK_LIBRARIES(${TARGET_INJECTED_BUNDLE_LIB} -L${LIB_INSTALL_DIR}/osp -losp-appfw) SET_TARGET_PROPERTIES(${TARGET_INJECTED_BUNDLE_LIB} PROPERTIES VERSION ${PROJECT_VERSION} @@ -76,7 +76,7 @@ SET_TARGET_PROPERTIES(${TARGET_INJECTED_BUNDLE_LIB} PROPERTIES ) INSTALL(TARGETS ${TARGET_INJECTED_BUNDLE_LIB} - DESTINATION lib/ + DESTINATION ${LIB_INSTALL_DIR}/ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) diff --git a/src/wrt-client/wrt-client.cpp b/src/wrt-client/wrt-client.cpp index 16aaf9e..6c2619a 100644 --- a/src/wrt-client/wrt-client.cpp +++ b/src/wrt-client/wrt-client.cpp @@ -49,7 +49,7 @@ const char *EDJE_SHOW_BACKWARD_SIGNAL = "show,backward,signal"; const std::string VIEWMODE_TYPE_FULLSCREEN = "fullscreen"; const std::string VIEWMODE_TYPE_MAXIMIZED = "maximized"; char const* const ELM_SWALLOW_CONTENT = "elm.swallow.content"; -const char* const BUNDLE_PATH = "/usr/lib/libwrt-injected-bundle.so"; +const char* const BUNDLE_PATH = LIBDIR_PREFIX "/libwrt-injected-bundle.so"; const char* const caCertPath = "/opt/usr/share/certs/ca-certificate.crt"; // process pool diff --git a/src/wrt-launchpad-daemon/CMakeLists.txt b/src/wrt-launchpad-daemon/CMakeLists.txt index 9d78b15..13bfc35 100644 --- a/src/wrt-launchpad-daemon/CMakeLists.txt +++ b/src/wrt-launchpad-daemon/CMakeLists.txt @@ -59,7 +59,8 @@ TARGET_LINK_LIBRARIES( ${WRT_LAUNCH_PAD_NAME} ${WRT_LAUNCH_PAD_DEPS_LIBRARIES} ${CMAKE_DL_LIBS} ) - +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/legacy/preload_list_wrt.txt.in + ${CMAKE_CURRENT_SOURCE_DIR}/legacy/preload_list_wrt.txt @ONLY) #install INSTALL(TARGETS ${WRT_LAUNCH_PAD_NAME} DESTINATION bin) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/legacy/preload_list_wrt.txt DESTINATION /usr/share/aul ) diff --git a/src/wrt-launchpad-daemon/legacy/preload_list_wrt.txt b/src/wrt-launchpad-daemon/legacy/preload_list_wrt.txt deleted file mode 100644 index 675f10b..0000000 --- a/src/wrt-launchpad-daemon/legacy/preload_list_wrt.txt +++ /dev/null @@ -1,4 +0,0 @@ -/usr/bin/wrt-client -/usr/lib/libwrt-injected-bundle.so -/usr/lib/wrt-plugins/w3c-widget-interface/libwrt-plugins-w3c-widget-interface.so -/usr/lib/wrt-plugins/tizen-tizen/libwrt-plugins-tizen-tizen.so diff --git a/src/wrt-launchpad-daemon/legacy/preload_list_wrt.txt.in b/src/wrt-launchpad-daemon/legacy/preload_list_wrt.txt.in new file mode 100644 index 0000000..4a4f9c1 --- /dev/null +++ b/src/wrt-launchpad-daemon/legacy/preload_list_wrt.txt.in @@ -0,0 +1,4 @@ +/usr/bin/wrt-client +@LIB_INSTALL_DIR@/libwrt-injected-bundle.so +@LIB_INSTALL_DIR@/wrt-plugins/w3c-widget-interface/libwrt-plugins-w3c-widget-interface.so +@LIB_INSTALL_DIR@/wrt-plugins/tizen-tizen/libwrt-plugins-tizen-tizen.so \ No newline at end of file -- 2.7.4