diff --git a/CMakeLists.txt b/CMakeLists.txt index 84a79912b..c0534afd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ include(CheckCXXCompilerFlag) include(FindPkgConfig) include(cmake/Summary.cmake) include(cmake/Version.cmake) +include(cmake/Rpm.cmake) find_package(Qt4 REQUIRED QtCore QtGui QtOpenGL QtSql QtNetwork QtXml) if(UNIX AND NOT APPLE) diff --git a/cmake/Rpm.cmake b/cmake/Rpm.cmake new file mode 100644 index 000000000..f88f079d0 --- /dev/null +++ b/cmake/Rpm.cmake @@ -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 +) diff --git a/dist/CMakeLists.txt b/dist/CMakeLists.txt index 2f3770c6a..091fefeb3 100644 --- a/dist/CMakeLists.txt +++ b/dist/CMakeLists.txt @@ -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) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/clementine.spec.in