sensord: create sensor-hal-devel package
[platform/core/system/sensord.git] / packaging / sensord.spec
1 Name:       sensord
2 Summary:    Sensor daemon
3 Version:    2.0.1
4 Release:    0
5 Group:          System/Sensor Framework
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1:        sensord.manifest
9 Source2:        libsensord.manifest
10
11 BuildRequires:  cmake
12 BuildRequires:  libattr-devel
13 BuildRequires:  pkgconfig(dlog)
14 BuildRequires:  pkgconfig(libxml-2.0)
15 BuildRequires:  pkgconfig(glib-2.0)
16 BuildRequires:  pkgconfig(vconf)
17 BuildRequires:  pkgconfig(libsystemd-daemon)
18 BuildRequires:  pkgconfig(capi-system-info)
19 BuildRequires:  pkgconfig(cynara-creds-socket)
20 BuildRequires:  pkgconfig(cynara-client)
21 BuildRequires:  pkgconfig(cynara-session)
22 Requires:   libsensord = %{version}-%{release}
23
24 %define auto_rotation_state ON
25 %define orientation_state OFF
26 %define gravity_state OFF
27 %define linear_accel_state OFF
28 %define rv_state OFF
29 %define geomagnetic_rv_state OFF
30 %define gaming_rv_state OFF
31 %define tilt_state OFF
32 %define gyroscope_uncal_state OFF
33 %define build_test_suite ON
34
35 %description
36 Sensor daemon
37
38 %package -n libsensord
39 Summary:    Sensord library
40 Group:      System/Libraries
41 Requires:   %{name} = %{version}-%{release}
42
43 %description -n libsensord
44 Sensord library
45
46 %package -n libsensord-devel
47 Summary:    Sensord shared library
48 Group:      System/Development
49 Requires:   libsensord = %{version}-%{release}
50
51 %description -n libsensord-devel
52 Sensord shared library
53
54 %package -n sensor-hal-devel
55 Summary:    Sensord HAL interface
56 Group:      System/Development
57
58 %description -n sensor-hal-devel
59 Sensord HAL interface
60
61 %if %{build_test_suite} == "ON"
62 %package -n sensor-test
63 Summary:    Sensord library
64 Group:      System/Testing
65
66 %description -n sensor-test
67 Sensor functional testing
68
69 %endif
70
71 %prep
72 %setup -q
73 cp %{SOURCE1} .
74 cp %{SOURCE2} .
75
76 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
77
78 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} \
79         -DORIENTATION=%{orientation_state} -DGRAVITY=%{gravity_state} \
80         -DLINEAR_ACCEL=%{linear_accel_state} -DRV=%{rv_state} \
81         -DGEOMAGNETIC_RV=%{geomagnetic_rv_state} -DGAMING_RV=%{gaming_rv_state} \
82         -DGYROSCOPE_UNCAL=%{gyroscope_uncal_state} -DAUTO_ROTATION=%{auto_rotation_state} \
83         -DTILT=%{tilt_state} -DTEST_SUITE=%{build_test_suite}
84
85 %build
86 make %{?jobs:-j%jobs}
87
88 %install
89 rm -rf %{buildroot}
90 %make_install
91
92 %install_service multi-user.target.wants sensord.service
93 %install_service sockets.target.wants sensord.socket
94
95 %post
96 systemctl daemon-reload
97
98 %postun
99 systemctl daemon-reload
100
101 %post -n libsensord -p /sbin/ldconfig
102
103 %postun -n libsensord -p /sbin/ldconfig
104
105 %files
106 %attr(0644,root,root)/usr/etc/virtual_sensors.xml
107 %manifest sensord.manifest
108 %{_bindir}/sensord
109 %{_unitdir}/sensord.service
110 %{_unitdir}/sensord.socket
111 %{_unitdir}/multi-user.target.wants/sensord.service
112 %{_unitdir}/sockets.target.wants/sensord.socket
113 %license LICENSE.APLv2
114
115 %files -n libsensord
116 %defattr(-,root,root,-)
117 %manifest libsensord.manifest
118 %{_libdir}/libsensor.so.*
119 %{_libdir}/libsensord-shared.so
120 %license LICENSE.APLv2
121
122 %files -n libsensord-devel
123 %defattr(-,root,root,-)
124 %{_includedir}/sensor/*.h
125 %{_libdir}/libsensor.so
126 %{_libdir}/pkgconfig/sensor.pc
127 %license LICENSE.APLv2
128
129 %files -n sensor-hal-devel
130 %defattr(-,root,root,-)
131 %{_includedir}/sensor/sensor_hal.h
132 %license LICENSE.APLv2
133
134 %if %{build_test_suite} == "ON"
135 %files -n sensor-test
136 %defattr(-,root,root,-)
137 %{_bindir}/api-test
138 %{_bindir}/sensor-test
139 %{_bindir}/multi-thread-performance-test
140 %{_bindir}/multi-process-performance-test
141 %{_bindir}/fusion-data-collection
142 %license LICENSE.APLv2
143 %endif