Skip to content

Commit

Permalink
change default library target to -qt5. but not sensord
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorn Potter committed Apr 23, 2013
1 parent fd116bc commit 4f7bd47
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 25 deletions.
4 changes: 4 additions & 0 deletions common-config.pri
Expand Up @@ -28,3 +28,7 @@ profile {
profile-libc {
QMAKE_LFLAGS += -lc_p
}

equals(QT_MAJOR_VERSION, 5):{
TARGET = $$TARGET-qt5
}
11 changes: 9 additions & 2 deletions common-install.pri
Expand Up @@ -8,10 +8,17 @@
QT -= gui

# Path for headers - remember to add files if they should be installed
publicheaders.path = /usr/include/sensord
equals(QT_MAJOR_VERSION, 4): {
publicheaders.path = /usr/include/sensord
PLUGINPATH = /usr/lib/sensord
}

equals(QT_MAJOR_VERSION, 5): {
publicheaders.path = /usr/include/sensord-qt5
PLUGINPATH = /usr/lib/sensord-qt5
}

# Path for shared libraries
SHAREDLIBPATH = /usr/lib
PLUGINPATH = /usr/lib/sensord

INSTALLS += publicheaders
10 changes: 7 additions & 3 deletions qt-api/qt-api.pro
@@ -1,5 +1,6 @@
QT += network
TARGET = sensorclient

TEMPLATE = lib

include( ../common-config.pri )
Expand Down Expand Up @@ -37,9 +38,12 @@ SENSORFW_INCLUDEPATHS = .. \
../datatypes
DEPENDPATH += $$SENSORFW_INCLUDEPATHS
INCLUDEPATH += $$SENSORFW_INCLUDEPATHS

QMAKE_LIBDIR_FLAGS += -L../datatypes -lsensordatatypes

equals(QT_MAJOR_VERSION, 4): {
QMAKE_LIBDIR_FLAGS += -L../datatypes -lsensordatatypes
}
equals(QT_MAJOR_VERSION, 5): {
QMAKE_LIBDIR_FLAGS += -L../datatypes -lsensordatatypes-qt5
}
include(../common-install.pri)
publicheaders.files = $$HEADERS
target.path = $$SHAREDLIBPATH
Expand Down
18 changes: 9 additions & 9 deletions rpm/sensorfw-qt5.spec
Expand Up @@ -3,12 +3,12 @@
# Generated by: spectacle version 0.25
#

Name: sensorfw
Name: sensorfw-qt5

# >> macros
# << macros

Summary: Sensor Framework
Summary: Sensor Framework Qt5
Version: 0.7.2.2
Release: 0
Group: System/Sensor Framework
Expand All @@ -18,8 +18,8 @@ Source0: %{name}-%{version}.tar.bz2
Source1: sensorfw-rpmlintrc
Source2: sensord.service
Source3: sensord-daemon-conf-setup
Source100: sensorfw.yaml
Requires: qt
Source100: sensorfw-qt5.yaml
Requires: qt5-qtcore
Requires: GConf-dbus
Requires: %{name}-configs
Requires: systemd
Expand All @@ -28,7 +28,7 @@ Requires(post): /sbin/ldconfig
Requires(post): systemd
Requires(postun): /sbin/ldconfig
Requires(postun): systemd
BuildRequires: pkgconfig(QtCore)
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(gconf-2.0)
BuildRequires: pkgconfig(contextprovider-1.0)
Obsoletes: sensorframework
Expand Down Expand Up @@ -101,7 +101,7 @@ export LD_RUN_PATH=/usr/lib/sensord/
# << build pre

%qmake \
CONFIG+=mce_disable
CONFIG+=contextprovider

make %{?jobs:-j%jobs}

Expand Down Expand Up @@ -145,7 +145,7 @@ systemctl daemon-reload
%{_libdir}/*.so.*
%config %{_sysconfdir}/dbus-1/system.d/sensorfw.conf
%config %{_sysconfdir}/sensorfw/sensord.conf
%dir %{_sysconfdir}/%{name}/sensord.conf.d/
%dir %{_sysconfdir}/sensorfw/sensord.conf.d/
%{_datadir}/contextkit/providers/com.nokia.SensorService.context
%doc debian/copyright debian/README COPYING
/%{_lib}/systemd/system/sensord.service
Expand Down Expand Up @@ -185,7 +185,7 @@ systemctl daemon-reload
%files configs
%defattr(-,root,root,-)
# >> files configs
%config %{_sysconfdir}/%{name}/sensord.conf.d/*conf
%config %{_sysconfdir}/%{name}/*conf
%config %{_sysconfdir}/sensorfw/sensord.conf.d/*conf
%config %{_sysconfdir}/sensorfw/*conf
%exclude %{_sysconfdir}/sensorfw/sensord.conf
# << files configs
6 changes: 3 additions & 3 deletions rpm/sensorfw-qt5.yaml
Expand Up @@ -13,12 +13,12 @@ Sources:
- "sensord.service"
- "sensord-daemon-conf-setup"
Requires:
- qt
- qt5-qtcore
- GConf-dbus
- "%{name}-configs"

PkgConfigBR:
- QtCore
- Qt5Core
- gconf-2.0
- contextprovider-1.0

Expand All @@ -34,7 +34,7 @@ Builder: qmake
UseAsNeeded: no

QMakeOptions:
- "CONFIG+=mce_disable"
- "CONFIG+=contextprovider"

SubPackages:
- Name: devel
Expand Down
26 changes: 25 additions & 1 deletion rpm/sensorfw.spec
Expand Up @@ -87,6 +87,19 @@ Provides: config-u8500
Sensorfw configuration files.


%package qt4-compat
Summary: Compatibiliy package for Qt 5 Sensorfw
Group: System/Libraries
Requires: sensorfw-qt5
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
Provides: sensorfw
Obsoletes: sensorfw

%description qt4-compat
Provides Qt 4 compatibility for Qt 5 Sensorfw files.



%prep
%setup -q -n %{name}-%{version}
Expand All @@ -101,7 +114,7 @@ export LD_RUN_PATH=/usr/lib/sensord/
# << build pre

%qmake \
CONFIG+=mce_disable
CONFIG+=contextprovider

make %{?jobs:-j%jobs}

Expand Down Expand Up @@ -137,6 +150,10 @@ systemctl reload-or-try-restart sensord.service
/sbin/ldconfig
systemctl daemon-reload

%post qt4-compat -p /sbin/ldconfig

%postun qt4-compat -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
# >> files
Expand Down Expand Up @@ -189,3 +206,10 @@ systemctl daemon-reload
%config %{_sysconfdir}/%{name}/*conf
%exclude %{_sysconfdir}/sensorfw/sensord.conf
# << files configs

%files qt4-compat
%defattr(-,root,root,-)
%{_libdir}/libsensorclient.so*
%{_libdir}/libsensordatatypes.so*
# >> files qt4-compat
# << files qt4-compat
20 changes: 19 additions & 1 deletion rpm/sensorfw.yaml
Expand Up @@ -34,7 +34,7 @@ Builder: qmake
UseAsNeeded: no

QMakeOptions:
- "CONFIG+=mce_disable"
- "CONFIG+=contextprovider"

SubPackages:
- Name: devel
Expand Down Expand Up @@ -87,3 +87,21 @@ SubPackages:
- config-oemtablet
- config-oaktraili
- config-u8500

- Name: qt4-compat
Group: System/Libraries
Summary: Compatibiliy package for Qt 5 Sensorfw
Description: |
Provides Qt 4 compatibility for Qt 5 Sensorfw files.
AutoDepend: no
Obsoletes:
- sensorfw
Provides:
- sensorfw
Requires:
- sensorfw-qt5
Files:
- "%{_libdir}/libsensorclient.so*"
- "%{_libdir}/libsensordatatypes.so*"


10 changes: 10 additions & 0 deletions sensord-qt5.pc
@@ -0,0 +1,10 @@
prefix=/usr
includedir=${prefix}/include/sensord
libdir=${prefix}/lib/

Name: Sensord-qt5
Description: Sensord for Qt 5
Version: 0.7.2.1
Requires:
Libs: -L${libdir} -lsensorclient-qt5 -lsensordatatypes-qt5
Cflags: -I${includedir} -I${includedir}/datatypes -I${includedir}/filters
10 changes: 9 additions & 1 deletion sensord.prf
@@ -1,3 +1,11 @@
LIBS += -L/usr/lib/ -lsensorclient -lsensordatatypes

equals(QT_MAJOR_VERSION, 4):{
LIBS += -L/usr/lib/ -lsensorclient -lsensordatatypes
}

equals(QT_MAJOR_VERSION, 5):{
LIBS += -L/usr/lib/ -lsensorclient-qt5 -lsensordatatypes-qt5
}

DEPENDPATH += /usr/include/sensord
INCLUDEPATH += /usr/include/sensord /usr/include/sensord/datatypes /usr/include/sensord/filters
14 changes: 11 additions & 3 deletions sensord/sensord.pro
@@ -1,9 +1,10 @@
QT += network

TEMPLATE = app
TARGET = sensord

include( ../common-config.pri )
#don't change target name in qt5
TARGET = sensord

CONFIG += console \
link_pkgconfig
Expand All @@ -18,9 +19,16 @@ SENSORFW_INCLUDEPATHS = .. \
DEPENDPATH += $$SENSORFW_INCLUDEPATHS
INCLUDEPATH += $$SENSORFW_INCLUDEPATHS

QMAKE_LIBDIR_FLAGS += -L../datatypes -lsensordatatypes \
-L../core -lsensorfw
QMAKE_LIBDIR_FLAGS += -L../datatypes \
-L../core

equals(QT_MAJOR_VERSION, 4):{
QMAKE_LIBDIR_FLAGS += -lsensordatatypes -lsensorfw
}
equals(QT_MAJOR_VERSION, 5):{
QMAKE_LIBDIR_FLAGS += -lsensordatatypes-qt5 -lsensorfw-qt5

}
QMAKE_RPATHDIR += /usr/lib/sensord

SOURCES += main.cpp \
Expand Down
13 changes: 11 additions & 2 deletions sensorfw.pro
Expand Up @@ -17,14 +17,23 @@ sensord.depends = datatypes adaptors sensors chains
include( common-install.pri )
include( common-config.pri )

PKGCONFIGFILES.files = sensord.pc
equals(QT_MAJOR_VERSION, 4):{
PKGCONFIGFILES.files = sensord.pc
QTCONFIGFILES.path = /usr/share/qt4/mkspecs/features
}

equals(QT_MAJOR_VERSION, 5):{
PKGCONFIGFILES.files = sensord-qt5.pc
QTCONFIGFILES.path = /usr/share/qt5/mkspecs/features

}

PKGCONFIGFILES.path = /usr/lib/pkgconfig

# How to make this work in all cases?
#PKGCONFIGFILES.commands = sed -i \"s/Version:.*$$/Version: `head -n1 debian/changelog | cut -f 2 -d\' \' | tr -d \'()\'`/\" sensord.pc

QTCONFIGFILES.files = sensord.prf
QTCONFIGFILES.path = /usr/share/qt4/mkspecs/features

DBUSCONFIGFILES.files = sensorfw.conf
DBUSCONFIGFILES.path = /etc/dbus-1/system.d
Expand Down

0 comments on commit 4f7bd47

Please sign in to comment.