use CMAKE_INSTALL_LIBDIR instead of "/usr/lib"
[profile/ivi/smartdevicelink.git] / packaging / smartdevicelink.spec
1 %define SDL_PKGID SDL0000001
2 %define SDL_APPID %{SDL_PKGID}.SmartDeviceLink
3
4 Name:          smartdevicelink
5 Summary:       GENIVI mobile device and HMI integration
6 Version:       3.5
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 Source1001:    %{name}.manifest
13 Source2001:    config.xml.in
14 Source2002:    manifest.json.in
15 BuildRequires: cmake
16 BuildRequires: pkgconfig(bluez)
17 BuildRequires: pkgconfig(gstreamer-1.0)
18 BuildRequires: pkgconfig(glib-2.0)
19 BuildRequires: pkgconfig(liblog4cxx)
20 BuildRequires: pkgconfig(avahi-client)
21 BuildRequires: pkgconfig(libpulse-simple)
22 BuildRequires: pkgconfig(libtzplatform-config)
23 BuildRequires: pkgconfig(expat)
24 BuildRequires: pkgconfig(libcrypto)
25 BuildRequires: pkgconfig(libudev)
26 BuildRequires: pkgconfig(sqlite3)
27 BuildRequires: doxygen
28 BuildRequires: zip
29 Requires:      crosswalk-tizen
30
31 # Custom SDL-enabled HMIs should "Provide" this virtual package.
32 Requires:      smartdevicelink-hmi
33
34 %description
35 SmartDeviceLink is a project which intends to standardize and wrap the
36 many in-vehicle interfaces which may exist in the automotive
37 context. The end goal is to provide an expandable software framework
38 to both mobile application developers and automotive head unit
39 creators for the creation of brought-in applications that appear
40 integrated onto a head unit.
41
42 Many in-vehicle HMIs use different colors, templates, icons, fonts,
43 voice systems and input methods for their infotainment systems. With
44 SmartDeviceLink, a template-based approach is provided by the
45 automotive head unit and allows for different HMI frameworks to follow
46 a specific set of guidelines ensuring a consistent experience to a
47 developer. By leveraging this common API and a brought-in device,
48 automotive head units leverage the complete power of the brought-in
49 device using the APIs being executed on the mobile device.
50
51 %package sample-hmi
52 Summary:       Sample HMI
53 Provides:      smartdevicelink-hmi
54
55 %description sample-hmi
56 This package contains a sample/reference HMI.
57
58 %prep
59 %setup -q -n %{name}-%{version}
60 cp %{SOURCE1001} .
61
62 %build
63 mkdir html5_build
64 pushd html5_build
65 # For the Qt based HMI add -DHMI2=ON to the cmake command line flags.
66 %cmake .. -DEXTENDED_MEDIA_MODE=ON
67 make %{?_smp_mflags}
68 popd
69
70 %install
71
72 mkdir -p %{buildroot}%{_bindir} %{buildroot}%{_libdir}
73 mkdir -p %{buildroot}%{_datadir}/%{name}
74 mkdir -p %{buildroot}%{_sysconfdir}/%{name}
75
76 pushd html5_build/src/appMain
77 install -m 0755 smartDeviceLinkCore %{buildroot}%{_bindir}
78 install -m 0755 libPolicy.so %{buildroot}%{_libdir}
79 popd
80
81 pushd src/appMain
82 install -m 0644 audio.8bit.wav %{buildroot}%{_datadir}/%{name}
83 install -m 0644 \
84     log4cxx.properties \
85     hmi_capabilities.json \
86     policy_table.json \
87     sdl_preloaded_pt.json \
88     sdl_update_pt.json \
89     %{buildroot}%{_sysconfdir}/%{name}
90 sed -e 's,= \(.*\)\.json,= %{_sysconfdir}/%{name}/\1\.json,g' \
91     -e 's,= \(audio.8bit.wav\),= %{_datadir}/%{name}/\1,' \
92     smartDeviceLink.ini > \
93     %{buildroot}%{_sysconfdir}/%{name}/smartDeviceLink.ini
94 popd
95
96 pushd html5_build/src/components
97 install -m 0755 rpc_base/librpc_base.so %{buildroot}%{_libdir}
98 install -m 0755 utils/libUtils.so %{buildroot}%{_libdir}
99 install -m 0755 connection_handler/libconnectionHandler.so %{buildroot}%{_libdir}
100 install -m 0755 request_watchdog/libRequestWatchdog.so %{buildroot}%{_libdir}
101 install -m 0755 resumption/libResumption.so %{buildroot}%{_libdir}
102 install -m 0755 smart_objects/libSmartObjects.so %{buildroot}%{_libdir}
103 install -m 0755 policy/src/policy/sqlite_wrapper/libdbms.so %{buildroot}%{_libdir}
104 install -m 0755 policy/src/policy/policy_table/table_struct/libpolicy_struct.so %{buildroot}%{_libdir}
105 install -m 0755 policy/src/policy/usage_statistics/libUsageStatistics.so %{buildroot}%{_libdir}
106 install -m 0755 policy/src/policy/libPolicy.so %{buildroot}%{_libdir}
107 install -m 0755 transport_manager/libTransportManager.so %{buildroot}%{_libdir}
108 install -m 0755 protocol_handler/libProtocolHandler.so %{buildroot}%{_libdir}
109 install -m 0755 hmi_message_handler/libHMIMessageHandler.so %{buildroot}%{_libdir}
110 install -m 0755 config_profile/libConfigProfile.so %{buildroot}%{_libdir}
111 install -m 0755 interfaces/libMOBILE_API.so %{buildroot}%{_libdir}
112 install -m 0755 interfaces/libv4_protocol_v1_2_no_extra.so %{buildroot}%{_libdir}
113 install -m 0755 interfaces/libHMI_API.so %{buildroot}%{_libdir}
114 install -m 0755 application_manager/libApplicationManager.so %{buildroot}%{_libdir}
115 install -m 0755 time_tester/libTimeTester.so %{buildroot}%{_libdir}
116 install -m 0755 media_manager/libMediaManager.so %{buildroot}%{_libdir}
117 install -m 0755 formatters/libformatters.so %{buildroot}%{_libdir}
118 popd
119
120 pushd html5_build/src/thirdPartyLibs
121 install -m 0755 encryption/libencryption.so %{buildroot}%{_libdir}
122 install -m 0755 MessageBroker/libMessageBrokerClient.so %{buildroot}%{_libdir}
123 install -m 0755 MessageBroker/libMessageBrokerServer.so %{buildroot}%{_libdir}
124 install -m 0755 MessageBroker/libMessageBroker.so %{buildroot}%{_libdir}
125 install -m 0755 libusbx-1.0.16/libLibusb-1.0.16.so %{buildroot}%{_libdir}
126 install -m 0755 jsoncpp/libjsoncpp.so %{buildroot}%{_libdir}
127 popd
128
129 # Sample HMI
130 # The SDL HMI will be launched with xwalk-launcher so package it as a
131 # Crosswalk widget.
132 mkdir -p %{buildroot}%{TZ_SYS_APP_PREINSTALL}
133 pushd %{dirname:%SOURCE2001}
134 sed -e 's/%%SDL_PKGID%%/%{SDL_PKGID}/' \
135     -e 's/%%SDL_APPID%%/%{SDL_APPID}/' \
136     -e 's/%%SDL_VERSION%%/%{version}/' %{SOURCE2001} > config.xml
137 sed -e 's/%%SDL_VERSION%%/%{version}/' %{SOURCE2002} > manifest.json
138 zip %{buildroot}%{TZ_SYS_APP_PREINSTALL}/%{name}.wgt config.xml manifest.json
139 rm config.xml manifest.json
140 popd
141 pushd src/components/HMI
142 zip -r %{buildroot}%{TZ_SYS_APP_PREINSTALL}/%{name}.wgt .
143 popd
144
145 # Create the 'hmi_link' file with the location of the sample HMI.
146 # Normally this would be the path to the top-level index.html file for
147 # the SDL HMI, e.g.  %%{_datadir}/%%{name}/HMI/index.html.  However,
148 # since we are using xwalk-laucher to launch the HMI we must instead
149 # provide the SDL Crosswalk application ID, i.s. SmartDeviceLink,
150 # instead.
151 echo %{SDL_APPID} > %{buildroot}%{_sysconfdir}/%{name}/hmi_link
152
153 %clean
154
155 %post -p /sbin/ldconfig
156 %postun -p /sbin/ldconfig
157
158 %files
159 %manifest %{name}.manifest
160 %license LICENSE
161 %{_bindir}/smartDeviceLinkCore
162 %{_libdir}/*.so*
163 %config %{_sysconfdir}/%{name}/log4cxx.properties
164
165 %files sample-hmi
166 %manifest %{name}.manifest
167 %config %{_sysconfdir}/%{name}/*
168 %exclude %{_sysconfdir}/%{name}/log4cxx.properties
169 %{_datadir}/%{name}/*
170 %{TZ_SYS_APP_PREINSTALL}/%{name}.wgt