Bug #1087

Cpack ignores install prefix when building RPMs

Added by Dread7 almost 8 years ago. Updated almost 8 years ago.

Status:New Start date:08/31/2010
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:-

Description

The installation paths in code/nel/CMakeFiles.txt and code/nelns/CMakeFiles.txt are ignored when cpack creates RPM files on Fedora 12 and CentOS 5.5. Additionally cpack tries to create a log directory in an inappropriate place when building the nelns RPM file. Here are some fixes:

 1diff -r 5bafd599a355 code/nel/CMakeLists.txt
 2--- a/code/nel/CMakeLists.txt   Sun Aug 22 09:57:33 2010 +0200
 3+++ b/code/nel/CMakeLists.txt   Tue Aug 31 12:37:06 2010 -0400
 4@@ -158,6 +158,8 @@
 5 ENDIF(WITH_TESTS)
 6
 7 IF(UNIX)
 8+  SET(CPACK_SET_DESTDIR "ON") 
 9+  SET(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
10   SET(prefix ${CMAKE_INSTALL_PREFIX})
11   SET(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
12   SET(libdir "${CMAKE_INSTALL_PREFIX}/lib")
13
14diff -r 5bafd599a355 code/nelns/CMakeLists.txt
15--- a/code/nelns/CMakeLists.txt Sun Aug 22 09:57:33 2010 +0200
16+++ b/code/nelns/CMakeLists.txt Tue Aug 31 12:32:09 2010 -0400
17@@ -105,7 +105,9 @@
18 SET(PKGDIR "${NL_SHARE_PREFIX}/nelns")
19 SET(LOGDIR "${NL_LOG_PREFIX}/nelns")
20 ADD_DEFINITIONS(-DNELNS_CONFIG="\\"${ETCDIR}\\"" -DNELNS_STATE="\\"${PKGDIR}\\"" -DNELNS_LOGS="\\"${LOGDIR}\\"")
21-INSTALL(CODE "FILE(MAKE_DIRECTORY ${LOGDIR})")
22+SET(CPACK_SET_DESTDIR "ON")
23+SET(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
24+INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${LOGDIR})")
25
26 IF(BUILD_SERVICES)
27        ADD_SUBDIRECTORY(admin_executor_service)

History

#1 Updated by kervala almost 8 years ago

Thanks a lot for reporting the bug and providing a patch :)

Edit: I fixed the presentation :)

#2 Updated by Dread7 almost 8 years ago

Oops I mangled the diff formatting. Here they are again...

diff -r 5bafd599a355 code/nel/CMakeLists.txt
--- a/code/nel/CMakeLists.txt    Sun Aug 22 09:57:33 2010 +0200
+++ b/code/nel/CMakeLists.txt    Tue Aug 31 12:43:53 2010 -0400
@@ -158,6 +158,8 @@
 ENDIF(WITH_TESTS)

 IF(UNIX)
+  SET(CPACK_SET_DESTDIR "ON") 
+  SET(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
   SET(prefix ${CMAKE_INSTALL_PREFIX})
   SET(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
   SET(libdir "${CMAKE_INSTALL_PREFIX}/lib")
diff -r 5bafd599a355 code/nelns/CMakeLists.txt
--- a/code/nelns/CMakeLists.txt    Sun Aug 22 09:57:33 2010 +0200
+++ b/code/nelns/CMakeLists.txt    Tue Aug 31 12:43:43 2010 -0400
@@ -105,7 +105,9 @@
 SET(PKGDIR "${NL_SHARE_PREFIX}/nelns")
 SET(LOGDIR "${NL_LOG_PREFIX}/nelns")
 ADD_DEFINITIONS(-DNELNS_CONFIG="\\"${ETCDIR}\\"" -DNELNS_STATE="\\"${PKGDIR}\\"" -DNELNS_LOGS="\\"${LOGDIR}\\"")
-INSTALL(CODE "FILE(MAKE_DIRECTORY ${LOGDIR})")
+SET(CPACK_SET_DESTDIR "ON")
+SET(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
+INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}${LOGDIR})")

 IF(BUILD_SERVICES)
     ADD_SUBDIRECTORY(admin_executor_service)

Also available in: Atom PDF