diff options
author | José Bollo <jose.bollo@open.eurogiciel.org> | 2015-02-10 15:17:29 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@open.eurogiciel.org> | 2015-02-10 17:04:34 +0100 |
commit | c4bcbadb936730fed1587b0e1d54902a7e4dfa8d (patch) | |
tree | af71bccf901cb03354b8100e43e1f325c71a8b2e | |
parent | 99df9ce7204029c955d41e139411494a3095b952 (diff) | |
download | qt-tizen-tizen_3.0.2014.q4_common.tar.gz qt-tizen-tizen_3.0.2014.q4_common.tar.bz2 qt-tizen-tizen_3.0.2014.q4_common.zip |
Refactoring installation of demostizen_4.0.m1_releasetizen_3.0.m2.a1_tv_releasetizen_3.0.m2.a1_mobile_releasetizen_3.0.m1_tv_releasetizen_3.0.m1_mobile_releasesubmit/tizen_wearable/20150227.000000submit/tizen_unified/20170308.100416submit/tizen_tv/20150323.000000submit/tizen_tv/20150320.000000submit/tizen_mobile/20150223.000001submit/tizen_ivi/20160217.000007submit/tizen_ivi/20160217.000000submit/tizen_common/20150212.165537submit/tizen_3.0_ivi/20161010.000006submit/tizen_3.0_common/20161104.104000submit/tizen_3.0.m2/20170104.093754submit/tizen_3.0.2014.q4_common/20150212.170321accepted/tizen/wearable/20150227.064232accepted/tizen/unified/20170309.040456accepted/tizen/tv/20150324.014636accepted/tizen/mobile/20150224.002815accepted/tizen/ivi/20160218.025806accepted/tizen/common/20150212.170502accepted/tizen/3.0/ivi/20161011.062411accepted/tizen/3.0/common/20161114.111634accepted/tizen/3.0.2014.q4/common/20150212.170603tizen_3.0.m2tizen_3.0.m1_tvtizen_3.0.m1_mobiletizen_3.0.2015.q2_commontizen_3.0.2015.q1_commontizen_3.0.2014.q4_commontizen_3.0tizenaccepted/tizen_wearableaccepted/tizen_unifiedaccepted/tizen_tvaccepted/tizen_mobileaccepted/tizen_iviaccepted/tizen_commonaccepted/tizen_3.0_iviaccepted/tizen_3.0_commonaccepted/tizen_3.0.2014.q4_common
The demos were installed by creating files in user directories.
This is now changed to install files in the directory /opt/share/qt-demos.
Then during user startup, a service is run by systemd (preinstall-qt-demos)
that checks wether demos are installed or not. It installs the demo if
needed.
This patch improves a little the packaging of the demos but work remains to
be done: removing hard coded path to /opt/share and replace it with
build variables; improve the configuration of the settings.
Change-Id: Ice5d11e8d50aaccaa94995b2680cdfc273d27664
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
-rw-r--r-- | packaging/qt-tizen.spec | 17 | ||||
-rw-r--r-- | preinstall-qt-demos.service | 11 | ||||
-rwxr-xr-x | preinstall-qt-demos.sh | 28 | ||||
-rw-r--r-- | qt-tizen.manifest | 6 | ||||
-rwxr-xr-x | rootfs/usr/bin/launch_video_qt.sh | 2 | ||||
-rw-r--r-- | rootfs/usr/share/qt-tizen-demo/maroon.desktop (renamed from rootfs/home/bob/.applications/desktop/maroon.desktop) | 2 | ||||
-rw-r--r-- | rootfs/usr/share/qt-tizen-demo/maroon.png (renamed from rootfs/opt/share/widget_demo/maroon.png) | bin | 4745 -> 4745 bytes | |||
-rw-r--r-- | rootfs/usr/share/qt-tizen-demo/samegame.desktop (renamed from rootfs/home/carol/.applications/desktop/samegame.desktop) | 2 | ||||
-rw-r--r-- | rootfs/usr/share/qt-tizen-demo/samegame.png (renamed from rootfs/opt/share/widget_demo/samegame.png) | bin | 2822 -> 2822 bytes | |||
-rw-r--r-- | rootfs/usr/share/qt-tizen-demo/video.qml (renamed from rootfs/home/guest/video.qml) | 0 |
10 files changed, 61 insertions, 7 deletions
diff --git a/packaging/qt-tizen.spec b/packaging/qt-tizen.spec index f03a118..7b92d5b 100644 --- a/packaging/qt-tizen.spec +++ b/packaging/qt-tizen.spec @@ -76,6 +76,9 @@ Add some links to launcher %install %make_install +mkdir -p %{buildroot}/%{_bindir} %{buildroot}/%{_unitdir_user} +install preinstall-qt-demos.sh %{buildroot}/%{_bindir} +install preinstall-qt-demos.service %{buildroot}/%{_unitdir_user} #%fdupes %{buildroot} @@ -83,14 +86,20 @@ Add some links to launcher %postun -p /sbin/ldconfig +%post demo +mkdir -p %{_unitdir_user}/default.target.wants/ +ln -sf ../preinstall-qt-demos.service %{_unitdir_user}/default.target.wants/ + %files %files full %files demo +%manifest %{name}.manifest %defattr(-,root,root) -/home/*/.applications/desktop/* -/home/*/*.qml -/opt/share/widget_demo/* -%{_bindir}/*.sh +%attr(755,root,root) %{_bindir}/preinstall-qt-demos.sh +%attr(644,root,root) %{_unitdir_user}/preinstall-qt-demos.service +%attr(644,root,root) /usr/share/qt-tizen-demo/* +%attr(755,root,root) %{_bindir}/launch_video_qt.sh + diff --git a/preinstall-qt-demos.service b/preinstall-qt-demos.service new file mode 100644 index 0000000..e6157bc --- /dev/null +++ b/preinstall-qt-demos.service @@ -0,0 +1,11 @@ +[Unit] +Description=Installation of pre-installed qt-demos +ConditionPathExists=!%h/.applications/.qt-demos-installed + +[Service] +Type=idle +ExecStart=/usr/bin/preinstall-qt-demos.sh + +[Install] +WantedBy=default.target + diff --git a/preinstall-qt-demos.sh b/preinstall-qt-demos.sh new file mode 100755 index 0000000..c524809 --- /dev/null +++ b/preinstall-qt-demos.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +test -e ~/.applications/.qt-demos-installed && exit + +. /etc/tizen-platform.conf + +mkdir -p ~/.applications/desktop 2> /dev/null + +changed=false + +cat << EOC | +carol samegame +bob maroon +EOC +awk -v "user=${USER}" '$1==user{print $2}' | +while read demo +do + if test -f "${TZ_SYS_SHARE}/qt-tizen-demo/${demo}.desktop" + then + cp "${TZ_SYS_SHARE}/qt-tizen-demo/${demo}.desktop" ~/.applications/desktop + changed=true + fi +done + +$changed && pkill -U "${UID}" -USR1 tz-launcher +touch ~/.applications/.qt-demos-installed + + diff --git a/qt-tizen.manifest b/qt-tizen.manifest new file mode 100644 index 0000000..9b5140d --- /dev/null +++ b/qt-tizen.manifest @@ -0,0 +1,6 @@ +<manifest> + <request> + <domain name="_"/> + </request> +</manifest> + diff --git a/rootfs/usr/bin/launch_video_qt.sh b/rootfs/usr/bin/launch_video_qt.sh index 2af1472..0488d60 100755 --- a/rootfs/usr/bin/launch_video_qt.sh +++ b/rootfs/usr/bin/launch_video_qt.sh @@ -1,2 +1,2 @@ #!/bin/sh -qmlscene /home/guest/video.qml +qmlscene /usr/share/qt-tizen-demo/video.qml diff --git a/rootfs/home/bob/.applications/desktop/maroon.desktop b/rootfs/usr/share/qt-tizen-demo/maroon.desktop index 6b70256..495e7e9 100644 --- a/rootfs/home/bob/.applications/desktop/maroon.desktop +++ b/rootfs/usr/share/qt-tizen-demo/maroon.desktop @@ -2,5 +2,5 @@ Name=Maroon Type=Application Exec=qmlscene /usr/share/qt5/qt5-qtdeclarative/examples/quick/demos/maroon/maroon.qml -Icon=/opt/share/widget_demo/maroon.png +Icon=/usr/share/qt-tizen-demo/maroon.png diff --git a/rootfs/opt/share/widget_demo/maroon.png b/rootfs/usr/share/qt-tizen-demo/maroon.png Binary files differindex 0f50443..0f50443 100644 --- a/rootfs/opt/share/widget_demo/maroon.png +++ b/rootfs/usr/share/qt-tizen-demo/maroon.png diff --git a/rootfs/home/carol/.applications/desktop/samegame.desktop b/rootfs/usr/share/qt-tizen-demo/samegame.desktop index 71b4f4d..7f2007b 100644 --- a/rootfs/home/carol/.applications/desktop/samegame.desktop +++ b/rootfs/usr/share/qt-tizen-demo/samegame.desktop @@ -2,5 +2,5 @@ Name=Samegame Type=Application Exec=qmlscene /usr/share/qt5/qt5-qtdeclarative/examples/quick/demos/samegame/samegame.qml -Icon=/opt/share/widget_demo/samegame.png +Icon=/usr/share/qt-tizen-demo/samegame.png diff --git a/rootfs/opt/share/widget_demo/samegame.png b/rootfs/usr/share/qt-tizen-demo/samegame.png Binary files differindex 8a79156..8a79156 100644 --- a/rootfs/opt/share/widget_demo/samegame.png +++ b/rootfs/usr/share/qt-tizen-demo/samegame.png diff --git a/rootfs/home/guest/video.qml b/rootfs/usr/share/qt-tizen-demo/video.qml index 6612b66..6612b66 100644 --- a/rootfs/home/guest/video.qml +++ b/rootfs/usr/share/qt-tizen-demo/video.qml |