1d305ff464e6c0c8d76dc546ac743095bee1c3a6
[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 %{_unitdir}/sensord.service
112 %{_unitdir}/sensord.socket
113 %{_unitdir}/multi-user.target.wants/sensord.service
114 %{_unitdir}/sockets.target.wants/sensord.socket
115 %license LICENSE.APLv2
116 %{_datadir}/license/sensord
117
118 %files -n libsensord
119 %manifest libsensord.manifest
120 %defattr(-,root,root,-)
121 %{_libdir}/libsensor.so.*
122 %{_libdir}/sensord/*.so*
123 %{_libdir}/libsensord-share.so
124 %{_libdir}/libsensord-server.so
125 %license LICENSE.APLv2
126 %{_datadir}/license/libsensord
127
128 %files -n libsensord-devel
129 %defattr(-,root,root,-)
130 %{_includedir}/sensor/*.h
131 %{_includedir}/sf_common/*.h
132 %{_libdir}/libsensor.so
133 %{_libdir}/pkgconfig/sensor.pc
134 %{_libdir}/pkgconfig/sf_common.pc
135 %{_libdir}/pkgconfig/sensord-server.pc
136
137 %if %{build_test_suite} == "ON"
138 %files -n sensor-tc
139 %defattr(-,root,root,-)
140 /usr/bin/accelerometer
141 /usr/bin/geomagnetic
142 /usr/bin/orientation
143 /usr/bin/gravity
144 /usr/bin/linear_acceleration
145 /usr/bin/gyro
146 /usr/bin/proxi
147 /usr/bin/pressure
148 /usr/bin/temperature
149 /usr/bin/light
150
151 %license LICENSE.APLv2
152 %{_datadir}/license/test
153 %endif
154