generating alimdc rpm configuration file from CMake
authoragrigora <alina.gabriela.grigoras@cern.ch>
Tue, 11 Feb 2014 13:53:54 +0000 (14:53 +0100)
committeragrigora <alina.gabriela.grigoras@cern.ch>
Tue, 11 Feb 2014 16:41:43 +0000 (17:41 +0100)
 - alimdc.spec.in in RAW

CMakeLists.txt
RAW/alimdc.spec.in [new file with mode: 0644]

index 06bf9d6..e19f435 100644 (file)
@@ -334,29 +334,32 @@ message("alimdc-rpm: Unknown architecture" )
 endif( ${ARCHITECTURE} MATCHES "linuxx8664gcc" )
 
 
+# Module version will be written in the generated header
+configure_file ("RAW/alimdc.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/RAW/alimdc.spec" @ONLY)
+
 add_custom_target( alimdc-rpm
-DEPENDS alimdc-static alimdc-specfile
+DEPENDS alimdc-static
 )
 
 add_custom_command(
 TARGET alimdc-rpm
 POST_BUILD 
-COMMAND rm -rf ${ALICE_ROOT}/alimdc-root
-COMMAND mkdir -p ${ALICE_ROOT}/alimdc-root/opt/alimdc/lib
-COMMAND mkdir -p ${ALICE_ROOT}/alimdc-root/opt/alimdc/include
-COMMAND cp ${ALICE_ROOT}/RAW/mdc.h ${ALICE_ROOT}/alimdc-root/opt/alimdc/include
-COMMAND cp ${LIBPATH}/libAliMDC.a ${ALICE_ROOT}/alimdc-root/opt/alimdc/lib
-COMMAND cp ${ROOTALIBDIR}/libRoot.a ${ALICE_ROOT}/alimdc-root/opt/alimdc/lib
-COMMAND cp ${ROOTALIBDIR}/liblzma.a ${ALICE_ROOT}/alimdc-root/opt/alimdc/lib
-COMMAND cp ${ROOTALIBDIR}/libpcre.a ${ALICE_ROOT}/alimdc-root/opt/alimdc/lib
-COMMAND cp ${ROOTALIBDIR}/libfreetype.a ${ALICE_ROOT}/alimdc-root/opt/alimdc/lib
-COMMAND cp ${ROOTALIBDIR}/libpcre.a ${ALICE_ROOT}/alimdc-root/opt/alimdc/lib
-COMMAND rm -rf ${ALICE_ROOT}/RPMS
-COMMAND mkdir -p ${ALICE_ROOT}/RPMS/${ALIMDCARCHDIR}/
-COMMAND rpmbuild --verbose --define "_topdir ${ALICE_ROOT}" --define "_tmppath ${ALICE_ROOT}" -bb ${ALIMDCSPECFILE} 
-COMMAND cp -p ${ALICE_ROOT}/RPMS/${ALIMDCARCHDIR}/alimdc-*.rpm .
-COMMAND rm -rf ${ALICE_ROOT}/alimdc-root
-COMMAND rm -rf ${ALICE_ROOT}/RPMS
+COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/alimdc-root
+COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/alimdc-root/opt/alimdc/lib
+COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/alimdc-root/opt/alimdc/include
+COMMAND cp ${ALICE_ROOT}/RAW/mdc.h ${CMAKE_CURRENT_BINARY_DIR}/alimdc-root/opt/alimdc/include
+COMMAND cp ${LIBPATH}/libAliMDC.a ${CMAKE_CURRENT_BINARY_DIR}/alimdc-root/opt/alimdc/lib
+COMMAND cp ${ROOTALIBDIR}/libRoot.a ${CMAKE_CURRENT_BINARY_DIR}/alimdc-root/opt/alimdc/lib
+COMMAND cp ${ROOTALIBDIR}/liblzma.a ${CMAKE_CURRENT_BINARY_DIR}/alimdc-root/opt/alimdc/lib
+COMMAND cp ${ROOTALIBDIR}/libpcre.a ${CMAKE_CURRENT_BINARY_DIR}/alimdc-root/opt/alimdc/lib
+COMMAND cp ${ROOTALIBDIR}/libfreetype.a ${CMAKE_CURRENT_BINARY_DIR}/alimdc-root/opt/alimdc/lib
+COMMAND cp ${ROOTALIBDIR}/libpcre.a ${CMAKE_CURRENT_BINARY_DIR}/alimdc-root/opt/alimdc/lib
+COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/RPMS
+COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/RPMS/${ALIMDCARCHDIR}/
+COMMAND rpmbuild --verbose --define "_topdir ${CMAKE_CURRENT_BINARY_DIR}" --define "%buildroot ${CMAKE_CURRENT_BINARY_DIR}/alimdc-root" -bb ${ALIMDCSPECFILE} 
+COMMAND cp -p ${CMAKE_CURRENT_BINARY_DIR}/RPMS/${ALIMDCARCHDIR}/alimdc-*.rpm .
+COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/alimdc-root
+COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/RPMS
 COMMAND echo "***** alimdc RPM created and put in ${CMAKE_BINARY_DIR} folder *****"
 )
 
@@ -366,64 +369,6 @@ COMMAND mkdir-p ${RAWDIRO}
 )
 
 
-add_custom_target( alimdc-specfile
-DEPENDS ${RAWDIRO}
-)
-
-add_custom_command( 
-TARGET alimdc-specfile
-POST_BUILD
-COMMAND rm -rf ${ALIMDCSPECFILE}
-COMMAND @echo "***** Making alimdc RPM spec-file ${ALIMDCSPECFILE} *****"
-COMMAND @echo '\# RPM specfile for alimdc static libs' >> ${ALIMDCSPECFILE} 
-COMMAND @echo '\# Package contains both ROOT and AliRoot' >> ${ALIMDCSPECFILE}
-COMMAND @echo '\# static libs needed by mStreamRecorder' >> ${ALIMDCSPECFILE}
-COMMAND @echo '\# in order to ROOT-ify the incoming raw' >> ${ALIMDCSPECFILE}
-COMMAND @echo '\# data' >> ${ALIMDCSPECFILE}
-COMMAND @echo '\# Example how-to build alimdc RPM:' >> ${ALIMDCSPECFILE}
-COMMAND @echo '\# cd ${ALICE_ROOT}' >> ${ALIMDCSPECFILE}
-COMMAND @echo '\# make alimdc-rpm' >> ${ALIMDCSPECFILE}
-COMMAND @echo "" >> ${ALIMDCSPECFILE}
-COMMAND @echo "Summary: AliMDC static libraries" >> ${ALIMDCSPECFILE}
-COMMAND @echo "Name: alimdc" >> ${ALIMDCSPECFILE}
-COMMAND @echo "Version:  ${ALIROOT_BRANCH_SPEC}" >> ${ALIMDCSPECFILE}
-COMMAND @echo "Release: ${ALIROOT_REVISION}" >> ${ALIMDCSPECFILE}
-COMMAND @echo '\# Copyright: CERN Alice Off-line' >> ${ALIMDCSPECFILE}
-COMMAND @echo "License: CERN Alice Off-line" >> ${ALIMDCSPECFILE}
-COMMAND @echo "Vendor: ALICE Core Off-line Group" >> ${ALIMDCSPECFILE}
-COMMAND @echo "URL: http://aliceinfo.cern.ch" >> ${ALIMDCSPECFILE}
-COMMAND @echo "Group: Applications/Alice" >> ${ALIMDCSPECFILE}
-COMMAND @echo "Prefix: /opt/%{name}" >> ${ALIMDCSPECFILE}
-COMMAND @echo "BuildRoot: %{_tmppath}/%{name}-root" >> ${ALIMDCSPECFILE}
-COMMAND @echo "" >> ${ALIMDCSPECFILE}
-COMMAND @echo '\# automatic dependencies' >> ${ALIMDCSPECFILE}
-COMMAND @echo "AutoReqProv: yes" >> ${ALIMDCSPECFILE}
-COMMAND @echo "" >> ${ALIMDCSPECFILE}
-COMMAND @echo '\# list here required RPM packages for runtime' >> ${ALIMDCSPECFILE}
-COMMAND @echo "Requires: glibc" >> ${ALIMDCSPECFILE}
-COMMAND @echo "" >> ${ALIMDCSPECFILE}
-COMMAND @echo "Provides: alimdc" >> ${ALIMDCSPECFILE}
-COMMAND @echo "" >> ${ALIMDCSPECFILE}
-COMMAND @echo '\# description of the package' >> ${ALIMDCSPECFILE}
-COMMAND @echo "%description" >> ${ALIMDCSPECFILE}
-COMMAND @echo "Package contains both ROOT and AliRoot" >> ${ALIMDCSPECFILE}
-COMMAND @echo "static libs needed by mStreamRecorder" >> ${ALIMDCSPECFILE}
-COMMAND @echo "in order to ROOT-ify the incoming raw" >> ${ALIMDCSPECFILE}
-COMMAND @echo "data. The package version correspond to" >> ${ALIMDCSPECFILE}
-COMMAND @echo "the AliRoot one." >> ${ALIMDCSPECFILE}
-COMMAND @echo "" >> ${ALIMDCSPECFILE}
-COMMAND @echo '\# list of files to be installed' >> ${ALIMDCSPECFILE}
-COMMAND @echo "%files" >> ${ALIMDCSPECFILE}
-COMMAND @echo "%defattr (-,root,root)" >> ${ALIMDCSPECFILE}
-COMMAND @echo "%{prefix}/lib/libAliMDC.a" >> ${ALIMDCSPECFILE}
-COMMAND @echo "%{prefix}/lib/libRoot.a" >> ${ALIMDCSPECFILE}
-COMMAND @echo "%{prefix}/lib/libpcre.a" >> ${ALIMDCSPECFILE}
-COMMAND @echo "%{prefix}/lib/liblzma.a" >> ${ALIMDCSPECFILE}
-COMMAND @echo "%{prefix}/lib/libfreetype.a" >> ${ALIMDCSPECFILE}
-COMMAND @echo "%{prefix}/include/mdc.h" >> ${ALIMDCSPECFILE}
-)
-
-
 add_custom_target( alimdc-static
 DEPENDS ${LIBPATH} ${BINPATH} RAW-all-static STEER-all-static )
 
diff --git a/RAW/alimdc.spec.in b/RAW/alimdc.spec.in
new file mode 100644 (file)
index 0000000..6ec1ff3
--- /dev/null
@@ -0,0 +1,34 @@
+# AliRoot MDC rpm creation using static libraries
+
+# RPM Naming Tags
+Name: alimdc
+Version:  @ALIROOT_BRANCH_SPEC@
+Release: @GIT_SHA1@
+Summary: AliRoot MDC static libraries
+License: CERN Alice Offline
+Vendor: ALICE Core Offline Group
+URL: http://aliceinfo.cern.ch
+Group: Applications/Alice
+Packager: Alina Grigoras <alina.gabriela.grigoras@cern.ch>
+
+# RPM Dependencies tags
+AutoReqProv: yes
+Provides: alimdc
+
+# PRM Directory-related Tags
+Prefix: /opt/%{name}
+BuildRoot: /@CMAKE_CURRENT_BINARY_DIR@/%{name}-root
+
+%description
+Package contains both ROOT and AliRoot static libs needed by mStreamRecorder
+in order to ROOT-ify the incoming raw data. The package version correspond to
+the AliRoot one.
+
+%files
+%defattr ( -,root,root ) 
+%{prefix}/lib/libAliMDC.a
+%{prefix}/lib/libRoot.a
+%{prefix}/lib/libpcre.a
+%{prefix}/lib/liblzma.a
+%{prefix}/lib/libfreetype.a
+%{prefix}/include/mdc.h