Fix the issue which the service can't be loaded at first time. 83/188583/5
authorXie Ligang <ligang0.xie@samsung.com>
Thu, 6 Sep 2018 08:54:57 +0000 (16:54 +0800)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 7 Sep 2018 04:14:33 +0000 (04:14 +0000)
Change-Id: I74adad76c103cbc368638e88c3ae1ae32fa69f01
Signed-off-by: Xie Ligang <ligang0.xie@samsung.com>
packaging/nlp.spec
service/CMakeLists.txt
service/org.tizen.nlp.service.xml

index c27f57e..4e1c3ea 100755 (executable)
@@ -59,14 +59,15 @@ rm -rf %{buildroot}
 #%post
 #/sbin/ldconfig
 
-%post -n org.tizen.nlp.service
-/usr/bin/signing-client/hash-signer-client.sh -a -d -p platform org.tizen.nlp.service
+%post
 
 %postun -p /sbin/ldconfig
+tpk-backend -d %{name} --preload --force-remove
 
 %files
 %manifest service/org.tizen.nlp.service.manifest
 %defattr(-,root,root,-)
+%attr(755,root,root) %{_app_bin_dir}/org.tizen.nlp.service
 %{_app_bin_dir}/*
 %{TZ_SYS_RO_PACKAGES}/org.tizen.nlp.service.xml
 %{_libdir}/python2.7/site-packages/langdetect/*
index 63ce547..013e471 100755 (executable)
@@ -4,9 +4,6 @@ PROJECT(${fw_name} C)
 
 INCLUDE(FindPkgConfig)
 
-EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_VERSION)
-message("Building by ${CMAKE_SYSTEM_VERSION} machine")
-
 SET(SERVICE_SRC
     src/service.c
     src/message.c
@@ -34,16 +31,13 @@ pkg_check_modules(pkgs REQUIRED
         rpc-port
     )
 FOREACH(flag ${pkgs_CFLAGS})
-    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -fpie")
 ENDFOREACH(flag)
 
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Wl,--unresolved-symbols=ignore-in-shared-libs -Wl,-zdefs")
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-SET(CMAKE_C_FLAGS_RELEASE "-O2")
 
 ADD_EXECUTABLE(${fw_name} ${SERVICE_SRC})
-TARGET_LINK_LIBRARIES(${fw_name} ${pkgs_LDFLAGS} -lm)
+TARGET_LINK_LIBRARIES(${fw_name} ${pkgs_LDFLAGS} "-pie")
 
 INSTALL(TARGETS ${fw_name} DESTINATION /usr/apps/org.tizen.nlp.service/bin/)
 INSTALL(FILES org.tizen.nlp.service.xml DESTINATION /usr/share/packages)
index 3b046c7..b852bba 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="4.0" package="org.tizen.nlp.service" version="1.0.0">
+<manifest xmlns="http://tizen.org/ns/packages" api-version="5.0" package="org.tizen.nlp.service" version="1.0.0" install-location="internal-only" preload = "true">
     <profile name="mobile"/>
-    <service-application appid="org.tizen.nlp.service" auto-restart="true" exec="/usr/apps/org.tizen.nlp.service/bin/org.tizen.nlp.service" multiple="false" nodisplay="true" on-boot="true" type="capp">
+    <service-application appid="org.tizen.nlp.service" auto-restart="true" exec="org.tizen.nlp.service" multiple="false" nodisplay="true" on-boot="true" type="capp">
         <label>service</label>
         <icon>service.png</icon>
     </service-application>