1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-18 12:28:31 +01:00

Add an "rpm" target for make

This commit is contained in:
David Sansome 2010-09-04 18:55:29 +00:00
parent 3ad38b2128
commit c440657904
3 changed files with 12 additions and 1 deletions

View File

@ -4,6 +4,7 @@ include(CheckCXXCompilerFlag)
include(FindPkgConfig) include(FindPkgConfig)
include(cmake/Summary.cmake) include(cmake/Summary.cmake)
include(cmake/Version.cmake) include(cmake/Version.cmake)
include(cmake/Rpm.cmake)
find_package(Qt4 REQUIRED QtCore QtGui QtOpenGL QtSql QtNetwork QtXml) find_package(Qt4 REQUIRED QtCore QtGui QtOpenGL QtSql QtNetwork QtXml)
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)

10
cmake/Rpm.cmake Normal file
View File

@ -0,0 +1,10 @@
set(RPMBUILD_DIR ~/rpmbuild CACHE STRING "Rpmbuild directory, for the rpm target")
set(MOCK_CHROOT fedora-13-x86_64 CACHE STRING "Chroot to use when building an rpm with mock")
set(RPM_DISTRO fc13 CACHE STRING "Suffix of the rpm file")
add_custom_target(rpm
COMMAND ${CMAKE_SOURCE_DIR}/dist/maketarball.sh
COMMAND ${CMAKE_COMMAND} -E copy clementine-${CLEMENTINE_VERSION}.tar.gz ${RPMBUILD_DIR}/SOURCES/
COMMAND rpmbuild -bs ${CMAKE_SOURCE_DIR}/dist/clementine.spec
COMMAND mock -r ${MOCK_CHROOT} ${RPMBUILD_DIR}/SRPMS/clementine-${CLEMENTINE_VERSION}-1.${RPM_DISTRO}.src.rpm
)

2
dist/CMakeLists.txt vendored
View File

@ -1,4 +1,4 @@
execute_process(COMMAND date "+%a %b %Y" execute_process(COMMAND date "+%a %b %d %Y"
OUTPUT_VARIABLE RPM_DATE OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_VARIABLE RPM_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/clementine.spec.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/clementine.spec.in