$(CPP) $(OBJS) -o $(TARGET) $(LDFLAGS)
-install: BINDIR = $(DESTDIR)/usr/bin
+install: BDIR = $(DESTDIR)/$(BINDIR)
install: $(TARGET) $(SCRIPTS)
- mkdir -p $(BINDIR)
- install $(TARGET) -t $(BINDIR)
- install -m 755 $(SCRIPTS) -t $(BINDIR)
+ mkdir -p $(BDIR)
+ install $(TARGET) -t $(BDIR)
+ install -m 755 $(SCRIPTS) -t $(BDIR)
clean:
rm -f $(TARGET) $(OBJS)
%setup -q -n %{name}_%{version}
%build
-%if %{WSI_SUPPORT}
-export WAYLAND_SUPPORT=y
-%endif
-
pushd scripts
echo "__tizen_profile_name__="%{?profile} > dyn_vars
echo "__tizen_product__="%{?TIZEN_PRODUCT} >> dyn_vars
echo "__tizen_product_wearable__="%{sec_product_feature_profile_wearable} >> dyn_vars
echo "__tizen_product_lite__="%{sec_product_feature_profile_lite} >> dyn_vars
popd
-cd daemon
+
+# set environment
+%if %{WSI_SUPPORT}
+ export WAYLAND_SUPPORT=y
+%endif
%if %{NSP_SUPPORT}
export NSP_SUPPORT=y
export WSI_SUPPORT=y
%endif
+export INCLUDEDIR=%{_includedir}
+export LIBDIR=%{_libdir}
+export LIB=%{_lib}
+export LINKER_PATH=$(readlink -f $(parse_elf -f %{_bindir}/parse_elf -i))
+
+# build manager
+cd daemon
make
+# build ui_viewer
cd ../ui_viewer
-$SWAP_BUILD_CONF make
+make
%install
rm -rf ${RPM_BUILD_ROOT}
mkdir -p %{buildroot}/usr/share/license
cp LICENSE %{buildroot}/usr/share/license/%{name}
+
+# set environment
+export BINDIR=%{_bindir}
+export LIBDIR=%{_libdir}
+
+# install manager
cd daemon
%make_install
+# install ui_viwer
cd ../ui_viewer
%make_install
/usr/share/license/%{name}
%manifest swap-manager.manifest
%defattr(-,root,root,-)
-%{_prefix}/bin/da_manager
-/usr/bin/swap_start.sh
-/usr/bin/swap_stop.sh
-/usr/bin/swap_init_loader.sh
-/usr/bin/swap_init_preload.sh
-/usr/bin/swap_init_uihv.sh
-/usr/bin/swap_init_wsp.sh
-/usr/bin/swap_init_gtp.sh
+%{_bindir}/da_manager
+%{_bindir}/swap_start.sh
+%{_bindir}/swap_stop.sh
+%{_bindir}/swap_init_loader.sh
+%{_bindir}/swap_init_preload.sh
+%{_bindir}/swap_init_uihv.sh
+%{_bindir}/swap_init_wsp.sh
+%{_bindir}/swap_init_gtp.sh
%{_libdir}/da_ui_viewer.so
#!/bin/bash
-linker_path="/lib/"
-test_bin="/bin/su"
-handlers_lib="/usr/lib/da_probe_tizen.so"
+
+handlers_lib="$LIBDIR/da_probe_tizen.so"
fixup_handler="__dl_fixup_wrapper"
reloc_handler="__dl_reloc_wrapper"
-linker_info_header="/usr/local/include/linker_info.h"
+linker_info_header="$INCLUDEDIR/linker_info.h"
libpthread_pkg_name="glibc"
libpthread_init_func="__pthread_initialize_minimal"
function print_linker()
{
filename=$1
-
- if [ ! -f $test_bin ]; then
- echo "[ERROR] No ${test_bin} to get linker path"
- exit 1
- fi
-
- el=$(readelf -p .interp $test_bin | grep "/lib/" | awk '{print $3}')
- linker=$(readlink -f $el)
+ linker=$LINKER_PATH
echo -e "/bin/echo \"$linker\" > /sys/kernel/debug/swap/got_patcher/linker/path" >> $filename
}
{
filename=$1
- libpthread_path=$(rpm -ql $libpthread_pkg_name | grep "/lib/libpthread" | head -1)
+ libpthread_path=$(rpm -ql $libpthread_pkg_name | grep "/${LIB}/libpthread" | head -1)
addr=$(readelf -sW $libpthread_path | grep $libpthread_init_func | awk '{print "0x" $2}')
echo -e "/bin/echo \"$libpthread_path\" > /sys/kernel/debug/swap/got_patcher/pthread/path" >> $filename
#!/bin/bash
-loader_library_pattern="libdl[.-].*"
-loader_library_path="/lib/"
+
loader_open_function="dlopen"
-linker_path="/lib/"
linker_sym="_r_debug"
-test_bin="/bin/su"
output=$1
function print_loader()
{
filename=$1
- el=$(find $loader_library_path -regextype posix-extended -regex $loader_library_path$loader_library_pattern | head -n1)
+ el=$(rpm -ql glibc | grep "libdl[.-].*" | head -1)
loader_lib=$(readlink -f $el)
addr=$(parse_elf -f $loader_lib --addr_format=swap --syms | grep "$loader_open_function\(@\|$\)" | head -1 | cut -f1 -d' ')
function print_linker()
{
filename=$1
-
- if [ ! -f $test_bin ]; then
- echo "[ERROR] No ${test_bin} to get linker path"
- exit 1
- fi
-
- el=$(readelf -p .interp $test_bin | grep "/lib/" | awk '{print $3}')
- linker=$(readlink -f $el)
+ linker=$LINKER_PATH
r_debug_offset=$(readelf -sW $linker | grep $linker_sym | awk '{print $2}' | uniq)
echo -e "/bin/echo \"$linker\" > /sys/kernel/debug/swap/loader/linker/linker_path" >> $filename
#!/bin/bash
-handlers_lib="/usr/lib/da_probe_tizen.so"
+handlers_lib="$LIBDIR/da_probe_tizen.so"
loader_library_pattern="libdl[.-].*"
linker_library_pattern="ld-.*"
libc_pkg_name="glibc"
libpthread_pkg_name="glibc"
-libsmack_pkg_name="smack"
+libsmack_pkg_name="libsmack"
output=$1
{
filename=$1
- libc_path=$(rpm -ql $libc_pkg_name | grep "/lib/libc" | head -1)
- echo -e "/bin/echo \"$libc_path\" > /sys/kernel/debug/swap/preload/ignored_binaries/bins_add" >> $filename
+ echo -e "/bin/echo /$LIB/libc.so.6 > /sys/kernel/debug/swap/preload/ignored_binaries/bins_add" >> $filename
}
function print_libpthread()
{
filename=$1
- libpthread_path=$(rpm -ql $libpthread_pkg_name | grep "/lib/libpthread" | head -1)
+ libpthread_path=$(rpm -ql $libpthread_pkg_name | grep "libpthread" | head -1)
echo -e "/bin/echo \"$libpthread_path\" > /sys/kernel/debug/swap/preload/ignored_binaries/bins_add" >> $filename
}
{
filename=$1
- libsmack_path=$(rpm -ql $libsmack_pkg_name | grep "/lib/libsmack" | head -1)
+ libsmack_path=$(rpm -ql $libsmack_pkg_name | grep "libsmack" | head -1)
echo -e "/bin/echo \"$libsmack_path\" > /sys/kernel/debug/swap/preload/ignored_binaries/bins_add" >> $filename
}
#!/bin/bash
-ui_viewer_lib="/usr/lib/da_ui_viewer.so"
+ui_viewer_lib="$LIBDIR/da_ui_viewer.so"
output=$1
webkit_package_name=chromium-efl
if [ "$__tizen_product_tv__" == "1" ]; then
- lib_file=$(rpm -ql ${webkit_package_name} | grep "/usr/lib/libchromium-ewk.so" | head -1)
+ lib_file=$(rpm -ql ${webkit_package_name} | grep "$LIBDIR/libchromium-ewk.so" | head -1)
else
- lib_file=$(rpm -ql ${webkit_package_name}-debuginfo | grep "/usr/lib/debug/usr/lib/libchromium-ewk.so.debug" | head -1)
+ lib_file=$(rpm -ql ${webkit_package_name}-debuginfo | grep "/usr/lib/debug$LIBDIR/libchromium-ewk.so.debug" | head -1)
fi
-I/usr/include/ethumb-1 \
-I/usr/include/e_dbus-1 \
-I/usr/include/dbus-1.0 \
- -I/usr/lib/dbus-1.0/include \
-I/usr/include/wayland-extension
WARN_CFLAGS = -g \
$(CC) $(OBJS) -o $(TARGET) $(LDFLAGS)
-install: BINDIR = $(DESTDIR)/usr/lib
+install: BDIR = $(DESTDIR)/$(LIBDIR)
install: $(TARGET)
- mkdir -p $(BINDIR)
- install $(TARGET) -t $(BINDIR)
+ mkdir -p $(BDIR)
+ install $(TARGET) -t $(BDIR)
clean:
rm -f $(TARGET) $(OBJS)