Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[buteo-mtp] Use systemd macro and QT_INSTALL_LIBS Contributes JB#50027
Make MTP_PLUGINDIR respect _libdir too.

Signed-off-by: David Greaves <david.greaves@jolla.com>
  • Loading branch information
lbt authored and Matti Kosola committed Jun 24, 2020
1 parent 87b68a4 commit ae16e41
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion init/systemd/buteo-mtp.service
Expand Up @@ -4,7 +4,7 @@ Description=MTP service
[Service]
EnvironmentFile=-/etc/sysconfig/buteo-mtp
EnvironmentFile=-/var/lib/environment/buteo-mtp/*.conf
ExecStart=/usr/lib/mtp/mtp_service $SERVICE_PARAMETERS
ExecStart=/usr/libexec/mtp_service $SERVICE_PARAMETERS
Restart=always
RestartSec=1
Nice=-10
8 changes: 4 additions & 4 deletions libmeegomtp.pro
@@ -1,20 +1,20 @@
TEMPLATE = subdirs

# "/usr/lib/libmeegomtp.so" - shared library, mtp responder logic
# "/usr/lib*/libmeegomtp.so" - shared library, mtp responder logic
mts.subdir = mts
mts.target = sub-mts

# "/usr/lib/buteo-plugins-qt5/libmptserver.so" - plugin used by msyncd
# "/usr/lib*/buteo-plugins-qt5/libmptserver.so" - plugin used by msyncd
mtpserver.subdir = mtpserver
mtpserver.target = sub-mtpserver
mtpserver.depends = sub-mts

# "/usr/lib/mtp/libfsstorage.so" - plugin used by "libmeegomtp.so"
# "/usr/lib*/mtp/libfsstorage.so" - plugin used by "libmeegomtp.so"
mts_fsstorage_plugin.subdir = mts/platform/storage/fsstorageplugin
mts_fsstorage_plugin.target = sub-mts-fsstorage-plugin
mts_fsstorage_plugin.depends = sub-mts

# "/usr/lib/mtp/mtp_service" - standalone mtp daemon (and env scripts)
# "/usr/libexec/mtp_service" - standalone mtp daemon (and env scripts)
service.subdir = service
service.target = sub-service
service.depends = sub-mts
Expand Down
2 changes: 1 addition & 1 deletion mtpserver/mtpserver.pro
Expand Up @@ -19,7 +19,7 @@ SOURCES += mtpserver.cpp
QMAKE_CLEAN += $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)

#install
target.path = /usr/lib/buteo-plugins-qt5
target.path = $$[QT_INSTALL_LIBS]/buteo-plugins-qt5
server.path = /etc/buteo/profiles/server
server.files = mtp.xml

Expand Down
1 change: 1 addition & 0 deletions mts/common.pri
@@ -1,2 +1,3 @@
CONFIG += link_pkgconfig
PKGCONFIG += systemsettings
DEFINES += MTP_PLUGINDIR=\\\"$$[QT_INSTALL_LIBS]/mtp\\\"
2 changes: 1 addition & 1 deletion mts/mts.pro
Expand Up @@ -84,7 +84,7 @@ SOURCES += mts.cpp \
transport/usb/descriptor.c \
transport/usb/threadio.cpp

target.path = /usr/lib/
target.path = $$[QT_INSTALL_LIBS]/
INSTALLS += target

headers.path = /usr/include/libmeegomtp
Expand Down
2 changes: 1 addition & 1 deletion mts/platform/storage/fsstorageplugin/fsstorageplugin.pro
Expand Up @@ -47,7 +47,7 @@ LIBPATH += ../../..
LIBS += -lmeegomtp -lssu

#install
target.path = /usr/lib/mtp
target.path = $$[QT_INSTALL_LIBS]/mtp

configuration.path = /etc/fsstorage.d
configuration.files = phone-memory.xml homedir-blacklist.conf sd-card.xml
Expand Down
2 changes: 1 addition & 1 deletion mts/platform/storage/storagefactory.h
Expand Up @@ -47,7 +47,7 @@ namespace meegomtp1dot0
class StoragePlugin;
class ObjectPropertyCache;

const QString pluginLocation = "/usr/lib/mtp";
const QString pluginLocation = MTP_PLUGINDIR;
const QString CREATE_STORAGE_PLUGINS = "createStoragePlugins";
const QString DESTROY_STORAGE_PLUGIN = "destroyStoragePlugin";

Expand Down
6 changes: 2 additions & 4 deletions rpm/buteo-mtp-qt5.spec
Expand Up @@ -2,7 +2,6 @@ Name: buteo-mtp-qt5
Version: 0.7.1
Release: 1
Summary: MTP library
Group: System/Libraries
License: BSD and LGPLv2
URL: https://git.sailfishos.org/mer-core/buteo-mtp
Source0: %{name}-%{version}.tar.gz
Expand Down Expand Up @@ -40,9 +39,10 @@ Obsoletes: buteo-mtp < %{version}
%defattr(-,root,root,-)
%{_unitdir}/*.mount
%{_unitdir}/local-fs.target.wants/*.mount
%{_libexecdir}/mtp_service
%{_libdir}/*.so.*
%{_libdir}/mtp
%{_libdir}/systemd/user/buteo-mtp.service
%{_userunitdir}/buteo-mtp.service
%{_datadir}/mapplauncherd/privileges.d/*
# Own the fstorage.d and mtp data directories.
%dir %{_sysconfdir}/fsstorage.d
Expand All @@ -68,7 +68,6 @@ Provides: mtp-vendor-configuration

%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
Expand All @@ -94,7 +93,6 @@ Summary: MTP plugin for buteo-sync

%package tests
Summary: Tests for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Conflicts: buteo-mtp-tests

Expand Down
2 changes: 1 addition & 1 deletion service/service.pro
Expand Up @@ -17,7 +17,7 @@ PKGCONFIG += mlite5
SOURCES += service.cpp

#install
target.path += /usr/lib/mtp/
target.path += $$[QT_INSTALL_PREFIX]/libexec/
target.files = mtp_service
desktop.path = /etc/xdg/autostart
desktop.files = buteo-mtp.desktop
Expand Down

0 comments on commit ae16e41

Please sign in to comment.