summaryrefslogtreecommitdiff
path: root/proto-meta-Tizen_generic/specfile-initial/Modello_Installer/packaging/Modello-Installer.spec
blob: 3eed87bcd2ccf42cd6c9db0051c82aa5553f9551 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
%define MODELLO_INSTALL_USER app
%define MODELLO_COMMON_DIR   %{_datadir}/Modello/Common

Name:       Modello-Installer
Summary:    Installer for Modello
Version:    0.0.2
Release:    0
Group:      Automotive/Modello
License:    Apache-2.0
URL:        http://www.tizen.org
Source0:    %{name}-%{version}.tar.bz2
Source1001: Modello-Installer.manifest

%description
Installer for Modello package

%package xwalk
Summary: The Xwalk version of Modello Installer
Requires:   crosswalk
Requires:   Modello-AMBSimulator
Requires:   Modello-Appmanager
Requires:   Modello-Common
Requires:   Modello-Dashboard
Requires:   Modello-Homescreen
Requires:   Modello-Hvac
Requires:   Modello-Multimediaplayer
Requires:   Modello-Nav
Requires:   Modello-Phone
Requires:   Modello-SDL
Requires:   tizen-platform-config

%description xwalk
The Xwalk version of Modello Installer package

%package wrt
Summary: The WRT version of Modello Installer
Requires:   wrt-installer

%description wrt
Installs Modello using wrt-installer package

%prep
%setup -q -n %{name}-%{version}
cp %{SOURCE1001} .

%build
#build section

%install
%make_install

%post xwalk
source %{_sysconfdir}/tizen-platform.conf

export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/5000/dbus/user_bus_socket"

for list in $(find $TZ_SYS_APP_PREINSTALL -name "Modello*")
do
#XWalk requires you not be root to install files
        echo "Installing $list"
        su %{MODELLO_INSTALL_USER} -c "xwalkctl -i $list"
done

for list2 in $(ls -d $TZ_SYS_HOME/%{MODELLO_INSTALL_USER}/.config/xwalk-service/applications/*/)
do
        su %{MODELLO_INSTALL_USER} -c "mkdir -p '$list2/css'"
        su %{MODELLO_INSTALL_USER} -c "mkdir -p '$list2/js'"
        su %{MODELLO_INSTALL_USER} -c "cp -r %{MODELLO_COMMON_DIR}/js/services '$list2/js/'"
        su %{MODELLO_INSTALL_USER} -c "cp -r %{MODELLO_COMMON_DIR}/css/* '$list2/css/'"
        su %{MODELLO_INSTALL_USER} -c "cp -r %{MODELLO_COMMON_DIR}/icons '$list2/'"
done

%postun xwalk
source %{_sysconfdir}/tizen-platform.conf

export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/5000/dbus/user_bus_socket"

for list3 in $(su %{MODELLO_INSTALL_USER} -c "xwalkctl" | grep Modello | cut -c 1-32)
do
        echo "Uninstalling $list3"
        su %{MODELLO_INSTALL_USER} -c "xwalkctl -u $list3"
done

%post wrt
source %{_sysconfdir}/tizen-platform.conf

for list in $(find $TZ_SYS_APP_PREINSTALL -name "Modello*")
do
#wrt-installer requires you be root to install files
        wrt-installer -i $list
done

for list2 in $(ls -d /opt/usr/apps/*/)
do
        mkdir -p "$list2/css"
        mkdir -p "$list2/js"
        cp -r %{MODELLO_COMMON_DIR}/js/services "$list2/res/wgt/js/"
        cp -r %{MODELLO_COMMON_DIR}/css/* "$list2/res/wgt/css/"
done

%files xwalk
%defattr(-,root,root,-)
%manifest %{name}.manifest

%files wrt
%defattr(-,root,root,-)
%manifest %{name}.manifest