diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 3385f3a..3878d4f 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -14,13 +14,8 @@ jobs: - name: Build run: | export CWD=`pwd` - mkdir $CWD/build-release-qt5 - cd $CWD/build-release-qt5 - cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .. - make - make DESTDIR=`pwd`/pkg install - tree pkg - mkdir $CWD/build-debug-qt5 - cd $CWD/build-debug-qt5 - cmake -DCMAKE_BUILD_TYPE=Debug .. - make + mkdir $CWD/build + cd $CWD/build + cmake -DCMAKE_INSTALL_PREFIX=/usr -DSERVICE_GROUP=plugdev -DCMAKE_BUILD_TYPE=Release .. + make -j2 + cpack -G DEB diff --git a/CMakeLists.txt b/CMakeLists.txt index 9429f75..369d28a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,10 @@ cmake_minimum_required(VERSION 3.0) project(powerkit VERSION 2.0.0 LANGUAGES CXX) + +set(PROJECT_HOMEPAGE_URL "https://github.com/rodlie/powerkit") +set(PROJECT_DESCRIPTION "Power manager for alternative X11 desktop environments and window managers") + set(CMAKE_CXX_STANDARD 11) set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -194,3 +198,24 @@ install(FILES docs/README.md DESTINATION ${CMAKE_INSTALL_DOCDIR}/${PROJECT_NAME}-${PROJECT_VERSION}) + +# package +set(CPACK_SET_DESTDIR ON) +set(CPACK_PACKAGE_CONTACT ${PROJECT_HOMEPAGE_URL}) +set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") +set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") +set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") +set(CPACK_PACKAGE_NAME ${PROJECT_NAME}) +set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION}) +set(CPACK_PACKAGE_VENDOR ${PROJECT_NAME}) +set(CPACK_STRIP_FILES TRUE) + +set(CPACK_RPM_SPEC_MORE_DEFINE "%define _build_id_links none") +set(CPACK_RPM_PACKAGE_LICENSE "BSD") +set(CPACK_RPM_PACKAGE_URL ${PROJECT_HOMEPAGE_URL}) + +set(CPACK_DEBIAN_PACKAGE_DEPENDS "xsecurelock") +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) +set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${PROJECT_HOMEPAGE_URL}) + +include(CPack)