# Details for this project # The entries with names which do *not* start with LCFG_ or CPACK_ are # for compatibility only, they are now deprecated. SET(AUTHOR "Paul Anderson ") SET(COMP "file") SET(CPACK_PACKAGE_CONTACT "Paul Anderson ") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The LCFG file component") SET(CPACK_PACKAGE_VERSION "1.1.16") SET(CPACK_RPM_PACKAGE_GROUP "LCFG") SET(CPACK_RPM_PACKAGE_RELEASE "1") SET(CPACK_RPM_PACKAGE_VENDOR "University of Edinburgh") SET(DATE "07/15/08 15:16:01") SET(DESCR "The LCFG file component") SET(GROUP "LCFG") SET(LCFG_ABSTRACT "The LCFG file component") SET(LCFG_AUTHOR "Paul Anderson ") SET(LCFG_DATE "07/15/08 15:16:01") SET(LCFG_FULLNAME "lcfg-file") SET(LCFG_GROUP "LCFG") SET(LCFG_LICENSE "GPLv2") SET(LCFG_NAME "file") SET(LCFG_PLATFORMS "Solaris9, Fedora3, Fedora5, Fedora6, Scientific5") SET(LCFG_RELEASE "1") SET(LCFG_SCHEMA "1") SET(LCFG_TARNAME "lcfg-file-1.1.16.tar.gz") SET(LCFG_VENDOR "University of Edinburgh") SET(LCFG_VERSION "1.1.16") SET(NAME "lcfg-file") SET(ORGANIZATION "University of Edinburgh") SET(PLATFORMS "Solaris9, Fedora3, Fedora5, Fedora6, Scientific5") SET(R "1") SET(RELEASE "1") SET(SCHEMA "1") SET(TARFILE "lcfg-file-1.1.16.tar.gz") SET(V "1.1.16") SET(VENDOR "University of Edinburgh") SET(VERSION "1.1.16") # On Linux these variables allow packagers to make decisions based on # the platform IF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") FIND_PROGRAM(LSB lsb_release) IF(LSB) EXECUTE_PROCESS(COMMAND ${LSB} -s -v OUTPUT_VARIABLE LSB_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) EXECUTE_PROCESS(COMMAND ${LSB} -s -i OUTPUT_VARIABLE DISTRIB_ID OUTPUT_STRIP_TRAILING_WHITESPACE) EXECUTE_PROCESS(COMMAND ${LSB} -s -d OUTPUT_VARIABLE DISTRIB_DESCRIPTION OUTPUT_STRIP_TRAILING_WHITESPACE) EXECUTE_PROCESS(COMMAND ${LSB} -s -r OUTPUT_VARIABLE DISTRIB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE) EXECUTE_PROCESS(COMMAND ${LSB} -s -c OUTPUT_VARIABLE DISTRIB_CODENAME OUTPUT_STRIP_TRAILING_WHITESPACE) IF(${DISTRIB_ID} STREQUAL "FedoraCore") SET(OS_RELEASE ${DISTRIB_RELEASE}) SET(OS_VERSION "fc${OS_RELEASE}") ENDIF() IF(${DISTRIB_ID} STREQUAL "ScientificSL") SET(OS_RELEASE ${DISTRIB_RELEASE}) string(REGEX REPLACE "^([0-9]+)" "\\1" OS_RELEASE ${OS_RELEASE}) SET(OS_VERSION "sl${OS_RELEASE}") ENDIF() ENDIF(LSB) # Architecture-specific installation locations, this is for # Redhat-style systems and would need to be overridden for Debian # systems. IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") SET(LIBDIR "/usr/lib64" CACHE PATH "Library installation location") SET(LIBSECURITYDIR "/lib64/security" CACHE PATH "PAM module installation location") ELSE(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") SET(LIBDIR "/usr/lib" CACHE PATH "Library installation location") SET(LIBSECURITYDIR "/lib/security" CACHE PATH "PAM module installation location") ENDIF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") SET(HAS_PROC "yes") SET(BOOTCOMP "boot") ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") SET(HAS_PROC "no") SET(BOOTCOMP "macboot") SET(OSX_VERSION ${DARWIN_MINOR_VERSION}) ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") # Find the location of the perl executable FIND_PACKAGE(Perl) IF(PERL_FOUND) SET(PERL ${PERL_EXECUTABLE}) ELSE(PERL_FOUND) MESSAGE(FATAL_ERROR "Failed to find perl") ENDIF(PERL_FOUND) SET(PERL_INSTALLDIRS "site" CACHE STRING "Perl installation locations") IF(${PERL_INSTALLDIRS} STREQUAL "vendor") SET(PERL_ARCHDIR "installvendorarch") SET(PERL_LIBDIR "installvendorlib") ELSE(${PERL_INSTALLDIRS} STREQUAL "vendor") SET(PERL_ARCHDIR "installsitearch") SET(PERL_LIBDIR "installsitelib") ENDIF(${PERL_INSTALLDIRS} STREQUAL "vendor") EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \"\$Config{${PERL_ARCHDIR}}\"" OUTPUT_VARIABLE PERL_ARCHDIR) EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \"\$Config{${PERL_LIBDIR}}\"" OUTPUT_VARIABLE PERL_LIBDIR) # Find the location of the bash executable FIND_PROGRAM(SHELL bash) # Compatibility stuff FIND_PROGRAM(EGREP egrep) FIND_PROGRAM(SED sed) FIND_PROGRAM(SORT sort) SET(LCFGOS ${CMAKE_SYSTEM_NAME}) SET(LCFGARCH ${CMAKE_SYSTEM_PROCESSOR}) STRING( REGEX REPLACE "^i[1-6]86$" "i386" LCFGARCH ${LCFGARCH} ) # Variables describing the standard LCFG layout SET(LCFGMAN /usr/share/man CACHE PATH "Base directory for man pages") SET(LCFGLOG /var/lcfg/log CACHE PATH "Directory for log files") SET(LCFGCONF /var/lcfg/conf CACHE PATH "Directory for generated files to be preserved between object runs") SET(LCFGLOCK /var/lcfg/lock CACHE PATH "Directory for lock files") SET(LCFGTMP /var/lcfg/tmp CACHE PATH "Directory for temporary files") SET(LCFGSBIN /usr/sbin CACHE PATH "Directory for system binaries") SET(INITDIR /etc/init.d CACHE PATH "Location of init scripts directory") SET(LCFGPOD /usr/lib/lcfg/doc/pod CACHE PATH "Directory for POD files") SET(LIBMANSECT 3 CACHE STRING "The manual page section for libraries") SET(LCFGCONFIGMSG CACHE STRING "A message to be appended to package descriptions") SET(LCFGCLIENTDEF /usr/lib/lcfg/defaults/client CACHE PATH "Directory for default resource files used by client") SET(MANSECT 8 CACHE STRING "The manual page section for admin commands") SET(LIBMANDIR /usr/share/man/man3 CACHE PATH "The directory for library man pages") SET(LCFGHTML /usr/lib/lcfg/doc/html CACHE PATH "Directory for HTML files") SET(LCFGOM /usr/bin/om CACHE FILEPATH "Location of 'om' program") SET(LCFGDOC /usr/lib/lcfg/doc CACHE PATH "Base directory for documentation") SET(LCFGBIN /usr/bin CACHE PATH "Directory for user binaries") SET(LCFGLIB /usr/lib/lcfg CACHE PATH "Base directory for read-only files") SET(LCFGDATA /usr/lib/lcfg/conf CACHE PATH "Directory for templates and other fixed configuration files") SET(MANDIR /usr/share/man/man8 CACHE PATH "The directory for admin man pages") SET(LCFGVAR /var/lcfg CACHE PATH "Base directory for writeable files") SET(LCFGCOMP /usr/lib/lcfg/components CACHE PATH "Directory for components") SET(LCFGROTATED /etc/logrotate.d CACHE PATH "Directory for log rotate config files") SET(LCFGSTATUS /var/lcfg/status CACHE PATH "Directory for status files") SET(LCFGSERVERDEF /usr/lib/lcfg/defaults/server CACHE PATH "Directory for default resource files used by server") SET(LCFGBIB /usr/lib/lcfg/doc/bib CACHE PATH "Directory for BIB files") SET(LCFGPDF /usr/lib/lcfg/doc/pdf CACHE PATH "Directory for PDF files") SET(CONFIGDIR "${LCFGCONF}/${LCFG_NAME}") SET(ICONDIR "${LCFGDATA}/${LCFG_NAME}/icons") SET(SCRIPTDIR "${LCFGDATA}/${LCFG_NAME}/scripts") SET(MSG " ** Generated file : do not edit **") MACRO(lcfg_translate) CONFIGURE_FILE("file.cin" "./file" @ONLY) CONFIGURE_FILE("file.def.cin" "./file.def" @ONLY) CONFIGURE_FILE("file.pod.cin" "./file.pod" @ONLY) CONFIGURE_FILE("test/run.cin" "test/run" @ONLY) ENDMACRO(lcfg_translate) MACRO(lcfg_add_comp_script compname) IF(EXISTS ${compname}) INSTALL(PROGRAMS ${compname} DESTINATION ${LCFGCOMP}) ENDIF(EXISTS ${compname}) ENDMACRO(lcfg_add_comp_script) MACRO(lcfg_add_schema schema_name schema_ver) SET(schemafile ${schema_name}.def) IF(EXISTS ${schemafile}) STRING(LENGTH ${schema_ver} schema_length) IF(${schema_length} GREATER 0) SET(deffile ${schema_name}-${schema_ver}.def) ELSE(${schema_length} GREATER 0) SET(deffile ${schema_name}.def) ENDIF(${schema_length} GREATER 0) INSTALL(FILES ${schemafile} DESTINATION ${LCFGCLIENTDEF} RENAME ${deffile}) INSTALL(FILES ${schemafile} DESTINATION ${LCFGSERVERDEF} RENAME ${deffile} COMPONENT defaults) ENDIF(EXISTS ${schemafile}) ENDMACRO(lcfg_add_schema) FIND_PROGRAM(PODSTRIP podselect) MACRO(pod_strip in out) IF(PODSTRIP) EXECUTE_PROCESS(COMMAND ${PODSTRIP} ${in} OUTPUT_FILE ${out}) ENDIF(PODSTRIP) ENDMACRO(pod_strip) FIND_PROGRAM(POD2MAN pod2man) MACRO(lcfg_add_man manfile section) INSTALL(FILES ${manfile} DESTINATION ${LCFGMAN}/man${section}) ENDMACRO(lcfg_add_man) MACRO(lcfg_add_pod podfile manfile section) IF(EXISTS ${podfile}) INSTALL(FILES ${podfile} DESTINATION ${LCFGPOD}) IF(POD2MAN) SET(outfile "${manfile}.${section}") EXECUTE_PROCESS(COMMAND ${POD2MAN} --section=${section} --release="Release: ${V}" --center=${GROUP} --date=${DATE} ${podfile} ${outfile}) lcfg_add_man(${outfile} ${section}) ENDIF(POD2MAN) ENDIF(EXISTS ${podfile}) ENDMACRO(lcfg_add_pod) MACRO(lcfg_add_comp_pod compname) SET(podfile "${compname}.pod") SET(manfile "lcfg-${compname}") lcfg_add_pod(${podfile} ${manfile} ${MANSECT}) ENDMACRO(lcfg_add_comp_pod) SET(PERL_LIBSECT 3 CACHE STRING "Manual section for Perl libraries") MACRO(lcfg_add_perl_module file modpath) STRING( REGEX REPLACE "\\.pm" "" modname ${modpath}) STRING( REGEX REPLACE "/" "::" modname ${modname} ) SET(podfile "${modname}.pod") pod_strip(${file} ${podfile}) lcfg_add_pod(${podfile} ${modname} ${PERL_LIBSECT}) GET_FILENAME_COMPONENT(dirname ${modpath} PATH) INSTALL(FILES ${file} DESTINATION "${PERL_LIBDIR}/${dirname}") ENDMACRO(lcfg_add_perl_module) MACRO(lcfg_add_perl_tree) IF(${ARGC} MATCHES 1) SET(dir "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}") ELSE(${ARGC} MATCHES 1) SET(dir ${CMAKE_CURRENT_SOURCE_DIR}) ENDIF(${ARGC} MATCHES 1) FILE(GLOB_RECURSE perlmods RELATIVE ${dir} "*.pm") FOREACH(perlmod ${perlmods}) lcfg_add_perl_module("${dir}/${perlmod}" ${perlmod}) ENDFOREACH(perlmod) ENDMACRO(lcfg_add_perl_tree) MACRO(lcfg_add_doc docfile) IF(EXISTS ${docfile}) INSTALL(FILES ${docfile} DESTINATION ${LCFGDOC}) ENDIF(EXISTS ${docfile}) ENDMACRO(lcfg_add_doc) MACRO(lcfg_add_program location binfile mansect) IF(${ARGC} GREATER 3) IF (${ARGV3} STREQUAL "podstrip") pod_strip(${binfile} "${binfile}.pod") lcfg_add_pod("${binfile}.pod" ${binfile} ${mansect}) ENDIF (${ARGV3} STREQUAL "podstrip") ENDIF(${ARGC} GREATER 3) IF(EXISTS ${binfile}) INSTALL(PROGRAMS ${binfile} DESTINATION ${location}) ENDIF(EXISTS ${binfile}) ENDMACRO(lcfg_add_program) MACRO(lcfg_add_bin binfile) lcfg_add_program(${LCFGBIN} ${binfile} 1 ${ARGV1}) ENDMACRO(lcfg_add_bin) MACRO(lcfg_add_sbin binfile) lcfg_add_program(${LCFGSBIN} ${binfile} 8 ${ARGV1}) ENDMACRO(lcfg_add_sbin) MACRO(lcfg_add_logrotate) IF(EXISTS "logrotate") INSTALL(FILES "logrotate" DESTINATION "${LCFGDATA}/${LCFG_NAME}") ENDIF(EXISTS "logrotate") ENDMACRO(lcfg_add_logrotate) MACRO(lcfg_add_component compname) lcfg_translate() lcfg_add_comp_script(${compname}) lcfg_add_comp_pod(${compname}) lcfg_add_schema(${compname} ${LCFG_SCHEMA}) lcfg_add_logrotate() FOREACH(doc ${DOCFILES}) lcfg_add_doc(${doc}) ENDFOREACH(doc) ENDMACRO(lcfg_add_component)