summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMyungJoo Ham <myungjoo.ham@samsung.com>2016-12-07 16:27:06 +0900
committerMyungJoo Ham <myungjoo.ham@samsung.com>2016-12-07 16:29:16 +0900
commit5d70f7b97f41e339804741bdb6865af096034add (patch)
tree1c44ebbf28a7d25421baea9868ff84530a9467d5
parent7c160e5b1789e656cb15ce8574dd95eab18e89d1 (diff)
downloadxkeyboard-config-5d70f7b97f41e339804741bdb6865af096034add.tar.gz
xkeyboard-config-5d70f7b97f41e339804741bdb6865af096034add.tar.bz2
xkeyboard-config-5d70f7b97f41e339804741bdb6865af096034add.zip
Cut build-dep on xkb-tizen-data
- This is for Tizen 4.0 Configurability and Building Blocks - xkb-tizen-data differs per profile & device. Thus, depending on xkb-tizen-data (BuildRequires) makes this pacakge fragmented. This patch allows xkeyboard-config to configure itself at install-time for each profile. So you can keep the per-profile/device optimization without sacrificing the generality of code & binary. (This requires commits on xkb-tizen-data merged before this) - When you SR this, you need to create a JIRA-TRE issue of : : Add xkb-tizen-data-profile_mobile for mobile profile : Add xkb-tizen-data-profile_wearable for wearable profile : Add xkb-tizen-data-profile_tv for tv profile : Add xkb-tizen-data-profile_ivi for ivi profile : Add xkb-tizen-data-profile_common for common profile Change-Id: Iaab9e9c0ab1942fa6526ffedd938d190fdc156c4 Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
-rw-r--r--packaging/xkeyboard-config.spec73
1 files changed, 56 insertions, 17 deletions
diff --git a/packaging/xkeyboard-config.spec b/packaging/xkeyboard-config.spec
index f0fd8d7d..ce8ddaa1 100644
--- a/packaging/xkeyboard-config.spec
+++ b/packaging/xkeyboard-config.spec
@@ -21,10 +21,22 @@ BuildRequires: pkgconfig(xorg-macros) >= 1.12
Provides: XFree86:/etc/X11/xkb/symbols/us
Provides: xorg-x11:/etc/X11/xkb/symbols/us
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildArch: noarch
Requires(pre): /usr/bin/ln
Requires(pre): /usr/bin/rm
-BuildRequires: xkb-tizen-data
+# This is for backword compatibility only. Tizen 4.0 Configurability gets no damage from this.
+%if "%{?profile}" == "mobile"
+Requires: xkb-tizen-data-profile_mobile
+%elif "%{?profile}" == "wearable"
+Requires: xkb-tizen-data-profile_wearable
+%elif "%{?profile}" == "tv"
+Requires: xkb-tizen-data-profile_tv
+%elif "%{?profile}" == "ivi"
+Requires: xkb-tizen-data-profile_ivi
+%else
+# If it is common or "unified/undefined"
+Requires: xkb-tizen-data
+Recommends: xkb-tizen-data-profile_common
+%endif
BuildRequires: pkgconfig(xkbcommon)
%{!?TZ_SYS_RO_SHARE: %global TZ_SYS_RO_SHARE /usr/share}
@@ -51,8 +63,6 @@ export TIZEN_WINDOW_SYSTEM="wayland"
export TZ_SYS_RO_SHARE="%{TZ_SYS_RO_SHARE}"
export KEYMAP_FILE_PATH="%{KEYMAP_FILE_PATH}"
-./make_keycodes.sh
-./make_symbols.sh
%build
%autogen --with-xkb-rules-symlink=xfree86,xorg \
@@ -80,29 +90,58 @@ ln -sf tizen %{buildroot}/%{TZ_SYS_RO_SHARE}/X11/xkb/rules/evdev
export LOCAL_KEYMAP_PATH=%{buildroot}/%{TZ_SYS_RO_SHARE}/X11/xkb
export RULE_FILE_PATH=%{TZ_SYS_RO_SHARE}/X11/xkb/xkb.rule
export KEYMAP_FILE_PATH="%{KEYMAP_FILE_PATH}"
-./remove_unused_files.sh
-%ifarch aarch64 x86_64
-%else
-if [ -e %{buildroot}%{_bindir}/cache ]; then
- %{buildroot}%{_bindir}/cache
- rm -f %{buildroot}%{_bindir}/cache
-fi
-%endif
-mkdir -p %{buildroot}/%{TZ_SYS_VAR}/lib/xkb/
-touch %{buildroot}/%{TZ_SYS_VAR}/lib/xkb/dummy.xkb
-cp *.xkb %{buildroot}/%{TZ_SYS_VAR}/lib/xkb/
+install -m 0700 make_symbols.sh %{buildroot}%{_bindir}/
+install -m 0700 make_keycodes.sh %{buildroot}%{_bindir}/
+install -m 0700 remove_unused_files.sh %{buildroot}%{_bindir}/
+install -m 0700 remove_symbols.sh %{buildroot}%{_bindir}/
#for license notification
mkdir -p %{buildroot}/%{TZ_SYS_RO_SHARE}/license
cp -a %{_builddir}/%{buildsubdir}/COPYING %{buildroot}/%{TZ_SYS_RO_SHARE}/license/%{name}
+
+# DO the optimization at RPM install, not at build
+%post
+mkdir -p /tmp/xkeyboard-config-install
+%if %{with x}
+export TIZEN_WINDOW_SYSTEM="x11"
+%else
+export TIZEN_WINDOW_SYSTEM="wayland"
+%endif
+export TZ_SYS_RO_SHARE="%{TZ_SYS_RO_SHARE}"
+export LOCAL_KEYMAP_PATH=%{TZ_SYS_RO_SHARE}/X11/xkb
+export RULE_FILE_PATH=%{TZ_SYS_RO_SHARE}/X11/xkb/xkb.rule
+export KEYMAP_FILE_PATH=%{KEYMAP_FILE_PATH}
+pushd %{TZ_SYS_RO_SHARE}/X11/xkb
+%{_bindir}/make_keycodes.sh
+%{_bindir}/make_symbols.sh
+rm -f %{_bindir}/make_keycodes.sh
+rm -f %{_bindir}/make_symbols.sh
+popd
+pushd /tmp/xkeyboard-config-install
+ln -sf %{_bindir}/remove_symbols.sh remove_symbols.sh
+%{_bindir}/remove_unused_files.sh
+rm -f %{_bindir}/remove_unused_files.sh
+rm -f %{_bindir}/remove_symbols.sh
+rm remove_symbols.sh
+%{_bindir}/cache
+rm -f %{_bindir}/cache
+mkdir -p /%{TZ_SYS_VAR}/lib/xkb/
+touch /%{TZ_SYS_VAR}/lib/xkb/dummy.xkb
+cp *.xkb /%{TZ_SYS_VAR}/lib/xkb/
+popd
+
%files -f %{name}.lang
%manifest %{name}.manifest
%defattr(-,root,root)
%doc AUTHORS README docs/HOWTO.* docs/README.*
%dir %{_localstatedir}/lib/xkb/compiled
%{TZ_SYS_RO_SHARE}/license/%{name}
-%{_datadir}/X11/xkb/
%{_datadir}/pkgconfig/*.pc
-%{TZ_SYS_VAR}/lib/xkb/*.xkb
+%{_datadir}/X11/xkb/
+%{_bindir}/cache
+%{_bindir}/make_keycodes.sh
+%{_bindir}/make_symbols.sh
+%{_bindir}/remove_unused_files.sh
+%{_bindir}/remove_symbols.sh