diff --git a/cmake/cpack_deb.cmake b/cmake/cpack_deb.cmake deleted file mode 100644 index c4e8db08..00000000 --- a/cmake/cpack_deb.cmake +++ /dev/null @@ -1,100 +0,0 @@ -# required for DEB-DEFAULT to work as intended -cmake_minimum_required(VERSION 3.6) - -# Fix for https://github.com/TheAssassin/AppImageLauncher/issues/28 -execute_process( - COMMAND lsb_release -c - OUTPUT_VARIABLE _lsb_release_output -) - -if(_lsb_release_output MATCHES bionic) - message(STATUS "platform is bionic, enabling compatibility mode for CPack Debian packaging") - set(_compatibility_level bionic) -elseif(_lsb_release_output MATCHES cosmic) - message(STATUS "platform is cosmic, enabling compatibility mode for CPack Debian packaging") - set(_compatibility_level cosmic) -elseif(_lsb_release_output MATCHES disco) - message(STATUS "platform is disco, enabling compatibility mode for CPack Debian packaging") - set(_compatibility_level disco) -elseif(_lsb_release_output MATCHES eoan) - message(STATUS "platform is eoan, enabling compatibility mode for CPack Debian packaging") - set(_compatibility_level eoan) -else() - set(_compatibility_level "") -endif() - -set(CPACK_DEBIAN_COMPATIBILITY_LEVEL ${_compatibility_level} CACHE STRING "Available values: bionic (Ubuntu 18.04 LTS), cosmic (Ubuntu 18.10), disco (Ubuntu 19.04), eoan (Ubuntu 19.10)") - -unset(_lsb_release_output) -unset(_compatibility_level) - -# allow building Debian packages on non-Debian systems -if(DEFINED ENV{ARCH}) - set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE $ENV{ARCH}) - if(CPACK_DEBIAN_PACKAGE_ARCHITECTURE MATCHES "i686") - set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386") - elseif(CPACK_DEBIAN_PACKAGE_ARCHITECTURE MATCHES "x86_64") - set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") - elseif(CPACK_DEBIAN_PACKAGE_ARCHITECTURE MATCHES "aarch64") - set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64") - endif() -endif() - -# make sure to package components separately -#set(CPACK_DEB_PACKAGE_COMPONENT ON) -set(CPACK_DEB_COMPONENT_INSTALL ON) - -# override default package naming -set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) - -# Debian packaging global options -set(CPACK_DEBIAN_COMPRESSION_TYPE xz) - -# use git hash as package release -set(CPACK_DEBIAN_PACKAGE_RELEASE "${APPIMAGELAUNCHER_GIT_COMMIT}") - -# append build ID, similar to AppImage naming -if(DEFINED ENV{GITHUB_RUN_NUMBER}) - set(CPACK_DEBIAN_PACKAGE_RELEASE "gha$ENV{GITHUB_RUN_NUMBER}~${CPACK_DEBIAN_PACKAGE_RELEASE}") -else() - set(CPACK_DEBIAN_PACKAGE_RELEASE "local~${CPACK_DEBIAN_PACKAGE_RELEASE}") -endif() - -if(CPACK_DEBIAN_COMPATIBILITY_LEVEL) - set(CPACK_DEBIAN_PACKAGE_RELEASE "${CPACK_DEBIAN_PACKAGE_RELEASE}+${CPACK_DEBIAN_COMPATIBILITY_LEVEL}") -endif() - -# bash is required to run install hooks -set(CPACK_DEBIAN_APPIMAGELAUNCHER_PACKAGE_PREDEPENDS bash) - -# package name -set(CPACK_DEBIAN_APPIMAGELAUNCHER_PACKAGE_NAME "appimagelauncher") - -# TODO: packagers watch out: you should set this to depend on a libappimage package, and avoid installing the library -# to a custom location in install.cmake - -if(CPACK_DEBIAN_COMPATIBILITY_LEVEL STREQUAL "bionic" OR CPACK_DEBIAN_COMPATIBILITY_LEVEL STREQUAL "cosmic" OR CPACK_DEBIAN_COMPATIBILITY_LEVEL STREQUAL "disco" OR CPACK_DEBIAN_COMPATIBILITY_LEVEL STREQUAL "eoan") - set(CPACK_DEBIAN_APPIMAGELAUNCHER_PACKAGE_DEPENDS "libqt5dbus5 (>= 5.9), libqt5widgets5 (>= 5.2.1), libqt5gui5 (>= 5.2.1), libqt5core5a (>= 5.2.1), binfmt-support (>= 2.0), systemd, libcurl4") -else() - set(CPACK_DEBIAN_APPIMAGELAUNCHER_PACKAGE_DEPENDS "libqt5dbus5 (>= 5.2.1), libqt5widgets5 (>= 5.2.1), libqt5gui5 (>= 5.2.1), libqt5core5a (>= 5.2.1), binfmt-support (>= 2.0), systemd, libcurl3") -endif() - -# improve dependency list -set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) - -# add postinst and prerm hooks to Debian package -configure_file( - ${PROJECT_SOURCE_DIR}/resources/install-scripts/post-install.in - ${PROJECT_BINARY_DIR}/cmake/debian/postinst - @ONLY -) -configure_file( - ${PROJECT_SOURCE_DIR}/resources/install-scripts/post-uninstall.in - ${PROJECT_BINARY_DIR}/cmake/debian/postrm - @ONLY -) - -set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA - "${PROJECT_BINARY_DIR}/cmake/debian/postinst" - "${PROJECT_BINARY_DIR}/cmake/debian/postrm" -) diff --git a/cmake/cpack_general.cmake b/cmake/cpack_general.cmake deleted file mode 100644 index e9071378..00000000 --- a/cmake/cpack_general.cmake +++ /dev/null @@ -1,26 +0,0 @@ -# general CPack options - -set(PROJECT_VERSION ${APPIMAGELAUNCHER_VERSION}) -set(CPACK_GENERATOR "DEB") - -# make sure to only package APPIMAGELAUNCHER component -set(CPACK_COMPONENTS_ALL APPIMAGELAUNCHER APPIMAGELAUNCHER_CLI) -# package them all in a single package, otherwise cpack would generate one package per component by default -# https://cmake.org/cmake/help/v3.0/module/CPackComponent.html#variable:CPACK_COMPONENTS_GROUPING -set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE) - -# global options -set(CPACK_PACKAGE_CONTACT "TheAssassin") -set(CPACK_PACKAGE_HOMEPAGE "https://github.com/TheAssassin/AppImageLauncher") -set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt") - -# versioning -# it appears setting CPACK_DEBIAN_PACKAGE_VERSION doesn't work, hence setting CPACK_PACKAGE_VERSION -set(CPACK_PACKAGE_VERSION ${APPIMAGELAUNCHER_VERSION}) - -# TODO: insert some useful description -set(CPACK_COMPONENT_APPIMAGELAUNCHER_PACKAGE_DESCRIPTION "AppImageLauncher") - -# find more suitable section for package -set(CPACK_COMPONENT_APPIMAGELAUNCHER_PACKAGE_SECTION misc) diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake deleted file mode 100644 index d01b8499..00000000 --- a/cmake/cpack_rpm.cmake +++ /dev/null @@ -1,74 +0,0 @@ -# required for RPM-DEFAULT to work as intended -cmake_minimum_required(VERSION 3.6) - -# allow building RPM packages on non-RPM systems -if(DEFINED ENV{ARCH}) - set(CPACK_RPM_PACKAGE_ARCHITECTURE $ENV{ARCH}) - if(CPACK_RPM_PACKAGE_ARCHITECTURE MATCHES "i686") - set(CPACK_RPM_PACKAGE_ARCHITECTURE "i386") - elseif(CPACK_RPM_PACKAGE_ARCHITECTURE MATCHES "amd64") - set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64") - elseif(CPACK_RPM_PACKAGE_ARCHITECTURE MATCHES "arm64") - set(CPACK_RPM_PACKAGE_ARCHITECTURE "aarch64") - endif() -endif() - -# override default package naming -set(CPACK_RPM_FILE_NAME RPM-DEFAULT) - -# make sure to package components separately -#set(CPACK_DEB_PACKAGE_COMPONENT ON) -set(CPACK_RPM_COMPONENT_INSTALL ON) - -# RPM packaging global options -set(CPACK_RPM_COMPRESSION_TYPE xz) - -# use git hash as package release -set(CPACK_RPM_PACKAGE_RELEASE "${APPIMAGELAUNCHER_GIT_COMMIT}") - -# append build ID, similar to AppImage naming -if(DEFINED ENV{GITHUB_RUN_NUMBER}) - set(CPACK_RPM_PACKAGE_RELEASE "gha$ENV{GITHUB_RUN_NUMBER}~${CPACK_RPM_PACKAGE_RELEASE}") -else() - set(CPACK_RPM_PACKAGE_RELEASE "local~${CPACK_RPM_PACKAGE_RELEASE}") -endif() - -# bash is required to run install hooks -set(CPACK_RPM_APPIMAGELAUNCHER_REQUIRES_PRE "bash") - -# package name -set(CPACK_RPM_APPIMAGELAUNCHER_PACKAGE_NAME "appimagelauncher") - -# TODO: packagers watch out: you should set this to depend on a libappimage package, and avoid installing the library -# to a custom location in install.cmake -set(CPACK_RPM_APPIMAGELAUNCHER_PACKAGE_DREQUIRES "pkgconfig(Qt5Widgets) (>= 5.2.1), pkgconfig(Qt5Gui) (>= 5.2.1), pkgconfig(Qt5Core) (>= 5.2.1), libcurl4") -# deactivate automatic generation of dependency list -# it wants to add libappimage.so to the list of dependencies, which is actually shipped by the package -set(CPACK_RPM_PACKAGE_AUTOREQ OFF) - -# avoid conflicts with the filesystem package -set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION - /usr/share/applications - /usr/lib/binfmt.d - /usr/lib/systemd - /usr/lib/systemd/user - /usr/share/man - /usr/share/man/man1 - /usr/share/mime - /usr/share/mime/packages -) - -# add postinst and prerm hooks to RPM package -configure_file( - ${PROJECT_SOURCE_DIR}/resources/install-scripts/post-install.in - ${PROJECT_BINARY_DIR}/cmake/rpm/post-install - @ONLY -) -configure_file( - ${PROJECT_SOURCE_DIR}/resources/install-scripts/post-uninstall.in - ${PROJECT_BINARY_DIR}/cmake/rpm/post-uninstall - @ONLY -) - -set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${PROJECT_BINARY_DIR}/cmake/rpm/post-install") -set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${PROJECT_BINARY_DIR}/cmake/rpm/post-uninstall") diff --git a/cmake/cpack_source.cmake b/cmake/cpack_source.cmake deleted file mode 100644 index 87aeaa13..00000000 --- a/cmake/cpack_source.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# source package options - -# ignore files -# requires four backslashes to escape dots etc., probably because the values are evaluated twice, -# once by CMake and then by CPack -set(CPACK_SOURCE_IGNORE_FILES - # warning: the following pattern requires at least 6 characters before the "build" part to work as intended - "([^t][^r][^a][^v][^i][^s])/.*build.*/" - "/.*-prefix/" - "\\\\..*AppImage$" - "\\\\..*AppImage\\\\..*$" - "\\\\..*zs-old.*$" - "\\\\..*tar.*$" - "\\\\..*deb.*$" - "/.git/" - "/.idea/" -) - -# source tarball filename (without extension) -set(CPACK_SOURCE_PACKAGE_FILE_NAME appimagelauncher-${APPIMAGELAUNCHER_GIT_COMMIT}.source) - -# build .tar.xz archives to get the maximum amount of compression and produce small tarballs -set(CPACK_SOURCE_GENERATOR TXZ)