summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@open.eurogiciel.org>2015-02-10 15:17:29 +0100
committerJosé Bollo <jose.bollo@open.eurogiciel.org>2015-02-10 17:04:34 +0100
commitc4bcbadb936730fed1587b0e1d54902a7e4dfa8d (patch)
treeaf71bccf901cb03354b8100e43e1f325c71a8b2e
parent99df9ce7204029c955d41e139411494a3095b952 (diff)
downloadqt-tizen-tizen_3.0.m1_mobile.tar.gz
qt-tizen-tizen_3.0.m1_mobile.tar.bz2
qt-tizen-tizen_3.0.m1_mobile.zip
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.spec17
-rw-r--r--preinstall-qt-demos.service11
-rwxr-xr-xpreinstall-qt-demos.sh28
-rw-r--r--qt-tizen.manifest6
-rwxr-xr-xrootfs/usr/bin/launch_video_qt.sh2
-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)bin4745 -> 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)bin2822 -> 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
index 0f50443..0f50443 100644
--- a/rootfs/opt/share/widget_demo/maroon.png
+++ b/rootfs/usr/share/qt-tizen-demo/maroon.png
Binary files differ
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
index 8a79156..8a79156 100644
--- a/rootfs/opt/share/widget_demo/samegame.png
+++ b/rootfs/usr/share/qt-tizen-demo/samegame.png
Binary files differ
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