diff --git a/CMakeLists.txt b/CMakeLists.txt index 85d0fe2..5696487 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,12 @@ cmake_minimum_required(VERSION 3.11) -project(deepin-application-manager) +project(dde-application-manager) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) +include(GNUInstallDirs) + #install settings if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX /usr) @@ -23,4 +25,4 @@ endif () # qm files file(GLOB QM_FILES "translations/*.qm") -install(FILES ${QM_FILES} DESTINATION share/dde-application-manager/translations) +install(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/dde-application-manager/translations) diff --git a/misc/CMakeLists.txt b/misc/CMakeLists.txt index 6997f9d..e81f57d 100644 --- a/misc/CMakeLists.txt +++ b/misc/CMakeLists.txt @@ -1,4 +1,3 @@ add_subdirectory(systemd) add_subdirectory(dconf) add_subdirectory(service) - diff --git a/misc/dconf/CMakeLists.txt b/misc/dconf/CMakeLists.txt index 7afaa75..5a5572c 100644 --- a/misc/dconf/CMakeLists.txt +++ b/misc/dconf/CMakeLists.txt @@ -6,4 +6,4 @@ set(DCONFIG_FILES com.deepin.xsettings.json ) -install(FILES ${DCONFIG_FILES} DESTINATION /usr/share/dsg/configs/dde-application-manager) +install(FILES ${DCONFIG_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/dsg/configs/dde-application-manager) diff --git a/misc/service/dde-application-manager.service b/misc/service/dde-application-manager.service index cd02394..a9e8b29 100644 --- a/misc/service/dde-application-manager.service +++ b/misc/service/dde-application-manager.service @@ -1,5 +1,5 @@ [Unit] -Description=dde application manager service +Description=DDE application manager service RefuseManualStart=no RefuseManualStop=no #OnFailure=dde-session-shutdown.target @@ -19,9 +19,8 @@ Before=dde-session-daemon.service [Service] Type=simple -ExecStart=/usr/bin/deepin-application-manager +ExecStart=/usr/bin/dde-application-manager TimeoutStartSec=infinity Slice=components.slice Restart=on-failure RestartSec=300ms - diff --git a/misc/systemd/org.deepin.dde.Application1.Instance@.service b/misc/systemd/org.deepin.dde.Application1.Instance@.service index 7fa9525..efa0a46 100644 --- a/misc/systemd/org.deepin.dde.Application1.Instance@.service +++ b/misc/systemd/org.deepin.dde.Application1.Instance@.service @@ -1,9 +1,9 @@ [Unit] -Description=Deepin Application Loader is managing %I +Description=DDE Application Loader is managing %I [Service] Type=simple Environment="DAM_TASK_HASH=%I" Environment="DAM_TASK_TYPE=freedesktop" -ExecStart=/usr/bin/deepin-application-loader +ExecStart=/usr/bin/dde-application-loader Slice=applications.slice \ No newline at end of file diff --git a/misc/systemd/org.deepin.dde.Application1.Manager.service b/misc/systemd/org.deepin.dde.Application1.Manager.service index bf6af28..3bc0c03 100644 --- a/misc/systemd/org.deepin.dde.Application1.Manager.service +++ b/misc/systemd/org.deepin.dde.Application1.Manager.service @@ -1,8 +1,8 @@ [Unit] -Description=Deepin Application Manager service +Description=DDE Application Manager service [Service] Type=DBus BusName=org.deepin.dde.Application1.Manager -ExecStart=/usr/bin/deepin-application-manager +ExecStart=/usr/bin/dde-application-manager Slice=services.slice \ No newline at end of file diff --git a/src/loader/CMakeLists.txt b/src/loader/CMakeLists.txt index 7758fe6..a96a9d3 100644 --- a/src/loader/CMakeLists.txt +++ b/src/loader/CMakeLists.txt @@ -1,3 +1,5 @@ +set(BIN_NAME dde-application-loader) + pkg_check_modules(LIBCAP REQUIRED IMPORTED_TARGET libcap) set(SRCS @@ -29,12 +31,12 @@ set(SRCS ../modules/util/debug/debug.cpp ) -add_executable(deepin-application-loader ${SRCS}) +add_executable(${BIN_NAME} ${SRCS}) -target_link_libraries(deepin-application-loader +target_link_libraries(${BIN_NAME} pthread PkgConfig::LIBCAP stdc++fs Qt5::Core ) -install(TARGETS deepin-application-loader DESTINATION bin) +install(TARGETS ${BIN_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/src/loader/main.cpp b/src/loader/main.cpp index 23072ea..ee7240c 100644 --- a/src/loader/main.cpp +++ b/src/loader/main.cpp @@ -238,7 +238,7 @@ int main(int argc, char* argv[]) } char socketPath[50]; - sprintf(socketPath, "/run/user/%d/deepin-application-manager.socket", getuid()); + sprintf(socketPath, "/run/user/%d/dde-application-manager.socket", getuid()); // register client and run quitConnect Socket::Client client; diff --git a/src/service/CMakeLists.txt b/src/service/CMakeLists.txt index 2431251..c9698f7 100644 --- a/src/service/CMakeLists.txt +++ b/src/service/CMakeLists.txt @@ -2,6 +2,8 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) +set(BIN_NAME dde-application-manager) + find_package(PkgConfig REQUIRED) find_package(Qt5 REQUIRED COMPONENTS Core DBus Concurrent Gui) find_package(DtkCore REQUIRED) @@ -41,27 +43,27 @@ file(GLOB_RECURSE SRCS "*.h" "*.cpp" "../frameworkdbus/*.h" "../frameworkdbus/*. "../modules/*.h" "../modules/*.cpp" "../modules/*.hpp" "../utils.h" "../utils/*.cpp") -add_executable(deepin-application-manager +add_executable(${BIN_NAME} ${SRCS} ${ADAPTER_SOURCES} ) -target_link_libraries(deepin-application-manager +target_link_libraries(${BIN_NAME} Qt5::Core Qt5::DBus Qt5::Concurrent - ${DtkCore_LIBRARIES} - ${DtkWidget_LIBRARIES} + Qt5::Gui + Dtk::Core pthread PkgConfig::XCB PkgConfig::X11 PkgConfig::GIO PkgConfig::GLib PkgConfig::QGSettings - ${Qt5Gui_LIBRARIES} + ${DtkWidget_LIBRARIES} ) -target_include_directories(deepin-application-manager PUBLIC +target_include_directories(${BIN_NAME} PUBLIC PkgConfig::XCB PkgConfig::X11 PkgConfig::GIO @@ -76,6 +78,6 @@ target_include_directories(deepin-application-manager PUBLIC ) # binary file -install(TARGETS deepin-application-manager DESTINATION bin) +install(TARGETS ${BIN_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) add_definitions(-DQT_NO_KEYWORDS) diff --git a/src/service/impl/application_manager.cpp b/src/service/impl/application_manager.cpp index b195bf9..8c71f5a 100644 --- a/src/service/impl/application_manager.cpp +++ b/src/service/impl/application_manager.cpp @@ -36,7 +36,7 @@ ApplicationManagerPrivate::ApplicationManagerPrivate(ApplicationManager* parent) , section("AppName") , key("support") { - const QString socketPath{QString("/run/user/%1/deepin-application-manager.socket").arg(getuid())}; + const QString socketPath{QString("/run/user/%1/dde-application-manager.socket").arg(getuid())}; connect(&server, &Socket::Server::onReadyRead, this, &ApplicationManagerPrivate::recvClientData, Qt::QueuedConnection); server.listen(socketPath.toStdString()); }