Synchronizing temperature sensor plugin with addition of IIO interface support
[platform/core/system/sensord.git] / packaging / sensord.spec
1 Name:       sensord
2 Summary:    Sensor daemon
3 Version:    1.0.0
4 Release:    0
5 Group:          System/Sensor Framework
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1:    sensord.service
9 Source2:    sensord.socket
10
11 %define accel_state ON
12 %define gyro_state ON
13 %define proxi_state ON
14 %define light_state ON
15 %define geo_state ON
16 %define pressure_state ON
17 %define temperature_state ON
18 %define orientation_state ON
19 %define gravity_state ON
20 %define linear_accel_state ON
21
22 %define build_test_suite OFF
23
24 BuildRequires:  cmake
25 BuildRequires:  vconf-keys-devel
26 BuildRequires:  libattr-devel
27 BuildRequires:  pkgconfig(dlog)
28 BuildRequires:  pkgconfig(libxml-2.0)
29 BuildRequires:  pkgconfig(glib-2.0)
30 BuildRequires:  pkgconfig(vconf)
31 BuildRequires:  pkgconfig(libsystemd-daemon)
32 BuildRequires:  pkgconfig(capi-system-info)
33
34 %description
35 Sensor daemon
36
37 %package sensord
38 Summary:    Sensor daemon
39 Group:      System/Sensor Framework
40 Requires:   %{name} = %{version}-%{release}
41
42 %description sensord
43 Sensor daemon
44
45 %package -n libsensord
46 Summary:    Sensord library
47 Group:      System/Sensor Framework
48 Requires:   %{name} = %{version}-%{release}
49
50 %description -n libsensord
51 Sensord library
52
53 %package -n libsensord-devel
54 Summary:    Sensord library (devel)
55 Group:      System/Sensor Framework
56 Requires:   %{name} = %{version}-%{release}
57
58 %description -n libsensord-devel
59 Sensord library (devel)
60
61 %if %{build_test_suite} == "ON"
62 %package -n sensor-tc
63 Summary:    Sensord library
64 Group:      System/Sensor Framework
65 Requires:   %{name} = %{version}-%{release}
66
67 %description -n sensor-tc
68 Sensor functional testing
69
70 %endif
71
72 %prep
73 %setup -q
74
75 %build
76 #CFLAGS+=" -fvisibility=hidden "; export CFLAGS
77 #CXXFLAGS+=" -fvisibility=hidden -fvisibility-inlines-hidden ";export CXXFLAGS
78 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DACCEL=%{accel_state} \
79         -DGYRO=%{gyro_state} -DPROXI=%{proxi_state} -DLIGHT=%{light_state} \
80         -DGEO=%{geo_state} -DPRESSURE=%{pressure_state} -DTEMPERATURE=%{temperature_state} \
81         -DORIENTATION=%{orientation_state} -DGRAVITY=%{gravity_state} \
82         -DLINEAR_ACCEL=%{linear_accel_state} -DMOTION=%{motion_state} \
83         -DTEST_SUITE=%{build_test_suite}
84
85 make %{?jobs:-j%jobs}
86
87 %install
88 rm -rf %{buildroot}
89 %make_install
90
91 mkdir -p %{buildroot}/usr/share/license
92 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
93 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
94 install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}
95 install -m 0644 %SOURCE2 %{buildroot}%{_unitdir}
96 ln -s ../sensord.socket  %{buildroot}%{_unitdir}/sockets.target.wants/sensord.socket
97 ln -s ../sensord.service  %{buildroot}%{_unitdir}/multi-user.target.wants/sensord.service
98
99 %post -p /sbin/ldconfig
100 systemctl daemon-reload
101
102 %postun -p /sbin/ldconfig
103 systemctl daemon-reload
104
105 %files -n sensord
106 %manifest sensord.manifest
107 %{_bindir}/sensord
108 %attr(0644,root,root)/usr/etc/sensor_plugins.xml
109 %attr(0644,root,root)/usr/etc/sensors.xml
110 %{_unitdir}/sensord.service
111 %{_unitdir}/sensord.socket
112 %{_unitdir}/multi-user.target.wants/sensord.service
113 %{_unitdir}/sockets.target.wants/sensord.socket
114 %license LICENSE.APLv2
115 %{_datadir}/license/sensord
116
117 %files -n libsensord
118 %manifest libsensord.manifest
119 %defattr(-,root,root,-)
120 %{_libdir}/libsensor.so.*
121 %{_libdir}/sensord/*.so*
122 %{_libdir}/libsensord-share.so
123 %{_libdir}/libsensord-server.so
124 %license LICENSE.APLv2
125 %{_datadir}/license/libsensord
126
127 %files -n libsensord-devel
128 %defattr(-,root,root,-)
129 %{_includedir}/sensor/*.h
130 %{_includedir}/sf_common/*.h
131 %{_libdir}/libsensor.so
132 %{_libdir}/pkgconfig/sensor.pc
133 %{_libdir}/pkgconfig/sf_common.pc
134 %{_libdir}/pkgconfig/sensord-server.pc
135
136 %if %{build_test_suite} == "ON"
137 %files -n sensor-tc
138 %defattr(-,root,root,-)
139 /usr/bin/accelerometer
140 /usr/bin/geomagnetic
141 /usr/bin/orientation
142 /usr/bin/gravity
143 /usr/bin/linear_acceleration
144 /usr/bin/gyro
145 /usr/bin/proxi
146 /usr/bin/pressure
147
148 %license LICENSE.APLv2
149 %{_datadir}/license/test
150 %endif
151