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