@ -4,7 +4,7 @@
# u s e d b y C P a c k : h t t p : / / w w w . c m a k e . o r g / W i k i / C M a k e : C P a c k C o n f i g u r a t i o n
# u s e d b y C P a c k : h t t p : / / w w w . c m a k e . o r g / W i k i / C M a k e : C P a c k C o n f i g u r a t i o n
#
#
# H o w e v e r C P a c k R P M h a s s p e c i f i c f e a t u r e s w h i c h a r e c o n t r o l l e d b y
# H o w e v e r C P a c k R P M h a s s p e c i f i c f e a t u r e s w h i c h a r e c o n t r o l l e d b y
# t h e s p e c i f i c s C P A C K _ R P M _ X X X v a r i a b l e s . Y o u ' l l f i n d a d e t a i l e d u s a g e o n
# t h e s p e c i f i c s C P A C K _ R P M _ X X X v a r i a b l e s . Y o u ' l l f i n d a d e t a i l e d u s a g e o n
# t h e w i k i :
# t h e w i k i :
# h t t p : / / w w w . c m a k e . o r g / W i k i / C M a k e : C P a c k P a c k a g e G e n e r a t o r s # R P M _ . 2 8 U n i x _ O n l y . 2 9
# h t t p : / / w w w . c m a k e . o r g / W i k i / C M a k e : C P a c k P a c k a g e G e n e r a t o r s # R P M _ . 2 8 U n i x _ O n l y . 2 9
# H o w e v e r a s a h a n d y r e m i n d e r h e r e c o m e s t h e l i s t o f s p e c i f i c v a r i a b l e s :
# H o w e v e r a s a h a n d y r e m i n d e r h e r e c o m e s t h e l i s t o f s p e c i f i c v a r i a b l e s :
@ -44,7 +44,7 @@
# T h e R P M p a c k a g e g r o u p .
# T h e R P M p a c k a g e g r o u p .
# C P A C K _ R P M _ P A C K A G E _ V E N D O R
# C P A C K _ R P M _ P A C K A G E _ V E N D O R
# M a n d a t o r y : Y E S
# M a n d a t o r y : Y E S
# D e f a u l t : C P A C K _ P A C K A G E _ V E N D O R i f s e t o r " u n k n o w n "
# D e f a u l t : C P A C K _ P A C K A G E _ V E N D O R i f s e t o r " u n k n o w n "
# T h e R P M p a c k a g e g r o u p .
# T h e R P M p a c k a g e g r o u p .
# C P A C K _ R P M _ P A C K A G E _ D E S C R I P T I O N
# C P A C K _ R P M _ P A C K A G E _ D E S C R I P T I O N
# M a n d a t o r y : Y E S
# M a n d a t o r y : Y E S
@ -52,7 +52,14 @@
# C P A C K _ R P M _ P A C K A G E _ R E Q U I R E S
# C P A C K _ R P M _ P A C K A G E _ R E Q U I R E S
# M a n d a t o r y : N O
# M a n d a t o r y : N O
# D e f a u l t : -
# D e f a u l t : -
# M a y b e u s e d t o s e t R P M d e p e n d e n c i e s .
# M a y b e u s e d t o s e t R P M dependencies ( requires ) .
# N o t e t h a t y o u m u s t e n c l o s e t h e c o m p l e t e r e q u i r e s s t r i n g b e t w e e n q u o t e s ,
# f o r e x a m p l e :
# set ( CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8" )
# C P A C K _ R P M _ P A C K A G E S _ P R O V I D E S
# M a n d a t o r y : N O
# D e f a u l t : -
# M a y b e u s e d t o s e t R P M dependencies ( provides ) .
# C P A C K _ R P M _ S P E C _ I N S T A L L _ P O S T
# C P A C K _ R P M _ S P E C _ I N S T A L L _ P O S T
# M a n d a t o r y : N O
# M a n d a t o r y : N O
# D e f a u l t : -
# D e f a u l t : -
@ -69,6 +76,38 @@
# M a y b e s e t w h e n i n v o k i n g c p a c k i n o r d e r t o t r a c e d e b u g i n f o r m a t i o n s
# M a y b e s e t w h e n i n v o k i n g c p a c k i n o r d e r t o t r a c e d e b u g i n f o r m a t i o n s
# d u r i n g C P a c k R P M r u n . F o r e x a m p l e y o u m a y l a u n c h C P a c k l i k e t h i s
# d u r i n g C P a c k R P M r u n . F o r e x a m p l e y o u m a y l a u n c h C P a c k l i k e t h i s
# c p a c k - D C P A C K _ R P M _ P A C K A G E _ D E B U G = 1 - G R P M
# c p a c k - D C P A C K _ R P M _ P A C K A G E _ D E B U G = 1 - G R P M
# C P A C K _ R P M _ U S E R _ B I N A R Y _ S P E C F I L E
# M a n d a t o r y : N O
# D e f a u l t : -
# M a y b e s e t b y t h e u s e r i n o r d e r t o s p e c i f y a U S E R b i n a r y s p e c f i l e
# t o b e u s e d b y C P a c k R P M i n s t e a d o f g e n e r a t i n g t h e f i l e .
# T h e s p e c i f i e d f i l e w i l l b e p r o c e s s e d b y CONFIGURE_FILE ( @ONLY ) .
# C P A C K _ R P M _ G E N E R A T E _ U S E R _ B I N A R Y _ S P E C F I L E _ T E M P L A T E
# M a n d a t o r y : N O
# D e f a u l t : -
# I f s e t C P a c k w i l l g e n e r a t e a t e m p l a t e f o r U S E R s p e c i f i e d b i n a r y
# s p e c f i l e a n d s t o p w i t h a n e r r o r . F o r e x a m p l e l a u n c h C P a c k l i k e t h i s
# c p a c k - D C P A C K _ R P M _ G E N E R A T E _ U S E R _ B I N A R Y _ S P E C F I L E _ T E M P L A T E = 1 - G R P M
# T h e u s e r m a y t h e n u s e t h i s f i l e i n o r d e r t o h a n d - c r a f t i s o w n
# b i n a r y s p e c f i l e w h i c h m a y b e u s e d w i t h C P A C K _ R P M _ U S E R _ B I N A R Y _ S P E C F I L E .
# C P A C K _ R P M _ P R E _ I N S T A L L _ S C R I P T _ F I L E
# C P A C K _ R P M _ P R E _ U N I N S T A L L _ S C R I P T _ F I L E
# M a n d a t o r y : N O
# D e f a u l t : -
# M a y b e u s e d t o e m b b e d a pre ( un ) i n s t a l l a t i o n s c r i p t i n t h e s p e c f i l e .
# T h e r e f e r e d s c r i p t file ( s ) w i l l b e r e a d a n d d i r e c t l y
# p u t a f t e r t h e % p r e o r % p r e u n s e c t i o n
# O n e m a y v e r i f y w h i c h s c r i p t l e t h a s b e e n i n c l u d e d w i t h
# r p m - q p - - s c r i p t s p a c k a g e . r p m
# C P A C K _ R P M _ P O S T _ I N S T A L L _ S C R I P T _ F I L E
# C P A C K _ R P M _ P O S T _ U N I N S T A L L _ S C R I P T _ F I L E
# M a n d a t o r y : N O
# D e f a u l t : -
# M a y b e u s e d t o e m b b e d a post ( un ) i n s t a l l a t i o n s c r i p t i n t h e s p e c f i l e .
# T h e r e f e r e d s c r i p t file ( s ) w i l l b e r e a d a n d d i r e c t l y
# p u t a f t e r t h e % p o s t o r % p o s t u n s e c t i o n
# O n e m a y v e r i f y w h i c h s c r i p t l e t h a s b e e n i n c l u d e d w i t h
# r p m - q p - - s c r i p t s p a c k a g e . r p m
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# C o p y r i g h t 2 0 0 7 - 2 0 0 9 K i t w a r e , I n c .
# C o p y r i g h t 2 0 0 7 - 2 0 0 9 K i t w a r e , I n c .
@ -236,6 +275,16 @@ IF(CPACK_RPM_PACKAGE_REQUIRES)
SET ( TMP_RPM_REQUIRES "Requires: ${CPACK_RPM_PACKAGE_REQUIRES}" )
SET ( TMP_RPM_REQUIRES "Requires: ${CPACK_RPM_PACKAGE_REQUIRES}" )
ENDIF ( CPACK_RPM_PACKAGE_REQUIRES )
ENDIF ( CPACK_RPM_PACKAGE_REQUIRES )
# C P A C K _ R P M _ P A C K A G E _ P R O V I D E S
# P l a c e h o l d e r u s e d t o s p e c i f y b i n a r y R P M dependencies ( if any )
# s e e h t t p : / / w w w . r p m . o r g / m a x - r p m / s 1 - r p m - d e p e n d - m a n u a l - d e p e n d e n c i e s . h t m l
IF ( CPACK_RPM_PACKAGE_PROVIDES )
IF ( CPACK_RPM_PACKAGE_DEBUG )
MESSAGE ( "CPackRPM:Debug: User defined Provides:\n ${CPACK_RPM_PACKAGE_PROVIDES}" )
ENDIF ( CPACK_RPM_PACKAGE_DEBUG )
SET ( TMP_RPM_PROVIDES "Provides: ${CPACK_RPM_PACKAGE_PROVIDES}" )
ENDIF ( CPACK_RPM_PACKAGE_PROVIDES )
# C P A C K _ R P M _ S P E C _ I N S T A L L _ P O S T
# C P A C K _ R P M _ S P E C _ I N S T A L L _ P O S T
# M a y b e u s e d t o d e f i n e a R P M p o s t i n t a l l a t i o n s c r i p t
# M a y b e u s e d t o d e f i n e a R P M p o s t i n t a l l a t i o n s c r i p t
# f o r e x a m p l e s e t t i n g i t t o " / b i n / t r u e " m a y p r e v e n t
# f o r e x a m p l e s e t t i n g i t t o " / b i n / t r u e " m a y p r e v e n t
@ -247,6 +296,48 @@ IF(CPACK_RPM_SPEC_INSTALL_POST)
SET ( TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}" )
SET ( TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}" )
ENDIF ( CPACK_RPM_SPEC_INSTALL_POST )
ENDIF ( CPACK_RPM_SPEC_INSTALL_POST )
# C P A C K _ R P M _ P O S T _ I N S T A L L _ S C R I P T _ F I L E
# C P A C K _ R P M _ P O S T _ U N I N S T A L L _ S C R I P T _ F I L E
# M a y b e u s e d t o e m b b e d a post ( un ) i n s t a l l a t i o n s c r i p t i n t h e s p e c f i l e .
# T h e r e f e r e d s c r i p t file ( s ) w i l l b e r e a d a n d d i r e c t l y
# p u t a f t e r t h e % p o s t o r % p o s t u n s e c t i o n
if ( CPACK_RPM_POST_INSTALL_SCRIPT_FILE )
if ( EXISTS ${ CPACK_RPM_POST_INSTALL_SCRIPT_FILE } )
file ( READ ${ CPACK_RPM_POST_INSTALL_SCRIPT_FILE } CPACK_RPM_SPEC_POSTINSTALL )
else ( EXISTS ${ CPACK_RPM_POST_INSTALL_SCRIPT_FILE } )
message ( "CPackRPM:Warning: CPACK_RPM_POST_INSTALL_SCRIPT_FILE <${CPACK_RPM_POST_INSTALL_SCRIPT_FILE}> does not exists - ignoring" )
endif ( EXISTS ${ CPACK_RPM_POST_INSTALL_SCRIPT_FILE } )
endif ( CPACK_RPM_POST_INSTALL_SCRIPT_FILE )
if ( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE )
if ( EXISTS ${ CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE } )
file ( READ ${ CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE } CPACK_RPM_SPEC_POSTUNINSTALL )
else ( EXISTS ${ CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE } )
message ( "CPackRPM:Warning: CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE}> does not exists - ignoring" )
endif ( EXISTS ${ CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE } )
endif ( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE )
# C P A C K _ R P M _ P R E _ I N S T A L L _ S C R I P T _ F I L E
# C P A C K _ R P M _ P R E _ U N I N S T A L L _ S C R I P T _ F I L E
# M a y b e u s e d t o e m b b e d a pre ( un ) i n s t a l l a t i o n s c r i p t i n t h e s p e c f i l e .
# T h e r e f e r e d s c r i p t file ( s ) w i l l b e r e a d a n d d i r e c t l y
# p u t a f t e r t h e % p r e o r % p r e u n s e c t i o n
if ( CPACK_RPM_PRE_INSTALL_SCRIPT_FILE )
if ( EXISTS ${ CPACK_RPM_PRE_INSTALL_SCRIPT_FILE } )
file ( READ ${ CPACK_RPM_PRE_INSTALL_SCRIPT_FILE } CPACK_RPM_SPEC_PREINSTALL )
else ( EXISTS ${ CPACK_RPM_PRE_INSTALL_SCRIPT_FILE } )
message ( "CPackRPM:Warning: CPACK_RPM_PRE_INSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE}> does not exists - ignoring" )
endif ( EXISTS ${ CPACK_RPM_PRE_INSTALL_SCRIPT_FILE } )
endif ( CPACK_RPM_PRE_INSTALL_SCRIPT_FILE )
if ( CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE )
if ( EXISTS ${ CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE } )
file ( READ ${ CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE } CPACK_RPM_SPEC_PREUNINSTALL )
else ( EXISTS ${ CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE } )
message ( "CPackRPM:Warning: CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE}> does not exists - ignoring" )
endif ( EXISTS ${ CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE } )
endif ( CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE )
# C P A C K _ R P M _ S P E C _ M O R E _ D E F I N E
# C P A C K _ R P M _ S P E C _ M O R E _ D E F I N E
# T h i s i s a g e n e r a t e d s p e c r p m f i l e s p a c e h o l d e r
# T h i s i s a g e n e r a t e d s p e c r p m f i l e s p a c e h o l d e r
IF ( CPACK_RPM_SPEC_MORE_DEFINE )
IF ( CPACK_RPM_SPEC_MORE_DEFINE )
@ -255,10 +346,6 @@ IF(CPACK_RPM_SPEC_MORE_DEFINE)
ENDIF ( CPACK_RPM_PACKAGE_DEBUG )
ENDIF ( CPACK_RPM_PACKAGE_DEBUG )
ENDIF ( CPACK_RPM_SPEC_MORE_DEFINE )
ENDIF ( CPACK_RPM_SPEC_MORE_DEFINE )
# C P A C K _ R P M _ U S E R _ B I N A R Y _ S P E C F I L E
# F I X M E w h e n t h i s i s s e t t h e n C P a c k s h o u l d u s t h e
# u s e r p r o v i d e d f i l e .
# N o w w e m a y c r e a t e t h e R P M b u i l d t r e e s t r u c t u r e
# N o w w e m a y c r e a t e t h e R P M b u i l d t r e e s t r u c t u r e
SET ( CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}" )
SET ( CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}" )
MESSAGE ( STATUS "CPackRPM:Debug: Using CPACK_RPM_ROOTDIR=${CPACK_RPM_ROOTDIR}" )
MESSAGE ( STATUS "CPackRPM:Debug: Using CPACK_RPM_ROOTDIR=${CPACK_RPM_ROOTDIR}" )
@ -279,75 +366,111 @@ SET(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")
SET ( CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}" )
SET ( CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}" )
# U s e f i l e s t r e e t o c o n s t r u c t f i l e s command ( spec file )
# U s e f i l e s t r e e t o c o n s t r u c t f i l e s command ( spec file )
EXECUTE_PROCESS ( COMMAND find -type f
# W e s h o u l d n o t f o r g e t t o i n c l u d e symlinks ( thus -o -type l )
# W e m u s t r e m o v e t h e ' . / ' d u e t o t h e l o c a l search ( thus the sed )
# T h e n w e m u s t a u t h o r i z e a n y m a n p a g e s extension ( adding * at the end )
# b e c a u s e r p m b u i l d m a y a u t o m a t i c a l l y c o m p r e s s t h o s e f i l e s
EXECUTE_PROCESS ( COMMAND find -type f -o -type l
C O M M A N D s e d { s / \ \ . / / }
C O M M A N D s e d { s / \ \ . / / }
C O M M A N D s e d { s / . * m a n . * \ \ / . * / & * / }
W O R K I N G _ D I R E C T O R Y " $ { C P A C K _ T O P L E V E L _ D I R E C T O R Y } / $ { C P A C K _ P A C K A G E _ F I L E _ N A M E } "
W O R K I N G _ D I R E C T O R Y " $ { C P A C K _ T O P L E V E L _ D I R E C T O R Y } / $ { C P A C K _ P A C K A G E _ F I L E _ N A M E } "
O U T P U T _ V A R I A B L E C P A C K _ R P M _ I N S T A L L _ F I L E S )
O U T P U T _ V A R I A B L E C P A C K _ R P M _ I N S T A L L _ F I L E S )
# T h e n a m e o f t h e f i n a l s p e c f i l e t o b e u s e d b y r p m b u i l d
SET ( CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}.spec" )
SET ( CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}.spec" )
IF ( CPACK_RPM_USER_BINARY_SPECFILE )
# U s e r m a y h a v e s p e c i f i e d S P E C F I L E j u s t u s e i t
# P r i n t o u t s o m e d e b u g i n f o r m a t i o n i f w e w e r e a s k e d f o r t h a t
MESSAGE ( "CPackRPM: Will use user specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}" )
IF ( CPACK_RPM_PACKAGE_DEBUG )
# N o t e t h a t u s e r p r o v i d e d f i l e i s p r o c e s s e d f o r @ v a r r e p l a c e m e n t
MESSAGE ( "CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}" )
CONFIGURE_FILE ( ${ CPACK_RPM_USER_BINARY_SPECFILE } ${ CPACK_RPM_BINARY_SPECFILE } @ONLY )
MESSAGE ( "CPackRPM:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}" )
ELSE ( CPACK_RPM_USER_BINARY_SPECFILE )
MESSAGE ( "CPackRPM:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}" )
# N o U s e r s p e c i f i e d s p e c f i l e g e n e r a t e a v a l i d o n e u s i n g v a r v a l u e s
MESSAGE ( "CPackRPM:Debug: CPACK_OUTPUT_FILE_NAME = ${CPACK_OUTPUT_FILE_NAME}" )
IF ( CPACK_RPM_PACKAGE_DEBUG )
MESSAGE ( "CPackRPM:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}" )
MESSAGE ( "CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}" )
MESSAGE ( "CPackRPM:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}" )
MESSAGE ( "CPackRPM:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}" )
MESSAGE ( "CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE = ${CPACK_RPM_BINARY_SPECFILE}" )
MESSAGE ( "CPackRPM:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}" )
MESSAGE ( "CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}" )
MESSAGE ( "CPackRPM:Debug: CPACK_OUTPUT_FILE_NAME = ${CPACK_OUTPUT_FILE_NAME}" )
MESSAGE ( "CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}" )
MESSAGE ( "CPackRPM:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}" )
ENDIF ( CPACK_RPM_PACKAGE_DEBUG )
MESSAGE ( "CPackRPM:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}" )
MESSAGE ( "CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE = ${CPACK_RPM_BINARY_SPECFILE}" )
# U S E R g e n e r a t e d s p e c f i l e h a n d l i n g .
MESSAGE ( "CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}" )
# W e s h o u l d g e n e r a t e a s p e c f i l e t e m p l a t e :
MESSAGE ( "CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}" )
# - e i t h e r b e c a u s e t h e u s e r a s k e d f o r i t : C P A C K _ R P M _ G E N E R A T E _ U S E R _ B I N A R Y _ S P E C F I L E _ T E M P L A T E
ENDIF ( CPACK_RPM_PACKAGE_DEBUG )
# - o r t h e u s e r d i d n o t p r o v i d e o n e : N O T C P A C K _ R P M _ U S E R _ B I N A R Y _ S P E C F I L E
FILE ( WRITE ${ CPACK_RPM_BINARY_SPECFILE }
#
" # - * - r p m - s p e c - * -
IF ( CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE )
B u i l d r o o t : $ { C P A C K _ R P M _ D I R E C T O R Y } / $ { C P A C K _ P A C K A G E _ F I L E _ N A M E }
FILE ( WRITE ${ CPACK_RPM_BINARY_SPECFILE } .in
S u m m a r y : $ { C P A C K _ R P M _ P A C K A G E _ S U M M A R Y }
" # - * - r p m - s p e c - * -
N a m e : $ { C P A C K _ R P M _ P A C K A G E _ N A M E }
B u i l d r o o t : \ @ C P A C K _ R P M _ D I R E C T O R Y \ @ / \ @ C P A C K _ P A C K A G E _ F I L E _ N A M E \ @
V e r s i o n : $ { C P A C K _ R P M _ P A C K A G E _ V E R S I O N }
S u m m a r y : \ @ C P A C K _ R P M _ P A C K A G E _ S U M M A R Y \ @
R e l e a s e : $ { C P A C K _ R P M _ P A C K A G E _ R E L E A S E }
N a m e : \ @ C P A C K _ R P M _ P A C K A G E _ N A M E \ @
L i c e n s e : $ { C P A C K _ R P M _ P A C K A G E _ L I C E N S E }
V e r s i o n : \ @ C P A C K _ R P M _ P A C K A G E _ V E R S I O N \ @
G r o u p : $ { C P A C K _ R P M _ P A C K A G E _ G R O U P }
R e l e a s e : \ @ C P A C K _ R P M _ P A C K A G E _ R E L E A S E \ @
V e n d o r : $ { C P A C K _ R P M _ P A C K A G E _ V E N D O R }
L i c e n s e : \ @ C P A C K _ R P M _ P A C K A G E _ L I C E N S E \ @
$ { T M P _ R P M _ R E Q U I R E S }
G r o u p : \ @ C P A C K _ R P M _ P A C K A G E _ G R O U P \ @
$ { T M P _ R P M _ B U I L D A R C H }
V e n d o r : \ @ C P A C K _ R P M _ P A C K A G E _ V E N D O R \ @
\ @ T M P _ R P M _ R E Q U I R E S \ @
# p d e f i n e p r e f i x $ { C M A K E _ I N S T A L L _ P R E F I X }
\ @ T M P _ R P M _ P R O V I D E S \ @
% d e f i n e _ r p m d i r $ { C P A C K _ R P M _ D I R E C T O R Y }
\ @ T M P _ R P M _ B U I L D A R C H \ @
% d e f i n e _ r p m f i l e n a m e $ { C P A C K _ R P M _ F I L E _ N A M E }
# p d e f i n e p r e f i x \ @ C M A K E _ I N S T A L L _ P R E F I X \ @
% d e f i n e _ r p m d i r \ @ C P A C K _ R P M _ D I R E C T O R Y \ @
% d e f i n e _ r p m f i l e n a m e \ @ C P A C K _ R P M _ F I L E _ N A M E \ @
% d e f i n e _ u n p a c k a g e d _ f i l e s _ t e r m i n a t e _ b u i l d 0
% d e f i n e _ u n p a c k a g e d _ f i l e s _ t e r m i n a t e _ b u i l d 0
% d e f i n e _ t o p d i r $ { C P A C K _ R P M _ D I R E C T O R Y }
% d e f i n e _ t o p d i r \@ C P A C K _ R P M _ D I R E C T O R Y \@
$ { T M P _ R P M _ S P E C _ I N S T A L L _ P O S T }
\@ T M P _ R P M _ S P E C _ I N S T A L L _ P O S T \@
${ C P A C K _ R P M _ S P E C _ M O R E _ D E F I N E }
\@ C P A C K _ R P M _ S P E C _ M O R E _ D E F I N E \@
% d e s c r i p t i o n
% d e s c r i p t i o n
${ C P A C K _ R P M _ P A C K A G E _ D E S C R I P T I O N }
\@ C P A C K _ R P M _ P A C K A G E _ D E S C R I P T I O N \@
# T h i s i s a s h o r t c u t t e d s p e c f i l e
# T h i s i s a s h o r t c u t t e d s p e c f i l e g e n e r a t e d b y C M a k e R P M g e n e r a t o r
# g e n e r a t e d b y C M a k e R P M g e n e r a t o r
# w e s k i p _ i n s t a l l s t e p b e c a u s e C P a c k d o e s t h a t f o r u s .
# w e s k i p t h e _ p r e p n _ b u i l d a n d _ i n s t a l l
# W e d o o n l y s a v e C P a c k i n s t a l l e d t r e e i n _ p r e p r
# s t e p s b e c a u s e C P a c k d o e s t h a t f o r u s
# a n d t h e n r e s t o r e i t i n b u i l d .
# W E M U S T N O T D O A N Y T H I N G i n t h o s e s t e p s b e c a u s e t h e y
% p r e p
# m a y f a i l f o r n o n - p r i v i l e g e d u s e r
m v $ R P M _ B U I L D _ R O O T \ @ C P A C K _ T O P L E V E L _ D I R E C T O R Y \ @ / t m p B B r o o t
# p p r e p
# p b u i l d
# p b u i l d
# p i n s t a l l
% i n s t a l l
i f [ - e $ R P M _ B U I L D _ R O O T ] ;
t h e n
m v \ @ C P A C K _ T O P L E V E L _ D I R E C T O R Y \ @ / t m p B B r o o t / * $ R P M _ B U I L D _ R O O T
e l s e
m v \ @ C P A C K _ T O P L E V E L _ D I R E C T O R Y \ @ / t m p B B r o o t $ R P M _ B U I L D _ R O O T
f i
% c l e a n
% c l e a n
% p o s t
\ @ C P A C K _ R P M _ S P E C _ P O S T I N S T A L L \ @
% p o s t u n
\ @ C P A C K _ R P M _ S P E C _ P O S T U N I N S T A L L \ @
% p r e
\ @ C P A C K _ R P M _ S P E C _ P R E I N S T A L L \ @
% p r e u n
\ @ C P A C K _ R P M _ S P E C _ P R E U N I N S T A L L \ @
% f i l e s
% f i l e s
% defattr ( -,root,root,- )
% defattr ( -,root,root,- )
# p d i r % { p r e f i x }
# p { p r e f i x } / *
$ { C P A C K _ R P M _ I N S T A L L _ F I L E S }
$ { C P A C K _ R P M _ I N S T A L L _ F I L E S }
% c h a n g e l o g
% c h a n g e l o g
* S a t N o v 2 8 2 0 0 9 E r k < e r i c . n o u l a r d @ g m a i l . c o m >
R e f i x b a c k u p / r e s t o r e i n s t a l l t r e e f o r O p e n S u S E 1 1 . 2
* S u n N o v 2 2 2 0 0 9 E r k < e r i c . n o u l a r d @ g m a i l . c o m >
I n c l u d e s y m l i n k s i n t h e f i l e l i s t .
* S a t N o v 1 4 2 0 0 9 E r k < e r i c . n o u l a r d @ g m a i l . c o m >
R e p l a c e p r e p a n d b u i l d s t e p w i t h b a c k u p a n d r e s t o r e
o f t h e p r e v i o u s l y C P a c k i n s t a l l e d t r e e . T h i s s h o u l d
m i m i c w h a t i s e x p e c t e d i n r p m b u i l d u s u a l s t e p s
* W e d N o v 1 1 2 0 0 9 E r k < e r i c . n o u l a r d @ g m a i l . c o m >
A d d s u p p o r t f o r U S E R d e f i n e d p r e / p o s t [ u n ] i n s t a l l s c r i p t s
* W e d O c t 0 7 2 0 0 9 E r k < e r i c . n o u l a r d @ g m a i l . c o m >
A d d u s e r c u s t o m s p e c f i l e s u p p o r t
* S a t O c t 0 3 2 0 0 9 K a m i < c m o i d a v i d @ g m a i l . c o m >
* S a t O c t 0 3 2 0 0 9 K a m i < c m o i d a v i d @ g m a i l . c o m >
U p d a t e t o h a n d l e m o r e p r e c i s e l y t h e f i l e s s e c t i o n
U p d a t e t o h a n d l e m o r e p r e c i s e l y t h e f i l e s s e c t i o n
* M o n O c t 0 3 2 0 0 8 E r k < e r i c . n o u l a r d @ g m a i l . c o m >
* M o n O c t 0 3 2 0 0 8 E r k < e r i c . n o u l a r d @ g m a i l . c o m >
@ -358,9 +481,28 @@ ${CPACK_RPM_INSTALL_FILES}
* T u e A u g 1 6 2 0 0 7 E r k < e r i c . n o u l a r d @ g m a i l . c o m >
* T u e A u g 1 6 2 0 0 7 E r k < e r i c . n o u l a r d @ g m a i l . c o m >
G e n e r a t e d b y C P a c k R P M G e n e r a t o r a n d a s s o c i a t e d m a c r o s
G e n e r a t e d b y C P a c k R P M G e n e r a t o r a n d a s s o c i a t e d m a c r o s
" )
" )
# S t o p h e r e i f w e w e r e a s k e d t o o n l y g e n e r a t e a t e m p l a t e U S E R s p e c f i l e
# T h e g e n e r a t e d f i l e m a y t h e n b e u s e d a s a t e m p l a t e b y u s e r w h o w a n t s
# t o c u s t o m i z e t h e i r o w n s p e c f i l e .
IF ( CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE )
MESSAGE ( FATAL_ERROR "CPackRPM: STOP here Generated USER binary spec file templare is: ${CPACK_RPM_BINARY_SPECFILE}.in" )
ENDIF ( CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE )
ENDIF ( CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE )
# A f t e r t h a t w e m a y e i t h e r u s e a u s e r p r o v i d e d s p e c f i l e
# o r g e n e r a t e o n e u s i n g a p p r o p r i a t e v a r i a b l e s v a l u e .
IF ( CPACK_RPM_USER_BINARY_SPECFILE )
# U s e r m a y h a v e s p e c i f i e d S P E C F I L E j u s t u s e i t
MESSAGE ( "CPackRPM: Will use USER specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}" )
# T h e u s e r p r o v i d e d f i l e i s p r o c e s s e d f o r @ v a r r e p l a c e m e n t
CONFIGURE_FILE ( ${ CPACK_RPM_USER_BINARY_SPECFILE } ${ CPACK_RPM_BINARY_SPECFILE } @ONLY )
ELSE ( CPACK_RPM_USER_BINARY_SPECFILE )
# N o U s e r s p e c i f i e d s p e c f i l e , w i l l u s e t h e g e n e r a t e d s p e c f i l e
MESSAGE ( "CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}" )
# N o t e t h e j u s t c r e a t e d f i l e i s p r o c e s s e d f o r @ v a r r e p l a c e m e n t
CONFIGURE_FILE ( ${ CPACK_RPM_BINARY_SPECFILE } .in ${ CPACK_RPM_BINARY_SPECFILE } @ONLY )
ENDIF ( CPACK_RPM_USER_BINARY_SPECFILE )
ENDIF ( CPACK_RPM_USER_BINARY_SPECFILE )
IF ( RPMBUILD_EXECUTABLE )
IF ( RPMBUILD_EXECUTABLE )
# N o w c a l l r p m b u i l d u s i n g t h e S P E C F I L E
# N o w c a l l r p m b u i l d u s i n g t h e S P E C F I L E
EXECUTE_PROCESS (
EXECUTE_PROCESS (