Commit 1d0d145f authored by Matti Lehtimäki's avatar Matti Lehtimäki

Merge branch 'jb45163' into 'master'

[binder] Add binder backend to hybris adaptor. JB#45163

See merge request !35
parents b863b07c 1dd09c7b
......@@ -21,7 +21,6 @@
#include "hybrisaccelerometeradaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
#include <hardware/sensors.h>
#include "config.h"
#define GRAVITY_RECIPROCAL_THOUSANDS 101.971621298
......@@ -66,9 +65,15 @@ void HybrisAccelerometerAdaptor::processSample(const sensors_event_t& data)
d->timestamp_ = quint64(data.timestamp * .001);
// sensorfw wants milli-G'
#ifdef USE_BINDER
d->x_ = data.u.vec3.x * GRAVITY_RECIPROCAL_THOUSANDS;
d->y_ = data.u.vec3.y * GRAVITY_RECIPROCAL_THOUSANDS;
d->z_ = data.u.vec3.z * GRAVITY_RECIPROCAL_THOUSANDS;
#else
d->x_ = data.acceleration.x * GRAVITY_RECIPROCAL_THOUSANDS;
d->y_ = data.acceleration.y * GRAVITY_RECIPROCAL_THOUSANDS;
d->z_ = data.acceleration.z * GRAVITY_RECIPROCAL_THOUSANDS;
#endif
buffer->commit();
buffer->wakeUpReaders();
......
......@@ -24,7 +24,6 @@
#include "hybrisalsadaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
#include <hardware/sensors.h>
#include "config.h"
#include <fcntl.h>
......@@ -129,7 +128,11 @@ void HybrisAlsAdaptor::processSample(const sensors_event_t& data)
{
TimedUnsigned *d = buffer->nextSlot();
d->timestamp_ = quint64(data.timestamp * .001);
#ifdef USE_BINDER
d->value_ = data.u.scalar;
#else
d->value_ = data.light;
#endif
lastLightValue = d->value_;
buffer->commit();
buffer->wakeUpReaders();
......
......@@ -21,7 +21,6 @@
#include "hybrisgyroscopeadaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
#include <hardware/sensors.h>
#include "config.h"
#include <math.h>
......@@ -73,9 +72,15 @@ void HybrisGyroscopeAdaptor::processSample(const sensors_event_t& data)
TimedXyzData *d = buffer->nextSlot();
d->timestamp_ = quint64(data.timestamp * .001);
#ifdef USE_BINDER
d->x_ = (data.u.vec3.x) * RADIANS_TO_DEGREES * 1000;
d->y_ = (data.u.vec3.y) * RADIANS_TO_DEGREES * 1000;
d->z_ = (data.u.vec3.z) * RADIANS_TO_DEGREES * 1000;
#else
d->x_ = (data.gyro.x) * RADIANS_TO_DEGREES * 1000;
d->y_ = (data.gyro.y) * RADIANS_TO_DEGREES * 1000;
d->z_ = (data.gyro.z) * RADIANS_TO_DEGREES * 1000;
#endif
buffer->commit();
buffer->wakeUpReaders();
}
......
......@@ -21,7 +21,6 @@
#include "hybrismagnetometeradaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
#include <hardware/sensors.h>
#include "config.h"
HybrisMagnetometerAdaptor::HybrisMagnetometerAdaptor(const QString& id) :
......@@ -68,6 +67,16 @@ void HybrisMagnetometerAdaptor::processSample(const sensors_event_t& data)
{
CalibratedMagneticFieldData *d = buffer->nextSlot();
d->timestamp_ = quint64(data.timestamp * .001);
#ifdef USE_BINDER
d->x_ = data.u.vec3.x * 1000;
d->y_ = data.u.vec3.y * 1000;
d->z_ = data.u.vec3.z * 1000;
d->rx_ = data.u.vec3.x * 1000;
d->ry_ = data.u.vec3.y * 1000;
d->rz_ = data.u.vec3.z * 1000;
d->level_= data.u.vec3.status;
#else
//uT
d->x_ = (data.magnetic.x * 1000);
d->y_ = (data.magnetic.y * 1000);
......@@ -81,7 +90,7 @@ void HybrisMagnetometerAdaptor::processSample(const sensors_event_t& data)
d->rx_ = data.magnetic.x * 1000;
d->ry_ = data.magnetic.y * 1000;
d->rz_ = data.magnetic.z * 1000;
#endif
#endif
buffer->commit();
buffer->wakeUpReaders();
......
......@@ -21,7 +21,6 @@
#include "hybrisorientationadaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
#include <hardware/sensors.h>
#include "config.h"
/*
......@@ -84,9 +83,14 @@ void HybrisOrientationAdaptor::processSample(const sensors_event_t& data)
{
CompassData *d = buffer->nextSlot();
d->timestamp_ = quint64(data.timestamp * .001);
#ifdef USE_BINDER
d->degrees_ = data.u.vec3.x; //azimuth
d->level_ = data.u.vec3.status;
#else
d->degrees_ = data.orientation.azimuth; //azimuth
d->rawDegrees_ = d->degrees_;
d->level_ = data.orientation.status;
#endif
d->rawDegrees_ = d->degrees_;
buffer->commit();
buffer->wakeUpReaders();
......
......@@ -26,7 +26,6 @@
#include "hybrispressureadaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
#include <hardware/sensors.h>
#include "config.h"
HybrisPressureAdaptor::HybrisPressureAdaptor(const QString& id) :
......@@ -70,7 +69,11 @@ void HybrisPressureAdaptor::processSample(const sensors_event_t& data)
{
TimedUnsigned *d = buffer->nextSlot();
d->timestamp_ = quint64(data.timestamp * .001);
#ifdef USE_BINDER
d->value_ = data.u.scalar * 100;//From hPa to Pa
#else
d->value_ = data.pressure * 100;//From hPa to Pa
#endif
buffer->commit();
buffer->wakeUpReaders();
}
......
......@@ -25,7 +25,6 @@
#include "hybrisproximityadaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
#include <hardware/sensors.h>
#include "config.h"
#include <fcntl.h>
#include <unistd.h>
......@@ -138,11 +137,18 @@ void HybrisProximityAdaptor::processSample(const sensors_event_t& data)
ProximityData *d = buffer->nextSlot();
d->timestamp_ = quint64(data.timestamp * .001);
bool near = false;
#ifdef USE_BINDER
if (data.u.scalar < maxRange()) {
near = true;
}
d->value_ = data.u.scalar;
#else
if (data.distance < maxRange()) {
near = true;
}
d->withinProximity_ = near;
d->value_ = data.distance;
#endif
d->withinProximity_ = near;
lastNearValue = near;
buffer->commit();
......
......@@ -24,7 +24,6 @@
#include "hybrisstepcounteradaptor.h"
#include "logging.h"
#include "datatypes/utils.h"
#include <hardware/sensors.h>
#include "config.h"
#ifndef SENSOR_TYPE_STEP_COUNTER
......@@ -81,12 +80,16 @@ void HybrisStepCounterAdaptor::processSample(const sensors_event_t& data)
{
TimedUnsigned *d = buffer->nextSlot();
d->timestamp_ = quint64(data.timestamp * .001);
#ifdef USE_BINDER
d->value_ = data.u.stepCount;
#else
#ifdef NO_SENSORS_EVENT_U64
uint64_t value = 0;
memcpy(&value, data.data, sizeof value);
d->value_ = value;
#else
d->value_ = data.u64.step_counter;
#endif
#endif
buffer->commit();
buffer->wakeUpReaders();
......
......@@ -38,7 +38,11 @@ OTHER_FILES += \
contains(CONFIG,hybris) {
CONFIG += link_pkgconfig
PKGCONFIG += android-headers
PKGCONFIG += libhardware
contains(CONFIG,binder) {
DEFINES += USE_BINDER=1
PKGCONFIG += libgbinder libglibutil gobject-2.0 glib-2.0
} else {
PKGCONFIG += android-headers libhardware
}
}
......@@ -5,9 +5,6 @@ TARGET = hybrissensorfw
include( ../common-config.pri )
CONFIG += link_pkgconfig
PKGCONFIG += android-headers
SENSORFW_INCLUDEPATHS = .. \
../include \
../filters \
......@@ -20,7 +17,11 @@ QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt5
SOURCES += hybrisadaptor.cpp
HEADERS += hybrisadaptor.h
LIBS += -L/usr/lib -lhybris-common -lhardware -L../datatypes
LIBS += -L/usr/lib -L../datatypes
!contains(CONFIG,binder) {
LIBS += -lhybris-common -lhardware
}
include(../common-install.pri)
target.path = $$SHAREDLIBPATH
......
This diff is collapsed.
......@@ -26,10 +26,16 @@
#include <QTimer>
#include <QFile>
#include <pthread.h>
#include "deviceadaptor.h"
#ifdef USE_BINDER
#include <gbinder.h>
#include "hybrisbindertypes.h"
#else
#include <hardware/sensors.h>
#include <pthread.h>
#endif
#define SENSORFW_MCE_WATCHER
class HybrisAdaptor;
......@@ -54,23 +60,25 @@ public:
explicit HybrisManager(QObject *parent = 0);
virtual ~HybrisManager();
void cleanup();
void initManager();
/* - - - - - - - - - - - - - - - - - - - *
* android sensor hal functions
* android sensor functions
* - - - - - - - - - - - - - - - - - - - */
sensors_event_t *halEventForHandle(int handle) const;
int halIndexForHandle(int handle) const;
int halIndexForType (int sensorType) const;
int halHandleForType (int sensorType) const;
float halGetMaxRange (int handle) const;
float halGetResolution (int handle) const;
int halGetMinDelay (int handle) const;
int halGetMaxDelay (int handle) const;
int halGetDelay (int handle) const;
bool halSetDelay (int handle, int delay_ms);
bool halGetActive (int handle) const;
bool halSetActive (int handle, bool active);
sensors_event_t *eventForHandle(int handle) const;
int indexForHandle(int handle) const;
int indexForType (int sensorType) const;
int handleForType (int sensorType) const;
float getMaxRange (int handle) const;
float getResolution (int handle) const;
int getMinDelay (int handle) const;
int getMaxDelay (int handle) const;
int getDelay (int handle) const;
bool setDelay (int handle, int delay_ms, bool force);
bool getActive (int handle) const;
bool setActive (int handle, bool active);
/* - - - - - - - - - - - - - - - - - - - *
* HybrisManager <--> sensorfwd
......@@ -85,19 +93,46 @@ private:
// fields
bool m_initialized;
QMap <int, HybrisAdaptor *> m_registeredAdaptors; // type -> obj
#ifdef USE_BINDER
// Binder backend
GBinderClient *m_client;
gulong m_deathId;
gulong m_pollTransactId;
GBinderRemoteObject *m_remote;
GBinderServiceManager *m_serviceManager;
struct sensor_t *m_sensorArray; // [m_sensorCount]
#else
// HAL backend
struct sensors_module_t *m_halModule;
struct sensors_poll_device_t *m_halDevice;
int m_halSensorCount;
const struct sensor_t *m_halSensorArray; // [m_halSensorCount]
HybrisSensorState *m_halSensorState; // [m_halSensorCount]
QMap <int, int> m_halIndexOfType; // type -> index
QMap <int, int> m_halIndexOfHandle; // handle -> index
pthread_t m_halEventReaderTid;
const struct sensor_t *m_sensorArray; // [m_sensorCount]
#endif
int m_sensorCount;
HybrisSensorState *m_sensorState; // [m_sensorCount]
QMap <int, int> m_indexOfType; // type -> index
QMap <int, int> m_indexOfHandle; // handle -> index
#ifdef USE_BINDER
void getSensorList();
void startConnect();
void finishConnect();
static void binderDied(GBinderRemoteObject *, void *user_data);
void pollEvents();
static void pollEventsCallback(
GBinderClient* /*client*/, GBinderRemoteReply* reply,
int status, void* userData);
#endif
friend class HybrisAdaptorReader;
#ifndef USE_BINDER
private:
static void *halEventReaderThread(void *aptr);
#endif
void processEvents(const sensors_event_t *buffer,
int numberOfEvents, bool &blockSuspend, bool &errorInInput);
};
class HybrisAdaptor : public DeviceAdaptor
......
/****************************************************************************
**
** Copyright (C) 2019 Jolla Ltd
** Contact: matti.lehtimaki@jolla.com
**
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef HYBRIS_BINDER_TYPES_H
#define HYBRIS_BINDER_TYPES_H
#include <gbinder.h>
#include <stdint.h>
#include <sys/types.h>
#define STATUS_OK 0
#define ALIGNED(x) __attribute__ ((aligned(x)))
enum binder_calls {
// MUST be in the same order as the interfaces in ISensors.hidl
GET_SENSORS_LIST = GBINDER_FIRST_CALL_TRANSACTION,
SET_OPERATION_MODE,
ACTIVATE,
POLL,
BATCH,
FLUSH,
INJECT_SENSOR_DATA,
REGISTER_DIRECT_CHANNEL,
UNREGISTER_DIRECT_CHANNEL,
CONFIG_DIRECT_REPORT,
};
enum {
RESULT_OK = 0,
RESULT_PERMISSION_DENIED = -1,
RESULT_NO_MEMORY = -12,
RESULT_BAD_VALUE = -22,
RESULT_INVALID_OPERATION = -38,
};
enum {
OPERATION_MODE_NORMAL = 0,
OPERATION_MODE_DATA_INJECTION = 1,
};
enum {
SENSOR_TYPE_META_DATA = 0,
SENSOR_TYPE_ACCELEROMETER = 1,
SENSOR_TYPE_MAGNETIC_FIELD = 2,
SENSOR_TYPE_ORIENTATION = 3,
SENSOR_TYPE_GYROSCOPE = 4,
SENSOR_TYPE_LIGHT = 5,
SENSOR_TYPE_PRESSURE = 6,
SENSOR_TYPE_TEMPERATURE = 7,
SENSOR_TYPE_PROXIMITY = 8,
SENSOR_TYPE_GRAVITY = 9,
SENSOR_TYPE_LINEAR_ACCELERATION = 10,
SENSOR_TYPE_ROTATION_VECTOR = 11,
SENSOR_TYPE_RELATIVE_HUMIDITY = 12,
SENSOR_TYPE_AMBIENT_TEMPERATURE = 13,
SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED = 14,
SENSOR_TYPE_GAME_ROTATION_VECTOR = 15,
SENSOR_TYPE_GYROSCOPE_UNCALIBRATED = 16,
SENSOR_TYPE_SIGNIFICANT_MOTION = 17,
SENSOR_TYPE_STEP_DETECTOR = 18,
SENSOR_TYPE_STEP_COUNTER = 19,
SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20,
SENSOR_TYPE_HEART_RATE = 21,
SENSOR_TYPE_TILT_DETECTOR = 22,
SENSOR_TYPE_WAKE_GESTURE = 23,
SENSOR_TYPE_GLANCE_GESTURE = 24,
SENSOR_TYPE_PICK_UP_GESTURE = 25,
SENSOR_TYPE_WRIST_TILT_GESTURE = 26,
SENSOR_TYPE_DEVICE_ORIENTATION = 27,
SENSOR_TYPE_POSE_6DOF = 28,
SENSOR_TYPE_STATIONARY_DETECT = 29,
SENSOR_TYPE_MOTION_DETECT = 30,
SENSOR_TYPE_HEART_BEAT = 31,
SENSOR_TYPE_DYNAMIC_SENSOR_META = 32,
SENSOR_TYPE_ADDITIONAL_INFO = 33,
SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT = 34,
SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED = 35,
SENSOR_TYPE_DEVICE_PRIVATE_BASE = 65536, // 0x10000
};
enum {
SENSOR_FLAG_WAKE_UP = 1u, // 1
SENSOR_FLAG_CONTINUOUS_MODE = 0u, // 0
SENSOR_FLAG_ON_CHANGE_MODE = 2u, // 2
SENSOR_FLAG_ONE_SHOT_MODE = 4u, // 4
SENSOR_FLAG_SPECIAL_REPORTING_MODE = 6u, // 6
SENSOR_FLAG_DATA_INJECTION = 16u, // 0x10
SENSOR_FLAG_DYNAMIC_SENSOR = 32u, // 0x20
SENSOR_FLAG_ADDITIONAL_INFO = 64u, // 0x40
SENSOR_FLAG_DIRECT_CHANNEL_ASHMEM = 1024u, // 0x400
SENSOR_FLAG_DIRECT_CHANNEL_GRALLOC = 2048u, // 0x800
SENSOR_FLAG_MASK_REPORTING_MODE = 14u, // 0xE
SENSOR_FLAG_MASK_DIRECT_REPORT = 896u, // 0x380
SENSOR_FLAG_MASK_DIRECT_CHANNEL = 3072u, // 0xC00
};
struct sensor_t {
int32_t handle ALIGNED(4);
gbinder_hidl_string name ALIGNED(8);
gbinder_hidl_string vendor ALIGNED(8);
int32_t version ALIGNED(4);
int32_t type ALIGNED(4);
gbinder_hidl_string typeAsString ALIGNED(8);
float maxRange ALIGNED(4);
float resolution ALIGNED(4);
float power ALIGNED(4);
int32_t minDelay ALIGNED(4);
uint32_t fifoReservedEventCount ALIGNED(4);
uint32_t fifoMaxEventCount ALIGNED(4);
gbinder_hidl_string requiredPermission ALIGNED(8);
int32_t maxDelay ALIGNED(4);
uint32_t flags ALIGNED(4);
} ALIGNED(8);
static_assert(sizeof(sensor_t) == 112, "wrong size");
enum {
NO_CONTACT = -1, // (-1)
UNRELIABLE = 0,
ACCURACY_LOW = 1,
ACCURACY_MEDIUM = 2,
ACCURACY_HIGH = 3,
};
struct Vec3 {
float x ALIGNED(4);
float y ALIGNED(4);
float z ALIGNED(4);
int8_t status ALIGNED(1);
} ALIGNED(4);
static_assert(sizeof(Vec3) == 16, "wrong size");
struct Vec4 {
float x ALIGNED(4);
float y ALIGNED(4);
float z ALIGNED(4);
float w ALIGNED(4);
} ALIGNED(4);
static_assert(sizeof(Vec4) == 16, "wrong size");
struct Uncal {
float x ALIGNED(4);
float y ALIGNED(4);
float z ALIGNED(4);
float x_bias ALIGNED(4);
float y_bias ALIGNED(4);
float z_bias ALIGNED(4);
} ALIGNED(4);
static_assert(sizeof(Uncal) == 24, "wrong size");
struct HeartRate {
float bpm ALIGNED(4);
int8_t status ALIGNED(1);
} ALIGNED(4);
static_assert(sizeof(HeartRate) == 8, "wrong size");
enum {
META_DATA_FLUSH_COMPLETE = 1u, // 1
};
struct MetaData {
uint32_t what ALIGNED(4);
} ALIGNED(4);
static_assert(sizeof(MetaData) == 4, "wrong size");
struct Dynamicsensor_t {
bool connected ALIGNED(1);
int32_t handle ALIGNED(4);
uint8_t uuid[16] ALIGNED(1);
} ALIGNED(4);
static_assert(sizeof(Dynamicsensor_t) == 24, "wrong size");
enum class AdditionalInfoType : uint32_t {
AINFO_BEGIN = 0u, // 0
AINFO_END = 1u, // 1
AINFO_UNTRACKED_DELAY = 65536u, // 0x10000
AINFO_INTERNAL_TEMPERATURE = 65537u, // 65537
AINFO_VEC3_CALIBRATION = 65538u, // 65538
AINFO_SENSOR_PLACEMENT = 65539u, // 65539
AINFO_SAMPLING = 65540u, // 65540
AINFO_CHANNEL_NOISE = 131072u, // 0x20000
AINFO_CHANNEL_SAMPLER = 131073u, // 131073
AINFO_CHANNEL_FILTER = 131074u, // 131074
AINFO_CHANNEL_LINEAR_TRANSFORM = 131075u, // 131075
AINFO_CHANNEL_NONLINEAR_MAP = 131076u, // 131076
AINFO_CHANNEL_RESAMPLER = 131077u, // 131077
AINFO_LOCAL_GEOMAGNETIC_FIELD = 196608u, // 0x30000
AINFO_LOCAL_GRAVITY = 196609u, // 196609
AINFO_DOCK_STATE = 196610u, // 196610
AINFO_HIGH_PERFORMANCE_MODE = 196611u, // 196611
AINFO_MAGNETIC_FIELD_CALIBRATION = 196612u, // 196612
AINFO_CUSTOM_START = 268435456u, // 0x10000000
AINFO_DEBUGGING_START = 1073741824u, // 0x40000000
};
struct AdditionalInfo {
union Payload {
int32_t data_int32[14] ALIGNED(4);
float data_float[14] ALIGNED(4);
} ALIGNED(4);
static_assert(sizeof(AdditionalInfo::Payload) == 56, "wrong size");
AdditionalInfoType type ALIGNED(4);
int32_t serial ALIGNED(4);
AdditionalInfo::Payload u ALIGNED(4);
} ALIGNED(4);
static_assert(sizeof(AdditionalInfo) == 64, "wrong size");
union SensorEventPayload {
Vec3 vec3 ALIGNED(4);
Vec4 vec4 ALIGNED(4);
Uncal uncal ALIGNED(4);
MetaData meta ALIGNED(4);
float scalar ALIGNED(4);
uint64_t stepCount ALIGNED(8);
HeartRate heartRate ALIGNED(4);
float pose6DOF[15] ALIGNED(4);
Dynamicsensor_t dynamic ALIGNED(4);
AdditionalInfo additional ALIGNED(4);
float data[16] ALIGNED(4);
} ALIGNED(8);
static_assert(sizeof(SensorEventPayload) == 64, "wrong size");
struct sensors_event_t {
int64_t timestamp ALIGNED(8);
int32_t sensor ALIGNED(4);
int32_t type ALIGNED(4);
SensorEventPayload u ALIGNED(8);
} ALIGNED(8);
static_assert(sizeof(sensors_event_t) == 80, "wrong size");
enum class RateLevel : int32_t {
STOP = 0,
NORMAL = 1,
FAST = 2,
VERY_FAST = 3,
};
enum class SensorsEventFormatOffset : uint16_t {
SIZE_FIELD = 0, // 0x0
REPORT_TOKEN = 4, // 0x4
SENSOR_TYPE = 8, // 0x8
ATOMIC_COUNTER = 12, // 0xC
TIMESTAMP = 16, // 0x10
DATA = 24, // 0x18
RESERVED = 88, // 0x58
TOTAL_LENGTH = 104, // 0x68
};
#endif // HYBRIS_BINDER_TYPES_H
......@@ -35,7 +35,8 @@ const char* DeclinationFilter::declinationKey = "/system/osso/location/settings/
DeclinationFilter::DeclinationFilter() :
Filter<CompassData, DeclinationFilter, CompassData>(this, &DeclinationFilter::correct),
declinationCorrection_(0)
declinationCorrection_(0),
lastUpdate_(0)
{
updateInterval_ = SensorFrameworkConfig::configuration()->value<quint64>("compass/declination_update_interval", 1000 * 60 * 60) * 1000;
loadSettings();
......
Name: hybris-libsensorfw-qt5-binder
Provides: hybris-libsensorfw-qt5 = %{version}-%{release}
Conflicts: hybris-libsensorfw-qt5-hal
Obsoletes: hybris-libsensorfw-qt5 < %{version}-%{release}
BuildRequires: pkgconfig(libgbinder)
# additional parameters for qmake
%define qmake_extra_parameters CONFIG+=binder
%include rpm/sensorfw-qt5-hybris.inc
Summary: Sensor Framework Qt5
Version: 0.10.9
Release: 0
Group: System/Sensor Framework
License: LGPLv2+
URL: http://gitorious.org/sensorfw
Source0: %{name}-%{version}.tar.bz2
# Eventhough this is not really needed we have this here
# as this is added to packaging dir by tar_git.
Source2: sensorfwd.service
Requires: sensord-qt5
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Test)
BuildRequires: pkgconfig(mlite5)
BuildRequires: pkgconfig(sensord-qt5)
Obsoletes: %{name}-configs <= 0.8.17
%description
Sensor Framework provides an interface to hardware sensor drivers through logical sensors. This package contains sensor framework daemon and required libraries.
%package devel
Summary: Sensor framework daemon libraries development headers
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: qt5-qtcore-devel
Requires: qt5-qtdbus-devel
Requires: qt5-qtnetwork-devel
%description devel
Development headers for sensor framework daemon and libraries.
%prep
%setup -q -n %{name}-%{version}
%build
unset LD_AS_NEEDED
export LD_RUN_PATH=/usr/lib/sensord-qt5/
export QT_SELECT=5
%qmake5 CONFIG+=hybris %{qmake_extra_parameters} PC_VERSION=`echo %{version} | sed 's/+.*//'`
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
export QT_SELECT=5
%qmake5_install
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files
%defattr(-,root,root,-)
%{_libdir}/libhybrissensorfw*.so.*
%{_libdir}/libhybrissensorfw*.so
%{_libdir}/sensord-qt5/*.so
%files devel
%defattr(-,root,root,-)
%{_includedir}/sensord-qt5/*
Name: hybris-libsensorfw-qt5
Summary: Sensor Framework Qt5
Version: 0.10.9
Release: 0
Group: System/Sensor Framework
License: LGPLv2+