Apply directory macros and install license file to the proper directory
authorSung-Jin Park <sj76.park@samsung.com>
Fri, 11 Mar 2016 07:25:34 +0000 (16:25 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 21 Dec 2023 23:40:34 +0000 (08:40 +0900)
Change-Id: Icf6d15c1ad958177ee19e479e3368465261cee44

make_tizen_keymap.sh
packaging/libxkbcommon.spec
test/data/sync.sh

index a61d148..1acb2fe 100755 (executable)
@@ -1,6 +1,10 @@
 #!/bin/sh
 
 #!/bin/sh
 
-KEYMAP_FILE_PATH="/usr/share/X11/xkb/tizen_key_layout.txt"
+if [ "$TZ_SYS_RO_SHARE" = "" ]; then
+       TZ_SYS_RO_SHARE="/usr/share"
+fi
+
+KEYMAP_FILE_PATH="${TZ_SYS_RO_SHARE}/X11/xkb/tizen_key_layout.txt"
 BASE_KEYSYM="0x10090000"
 TARGET_HEADER_FILE="./xkbcommon/tizen_keymap.h"
 TEMP_TEXT_FILE="./temp_file.txt"
 BASE_KEYSYM="0x10090000"
 TARGET_HEADER_FILE="./xkbcommon/tizen_keymap.h"
 TEMP_TEXT_FILE="./temp_file.txt"
index 136f9cc..c8878b8 100644 (file)
@@ -21,6 +21,8 @@ BuildRequires:  python
 BuildRequires:  xkb-tizen-data
 %endif
 
 BuildRequires:  xkb-tizen-data
 %endif
 
+%global TZ_SYS_RO_SHARE  %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:/usr/share}
+
 %description
 Keyboard handling library using XKB data.
 
 %description
 Keyboard handling library using XKB data.
 
@@ -43,6 +45,7 @@ cp %{SOURCE1001} .
 %if "%{?profile}" == "common"
 %else
 export TIZEN_PROFILE="%{?profile}"
 %if "%{?profile}" == "common"
 %else
 export TIZEN_PROFILE="%{?profile}"
+export TZ_SYS_RO_SHARE="%{TZ_SYS_RO_SHARE}"
 chmod a+x ./make_tizen_keymap.sh
 ./make_tizen_keymap.sh
 chmod a+x ./gen_tables.sh
 chmod a+x ./make_tizen_keymap.sh
 ./make_tizen_keymap.sh
 chmod a+x ./gen_tables.sh
@@ -56,6 +59,10 @@ chmod a+x ./gen_tables.sh
 %install
 %make_install
 
 %install
 %make_install
 
+#for license notification
+mkdir -p %{buildroot}/%{TZ_SYS_RO_SHARE}/license
+cp -a %{_builddir}/%{buildsubdir}/COPYING %{buildroot}/%{TZ_SYS_RO_SHARE}/license/%{name}
+
 %post  -p /sbin/ldconfig
 
 %postun  -p /sbin/ldconfig
 %post  -p /sbin/ldconfig
 
 %postun  -p /sbin/ldconfig
@@ -63,7 +70,7 @@ chmod a+x ./gen_tables.sh
 %files
 %manifest %{name}.manifest
 %defattr(-,root,root)
 %files
 %manifest %{name}.manifest
 %defattr(-,root,root)
-%license COPYING
+%{TZ_SYS_RO_SHARE}/license/%{name}
 %{_libdir}/libxkbcommon.so.0*
 
 %files devel
 %{_libdir}/libxkbcommon.so.0*
 
 %files devel
index 2cbcc0a..d5d6b3f 100755 (executable)
@@ -1,8 +1,12 @@
 #/bin/sh
 set -euo pipefail
 
 #/bin/sh
 set -euo pipefail
 
-XKBCONFIGROOT='/usr/share/X11/xkb'
-XLOCALEDIR='/usr/share/X11/locale'
+if [ "$TZ_SYS_RO_SHARE" = "" ]; then
+        TZ_SYS_RO_SHARE="/usr/share"
+fi
+
+XKBCONFIGROOT="${TZ_SYS_RO_SHARE}/X11/xkb"
+XLOCALEDIR="${TZ_SYS_RO_SHARE}/X11/locale"
 
 if [ ! -d test/data ]; then
     echo "Run this from the top source dir"
 
 if [ ! -d test/data ]; then
     echo "Run this from the top source dir"