2007-07-25 18:57:33 +04:00
|
|
|
IF(CMAKE_BINARY_DIR)
|
|
|
|
MESSAGE(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.")
|
|
|
|
ENDIF(CMAKE_BINARY_DIR)
|
|
|
|
|
|
|
|
IF(NOT UNIX)
|
|
|
|
MESSAGE(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
|
|
|
|
ENDIF(NOT UNIX)
|
|
|
|
|
|
|
|
FIND_PROGRAM(AR_EXECUTABLE ar)
|
|
|
|
|
2007-07-27 16:59:59 +04:00
|
|
|
IF(NOT AR_EXECUTABLE)
|
|
|
|
# Is there a *NIX out there without ar ?
|
2007-08-03 23:26:30 +04:00
|
|
|
MESSAGE(FATAL_ERROR "Debian package requires ar executable")
|
2007-07-27 16:59:59 +04:00
|
|
|
ENDIF(NOT AR_EXECUTABLE)
|
|
|
|
|
|
|
|
# Let's define the control file found in debian package:
|
|
|
|
|
|
|
|
# Package:
|
|
|
|
# debian policy enforce lower case for package name
|
|
|
|
IF(NOT DEBIAN_PACKAGE_NAME)
|
2007-08-03 23:26:30 +04:00
|
|
|
STRING(TOLOWER "${CPACK_PACKAGE_NAME}" DEBIAN_PACKAGE_NAME)
|
2007-07-27 16:59:59 +04:00
|
|
|
ENDIF(NOT DEBIAN_PACKAGE_NAME)
|
|
|
|
|
|
|
|
# Version:
|
|
|
|
IF(NOT DEBIAN_PACKAGE_VERSION)
|
|
|
|
IF(NOT CPACK_PACKAGE_VERSION)
|
2007-08-03 23:26:30 +04:00
|
|
|
MESSAGE(FATAL_ERROR "Debian package requires a package version")
|
2007-07-27 16:59:59 +04:00
|
|
|
ENDIF(NOT CPACK_PACKAGE_VERSION)
|
|
|
|
SET(DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
|
|
|
|
ENDIF(NOT DEBIAN_PACKAGE_VERSION)
|
|
|
|
|
|
|
|
# Architecture:
|
|
|
|
IF(NOT DEBIAN_PACKAGE_ARCHITECTURE)
|
|
|
|
# There is no such thing as i686 architecture on debian, you should use i386 instead
|
|
|
|
# $ dpkg --print-architecture
|
|
|
|
SET(DEBIAN_PACKAGE_ARCHITECTURE i386)
|
|
|
|
ENDIF(NOT DEBIAN_PACAKGE_ARCHITECTURE)
|
|
|
|
|
|
|
|
# Depends:
|
|
|
|
IF(NOT DEBIAN_PACKAGE_DEPENDS)
|
|
|
|
SET(DEBIAN_PACKAGE_DEPENDS
|
|
|
|
"libc6 (>= 2.3.1-6), libgcc1 (>= 1:3.4.2-12)"
|
|
|
|
)
|
|
|
|
ENDIF(NOT DEBIAN_PACKAGE_DEPENDS)
|
|
|
|
|
|
|
|
# Maintainer:
|
|
|
|
IF(NOT DEBIAN_PACKAGE_MAINTAINER)
|
|
|
|
IF(NOT CPACK_PACKAGE_CONTACT)
|
2007-08-03 23:26:30 +04:00
|
|
|
MESSAGE(FATAL_ERROR "Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or DEBIAN_PACKAGE_MAINTAINER")
|
2007-07-27 16:59:59 +04:00
|
|
|
ENDIF(NOT CPACK_PACKAGE_CONTACT)
|
|
|
|
SET(DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
|
|
|
|
ENDIF(NOT DEBIAN_PACKAGE_MAINTAINER)
|
|
|
|
|
|
|
|
# Description:
|
|
|
|
IF(NOT DEBIAN_PACKAGE_DESCRIPTION)
|
|
|
|
IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
|
2007-08-03 23:26:30 +04:00
|
|
|
MESSAGE(FATAL_ERROR "Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or DEBIAN_PACKAGE_DESCRIPTION")
|
2007-07-27 16:59:59 +04:00
|
|
|
ENDIF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
|
|
|
|
SET(DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
|
|
|
ENDIF(NOT DEBIAN_PACKAGE_DESCRIPTION)
|