Source

gSharkDown / CMakeLists.txt

Full commit
project("gsharkdown")
cmake_minimum_required(VERSION 2.8)

#
# Application information
# 
set(PACKAGE_NAME ${PROJECT_NAME})
set(PACKAGE_VERSION_MAJOR "0")
set(PACKAGE_VERSION_MINOR "6")
set(PACKAGE_VERSION_PATCH "5")
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
set (GETTEXT_PACKAGE ${PROJECT_NAME})

file(WRITE "VERSION" ${PACKAGE_VERSION})

#
# Install data and lib
# 
install (DIRECTORY data DESTINATION "share/gsharkdown")
install (DIRECTORY lib DESTINATION "share/gsharkdown")
install (FILES gsharkdown.py VERSION HELP DESTINATION "share/gsharkdown")

install(CODE "execute_process(COMMAND ./build.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/po)")
install (DIRECTORY locale DESTINATION "share" FILES_MATCHING PATTERN "gsharkdown.mo")

#
# Install internationalized desktop file
# 
install(CODE "message (STATUS \"Generating translated gsharkdown.desktop\")")
install(CODE "execute_process(COMMAND intltool-merge -d po \"${CMAKE_SOURCE_DIR}/gsharkdown.desktop.in\" \"${CMAKE_BINARY_DIR}/gsharkdown.desktop\" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_QUIET)")
install(FILES ${CMAKE_BINARY_DIR}/gsharkdown.desktop DESTINATION "share/applications")

#
# Generate and install shell script for launch gsd
# 
install(CODE "file (WRITE \"${CMAKE_BINARY_DIR}/bin_gsharkdown\" \"\#!/bin/bash\\n\\ncd ${CMAKE_INSTALL_PREFIX}/share/gsharkdown && python gsharkdown.py \$1\")")
install(PROGRAMS "${CMAKE_BINARY_DIR}/bin_gsharkdown" DESTINATION bin RENAME gsharkdown)

#
# Packaging
# 
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Damián Nohales <damiannohales@gmail.com>")
SET(CPACK_PACKAGE_VERSION_MAJOR ${PACKAGE_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${PACKAGE_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${PACKAGE_VERSION_PATCH})
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "gSharkDown player and downloader\n gSharkDown is a desktop client working as player and downloader\n for the famous service Grooveshark. The application\n allows you to play and download your favorite songs.")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
SET(CPACK_DEBIAN_PACKAGE_SECTION "sound")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "all")
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://gsharkdown.bultux.org/")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "python-pycurl, python-gobject, python-configobj, python-gtk2, python")
SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS "python-appindicator, xdg-user-dirs, python-notify")
SET(CPACK_DEBIAN_PACKAGE_CONFLICTS "gsharkdown (<=0.5.2)")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CMAKE_SOURCE_DIR}/debian/postrm ${CMAKE_SOURCE_DIR}/debian/postinst)
 
INCLUDE(CPack)