daemon: Apply rpath and install dir
authorSangchul Lee <sc11.lee@samsung.com>
Fri, 16 Jun 2023 03:51:42 +0000 (12:51 +0900)
committer이상철/Tizen Platform Lab(SR)/삼성전자 <sc11.lee@samsung.com>
Mon, 19 Jun 2023 06:33:01 +0000 (15:33 +0900)
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
meson.build
meson_options.txt
packaging/espp-service.spec
project_def.prop
src/daemon/meson.build

index 2bef440e7ee141299a78a90d4e055527d6d3a60e..fc5ada62e2cae43af062f34bfbe6a20705242e01 100644 (file)
@@ -19,6 +19,9 @@ configinc = include_directories('.')
 
 common_deps = []
 
+libdir_path = '$ORIGIN/../lib'
+message('libdir_path[' + libdir_path + ']')
+
 message('================ common options ================')
 
 conf_data.set('ESPP_SERVICE_VERSION', espp_service_version)
index 33d3025a427c66a97205e5c94321959812099d96..6fc371f363356c49e96c1e128bee81d8fefd8980 100644 (file)
@@ -1,3 +1,7 @@
+#common
 option('sock-path', type: 'string', value: '/tmp/espp_service.sock', description: 'ESPP service socket path')
 option('dlog', type: 'boolean', value: true, description: 'Use dlog')
-option('service-app', type: 'boolean', value: true, description: 'Daemon is launched as Tizen service app')
+
+#daemon
+option('_bindir', type: 'string', value: '/usr/bin', yield: true, description: 'ESPP service daemon install dir')
+option('service-app', type: 'boolean', value: true, yield: true, description: 'ESPP service daemon is launched as Tizen service app')
index 3813ecf9243c0f41e3ba66cc20e4a49618442380..a1780977b206998280a8ef7cac23ac43a54cc73e 100644 (file)
@@ -43,6 +43,8 @@ ESPP service client development header and library
 %setup -q -n %{name}-%{version}
 cp %{SOURCE1} %{SOURCE2} .
 
+%define _bin_dir %{_bindir}
+
 %build
 meson setup --auto-features=disabled \
   --prefix=/usr \
@@ -54,6 +56,7 @@ meson setup --auto-features=disabled \
 %else
   -Dservice-app=false \
 %endif
+  -D_bindir=%{_bin_dir} \
   build
 
 ninja -C build
@@ -72,7 +75,7 @@ install -m0644 %{SOURCE2} %{buildroot}%{_unitdir}/
 %files
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
-%{_bindir}/espp-service
+%{_bin_dir}/espp-service
 %{_unitdir}/espp-service.service
 %license LICENSE.APLv2
 
index 6b1583860de838a06ce090a57e8052c1fc056392..a44aa470b02be585897b0b84d2a9a8181648ab13 100644 (file)
@@ -20,7 +20,7 @@ USER_INC_DIRS = ./src/daemon ./src/common ./inc ./inc/esplusplayer_capi
 USER_LIBS = esplusplayer
 
 # Linker Flags
-USER_LFLAGS = -Xlinker --allow-shlib-undefined -Xlinker -rpath='/usr/lib'
+USER_LFLAGS = -Xlinker --allow-shlib-undefined -Xlinker -rpath='$$ORIGIN/../lib'
 
 # User Library Path
 USER_LIB_DIRS = ./libs
index 5ae78362d3dc747cd77f0c5f7081205d8a659570..5d8564e632ea5f5a0ab36faa918b3dd155e5e760 100644 (file)
@@ -9,7 +9,7 @@ espp_service_sources = [
 daemon_deps = common_deps
 
 message('================ daemon options ================')
-
+message('bindir: '+ get_option('_bindir'))
 if get_option('service-app')
   message('service-app option is enabled, set USE_SERVICE_APP')
   conf_data.set('USE_SERVICE_APP', true)
@@ -28,6 +28,8 @@ executable('espp-service',
   include_directories : [configinc],
   dependencies : daemon_deps,
   install: true,
+  install_dir: get_option('_bindir'),
+  install_rpath: libdir_path,
   pie : true,
 )