# Copyright 2019 cruzall developers
# Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

SET(CPACK_PACKAGE_NAME "cruzall")
SET(CPACK_PACKAGE_VERSION "1.0.18")
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "0")
SET(CPACK_PACKAGE_VERSION_PATCH "18")
SET(CPACK_PACKAGE_CONTACT "Green Appers Support <support@greenappers.com>")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open-source HD wallet for CRUZ cryptocurrency")
SET(CPACK_PACKAGE_DESCRIPTION "")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
SET(CPACK_STRIP_FILES ON)
SET(CPACK_DEBIAN_PACKAGE_SECTION misc)
SET(CPACK_DEBIAN_PACKAGE_PRIORITY extra)
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE https://www.greenappers.com/cruzall/)
SET(CPACK_DEBIAN_PACKAGE_REPLACES Cruzall)
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
SET(CPACK_DEBIAN_PACKAGE_RELEASE 1)
SET(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
SET(CPACK_RPM_FILE_NAME RPM-DEFAULT)
SET(CPACK_RPM_PACKAGE_LICENSE MIT)
SET(CPACK_RPM_PACKAGE_URL ${CPACK_DEBIAN_PACKAGE_HOMEPAGE})
SET(CPACK_RPM_PACKAGE_OBSOLETES ${CPACK_DEBIAN_PACKAGE_REPLACES})
SET(CPACK_RPM_PACKAGE_AUTOREQ ON)
SET(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
SET(CPACK_RPM_PACKAGE_RELEASE_DIST ON)
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
    /usr/share/applications
    /usr/share/icons
    /usr/share/icons/hicolor
    /usr/share/icons/hicolor/scalable
    /usr/share/icons/hicolor/scalable/apps)

if("$ENV{OS}" STREQUAL "ubuntu" OR "$ENV{OS}" STREQUAL "debian")
  set(CPACK_GENERATOR DEB)
  set(CPACK_DEBIAN_PACKAGE_RELEASE "${CPACK_DEBIAN_PACKAGE_RELEASE}~$ENV{DIST}")
  set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-1.$ENV{DIST}_amd64.deb")
elseif("$ENV{OS}" STREQUAL "centos")
  set(CPACK_GENERATOR RPM)
  string(REGEX REPLACE "\\..*" "" CPACK_RPM_PACKAGE_RELEASE_DIST "$ENV{DIST}")
  set(CPACK_RPM_PACKAGE_RELEASE_DIST ".el${CPACK_RPM_PACKAGE_RELEASE_DIST}.centos")
  set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-1.${CPACK_PACKAGE_VERSION}.x86_64.rpm")
endif()

set(CPACK_INSTALLED_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/cruzall/build/linux/release" "usr/share/cruzall")

