2014-04-19 22:39:48 -04:00
|
|
|
find_program (GZIP_EXECUTABLE NAMES gzip)
|
|
|
|
|
|
|
|
string (TIMESTAMP ts "%w, %d [%m] %Y %H:%M:%S +0000" UTC)
|
|
|
|
|
|
|
|
set (__days Sun Mon Tue Wed Thu Fri Sat)
|
|
|
|
string (SUBSTRING ${ts} 0 1 __index)
|
|
|
|
list (GET __days ${__index} __day)
|
|
|
|
string (REPLACE "${__index}," "${__day}," ts ${ts})
|
|
|
|
|
|
|
|
set (__months Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
|
|
|
|
string (SUBSTRING ${ts} 9 2 __month_index)
|
|
|
|
math (EXPR __index "${__month_index} - 1")
|
|
|
|
list (GET __months "${__index}" __month)
|
|
|
|
string (REPLACE "[${__month_index}]" "${__month}" ts ${ts})
|
|
|
|
|
2020-10-10 08:38:15 -04:00
|
|
|
set (deb_changelog changelog)
|
2014-04-19 22:39:48 -04:00
|
|
|
configure_file (
|
2014-09-25 10:45:36 -04:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/${deb_changelog}.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${deb_changelog}"
|
2014-04-19 22:39:48 -04:00
|
|
|
@ONLY)
|
|
|
|
|
|
|
|
add_custom_target (debian
|
2014-09-25 10:45:36 -04:00
|
|
|
COMMAND ${GZIP_EXECUTABLE} -cf9 ${deb_changelog} > ${deb_changelog}.gz
|
|
|
|
DEPENDS ${deb_changelog}.in
|
2014-04-19 22:39:48 -04:00
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
COMMENT "Compressing Debian changelog"
|
|
|
|
)
|
|
|
|
|
|
|
|
configure_file (
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/copyright.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/copyright"
|
|
|
|
@ONLY)
|
|
|
|
|
|
|
|
install (FILES
|
2014-09-25 10:45:36 -04:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/${deb_changelog}.gz
|
2014-04-19 22:39:48 -04:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/copyright
|
2017-03-28 09:03:48 -04:00
|
|
|
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
2014-04-21 08:21:44 -04:00
|
|
|
#COMPONENT Debian
|
2014-04-19 22:39:48 -04:00
|
|
|
)
|