Launch SDL HMIs via xwalk-launcher.
[profile/ivi/smartdevicelink.git] / packaging / smartdevicelink.spec
1 %define WIDGET_INSTALL_DIR /opt/usr/apps/.preinstallWidgets
2 %define WIDGET_PATH %{WIDGET_INSTALL_DIR}/%{name}.wgt
3
4 Name:          smartdevicelink
5 Summary:       GENIVI SmartDeviceLink (SDL)
6 Version:       2.0
7 Release:       1
8 Group:         Automotive/GENIVI
9 License:       BSD-3-Clause
10 URL:           http://projects.genivi.org/smartdevicelink/
11 Source:        %{name}-%{version}.tar.gz
12 Source1:       %{name}.xml
13 Source1001:    %{name}.manifest
14 Source2001:    config.xml
15 Source2002:    manifest.json
16 BuildRequires: cmake
17 BuildRequires: pkgconfig(bluez)
18 BuildRequires: pkgconfig(gstreamer-1.0)
19 BuildRequires: pkgconfig(glib-2.0)
20 BuildRequires: pkgconfig(liblog4cxx)
21 BuildRequires: pkgconfig(avahi-client)
22 BuildRequires: pkgconfig(libpulse-simple)
23 BuildRequires: doxygen
24 BuildRequires: zip
25 Requires:      crosswalk
26 Requires(post): /usr/bin/pkg_initdb
27
28 # Custom SDL-enabled HMIs should "Provide" this virtual package.
29 Requires:      smartdevicelink-hmi
30
31 %description
32 SmartDeviceLink is a project which intends to standardize and wrap the
33 many in-vehicle interfaces which may exist in the automotive
34 context. The end goal is to provide an expandable software framework
35 to both mobile application developers and automotive head unit
36 creators for the creation of brought-in applications that appear
37 integrated onto a head unit.
38
39 Many in-vehicle HMIs use different colors, templates, icons, fonts,
40 voice systems and input methods for their infotainment systems. With
41 SmartDeviceLink, a template-based approach is provided by the
42 automotive head unit and allows for different HMI frameworks to follow
43 a specific set of guidelines ensuring a consistent experience to a
44 developer. By leveraging this common API and a brought-in device,
45 automotive head units leverage the complete power of the brought-in
46 device using the APIs being executed on the mobile device.
47
48 %package sample-hmi
49 Group:         Graphics & UI Framework/Automotive UI
50 Summary:       Sample SmartDeviceLink capable HMI
51 Provides:      smartdevicelink-hmi
52
53 %description sample-hmi
54 This package contains a an SmartDeviceLink template-based
55 sample/reference HMI.
56
57 %prep
58 %setup -q -n %{name}-%{version}
59 cp %{SOURCE1001} .
60
61 %build
62 cd SDL_Core
63 %cmake .
64 make %{?_smp_mflags}
65
66 %install
67 # Don't run "make install".  We only care about the core SDL related
68 # binaries, and HMI related files.
69 mkdir -p %{buildroot}%{_sysconfdir}/%{name}
70 install -m 0644 SDL_Core/src/appMain/log4cxx.properties %{buildroot}%{_sysconfdir}/%{name}
71
72 mkdir -p %{buildroot}%{_bindir} %{buildroot}%{_libdir}
73 install -m 0755 SDL_Core/src/appMain/smartDeviceLinkCore %{buildroot}%{_bindir}
74 install -m 0755 SDL_Core/src/components/audio_manager/libAudioManager.so %{buildroot}%{_libdir}
75 install -m 0755 SDL_Core/src/components/utils/libUtils.so %{buildroot}%{_libdir}
76 install -m 0755 SDL_Core/src/components/connection_handler/libconnectionHandler.so %{buildroot}%{_libdir}
77 install -m 0755 SDL_Core/src/components/request_watchdog/libRequestWatchdog.so %{buildroot}%{_libdir}
78 install -m 0755 SDL_Core/src/components/mobile_message_handler/libMobileMessageHandler.so %{buildroot}%{_libdir}
79 install -m 0755 SDL_Core/src/components/smart_objects/libSmartObjects.so %{buildroot}%{_libdir}
80 install -m 0755 SDL_Core/src/components/transport_manager/libTransportManager.so %{buildroot}%{_libdir}
81 install -m 0755 SDL_Core/src/components/protocol_handler/libProtocolHandler.so %{buildroot}%{_libdir}
82 install -m 0755 SDL_Core/src/components/hmi_message_handler/libHMIMessageHandler.so %{buildroot}%{_libdir}
83 install -m 0755 SDL_Core/src/components/config_profile/libConfigProfile.so %{buildroot}%{_libdir}
84 install -m 0755 SDL_Core/src/components/interfaces/libMOBILE_API.so %{buildroot}%{_libdir}
85 install -m 0755 SDL_Core/src/components/interfaces/libHMI_API.so %{buildroot}%{_libdir}
86 install -m 0755 SDL_Core/src/components/application_manager/libApplicationManager.so %{buildroot}%{_libdir}
87 install -m 0755 SDL_Core/src/components/formatters/libformatters.so %{buildroot}%{_libdir}
88 install -m 0755 SDL_Core/src/thirdPartyLibs/encryption/libencryption.so %{buildroot}%{_libdir}
89 install -m 0755 SDL_Core/src/thirdPartyLibs/MessageBroker/libMessageBrokerClient.so %{buildroot}%{_libdir}
90 install -m 0755 SDL_Core/src/thirdPartyLibs/MessageBroker/libMessageBrokerServer.so %{buildroot}%{_libdir}
91 install -m 0755 SDL_Core/src/thirdPartyLibs/MessageBroker/libMessageBroker.so %{buildroot}%{_libdir}
92 install -m 0755 SDL_Core/src/thirdPartyLibs/jsoncpp/libjsoncpp.so %{buildroot}%{_libdir}
93
94 # Sample HMI
95 # The SDL HMI will be launched with xwalk-launcher so package it as a
96 # Crosswalk widget.
97 mkdir -p %{buildroot}/%{WIDGET_INSTALL_DIR}
98 cd %{dirname:%SOURCE2001} \
99   && zip %{buildroot}%{WIDGET_PATH} config.xml manifest.json \
100   && cd -
101 cd SDL_Core/src/components/HMI \
102   && zip -r %{buildroot}%{WIDGET_PATH} . \
103   && cd -
104
105 # Create the 'hmi_link' file with the location of the sample HMI.
106 # Normally this would be the path to the top-level index.html file for
107 # the SDL HMI, e.g.  %%{_datadir}/%%{name}/HMI/index.html.  However,
108 # since we are using xwalk-laucher to launch the HMI we must instead
109 # provide the SDL Crosswalk application ID, i.s. SmartDeviceLink,
110 # instead.
111 echo SDL0000001.SmartDeviceLink > %{buildroot}%{_sysconfdir}/%{name}/hmi_link
112
113 # Install Tizen package metadata for smartdevicelink
114 mkdir -p %{buildroot}%{_datadir}/packages/
115 mkdir -p %{buildroot}%{_datadir}/icons/default/small
116 install -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/packages/%{name}.xml
117 install -m 0644 SDL_Core/src/components/HMI/images/sdl/devices.png \
118                 %{buildroot}%{_datadir}/icons/default/small/
119
120 %clean
121
122 %post -p /sbin/ldconfig
123
124 %post sample-hmi
125 /usr/bin/pkg_initdb
126 su app -c "xwalkctl -i /opt/usr/apps/.preinstallWidgets/%{name}.wgt"
127
128 %postun -p /sbin/ldconfig
129
130 %postun sample-hmi
131 /usr/bin/pkg_initdb
132 su app -c "xwalkctl -u $(su app -c "xwalkctl list | grep SmartDeviceLink | cut -c 1-32")"
133
134 %files
135 %manifest %{name}.manifest
136 %license LICENSE
137 %{_bindir}/smartDeviceLinkCore
138 %{_libdir}/*.so*
139 %config %{_sysconfdir}/%{name}/log4cxx.properties
140
141 %files sample-hmi
142 %config %{_sysconfdir}/%{name}/hmi_link
143 %{_datadir}/packages/%{name}.xml
144 %{_datadir}/icons/default/small/*.png
145 /opt/usr/apps/.preinstallWidgets/%{name}.wgt