<commit_before>
 ###############################################################
 #
 # Copyright 2011 Red Hat, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License"); you
 # may not use this file except in compliance with the License.  You may
 # obtain a copy of the License at
 #
 #    http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
 ###############################################################


##################################################################
## Begin the CPACK variable on-slaught.
##
## Start with the common section.
##################################################################
set (PACKAGE_REVISION "${BUILDID}")
set (CPACK_PACKAGE_NAME ${PACKAGE_NAME})
set (CPACK_PACKAGE_VENDOR "Condor Team - University of Wisconsin Madison")
set (CPACK_PACKAGE_VERSION ${PACKAGE_VERSION})
set (CPACK_PACKAGE_CONTACT "<EMAIL>")
set (URL "http://www.cs.wisc.edu/condor/")
set (CONDOR_VERSION "${PACKAGE_NAME}-${PACKAGE_VERSION}")
GET_TIMEDATE( BUILD_TIMEDATE )

if(PRE_RELEASE)
  if(BUILDID)
    CLEAN_STRING( CLEAN_BUILDID "${BUILDID}" )
    set (CONDOR_PACKAGE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}-${CLEAN_BUILDID}")
    set (CONDOR_TEST_PACKAGE_NAME "${TEST_PACKAGE_NAME}-${PACKAGE_VERSION}-${CLEAN_BUILDID}")
  elseif(BUILD_DATETIME)
    set (CONDOR_PACKAGE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}-${BUILD_TIMEDATE}")
    set (CONDOR_TEST_PACKAGE_NAME "${TEST_PACKAGE_NAME}-${PACKAGE_VERSION}-${BUILD_TIMEDATE}")
  else()
    CLEAN_STRING( CLEAN_RELEASE "${PRE_RELEASE}" )
    set (CONDOR_PACKAGE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}-${CLEAN_RELEASE}")
    set (CONDOR_TEST_PACKAGE_NAME "${TEST_PACKAGE_NAME}-${PACKAGE_VERSION}-${CLEAN_RELEASE}")
  endif(BUILDID)
else()
  set (CONDOR_PACKAGE_NAME "${CONDOR_VERSION}")
  set (CONDOR_TEST_PACKAGE_NAME "${TEST_PACKAGE_NAME}-${CONDOR_VERSION}")
endif()

set (CPACK_PACKAGE_DESCRIPTION "Condor is a specialized workload management system for
compute-intensive jobs. Like other full-featured batch systems,
Condor provides a job queueing mechanism, scheduling policy,
priority scheme, resource monitoring, and resource management.
Users submit their serial or parallel jobs to Condor, Condor places
them into a queue, chooses when and where to run the jobs based
upon a policy, carefully monitors their progress, and ultimately
informs the user upon completion.")

set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Condor: High Throughput Computing")

# Debian need this indentation to look nicely
# Short describtion (1st line) copied from Ubuntu's package description
set(CPACK_DEBIAN_DESCRIPTION_SUMMARY "a workload management system for compute-intensive jobs
 Condor is a specialized workload management system for
 compute-intensive jobs. Condor provides a job queueing mechanism,
 scheduling policy, priority scheme, resource monitoring,
 and resource management. Users submit their serial or parallel jobs
 to Condor, Condor places them into a queue, chooses when and where
 to run the jobs based upon a policy, carefully monitors their progress,
 and ultimately informs the user upon completion.")

set(CPACK_RESOURCE_FILE_LICENSE "${CONDOR_SOURCE_DIR}/LICENSE-2.0.txt")
#set(CPACK_RESOURCE_FILE_README "${CONDOR_SOURCE_DIR}/build/backstage/release_notes/README")
#set(CPACK_RESOURCE_FILE_WELCOME "${CONDOR_SOURCE_DIR}/build/backstage/release_notes/DOC") # this should be more of a Hiya welcome.

if(SYSTEM_NAME)
  set(CPACK_SYSTEM_NAME "${SYSTEM_NAME}" )
else()
  set(CPACK_SYSTEM_NAME "${OS_NAME}-${SYS_ARCH}" )
endif()
set(CPACK_TOPLEVEL_TAG "${OS_NAME}-${SYS_ARCH}" )
set(CPACK_PACKAGE_ARCHITECTURE ${SYS_ARCH} )

# always strip the source files.
set(CPACK_SOURCE_STRIP_FILES TRUE)

# here is where we can
if (PLATFORM)
  set (CPACK_PACKAGE_FILE_NAME "${CONDOR_PACKAGE_NAME}-${PLATFORM}" )
  set (CPACK_TEST_PACKAGE_FILE_NAME "${CONDOR_TEST_PACKAGE_NAME}-${PLATFORM}" )
elseif(SYSTEM_NAME)
  set (CPACK_PACKAGE_FILE_NAME "${CONDOR_PACKAGE_NAME}-${SYSTEM_NAME}" )
  set (CPACK_TEST_PACKAGE_FILE_NAME "${CONDOR_TEST_PACKAGE_NAME}-${SYSTEM_NAME}" )
else()
  set (CPACK_PACKAGE_FILE_NAME "${CONDOR_PACKAGE_NAME}-${OS_NAME}-${SYS_ARCH}" )
  set (CPACK_TEST_PACKAGE_FILE_NAME "${CONDOR_TEST_PACKAGE_NAME}-${OS_NAME}-${SYS_ARCH}" )
endif()

# you can enable/disable file stripping.
option(CONDOR_STRIP_PACKAGES "Enables stripping of packaged binaries" ON)
set(CPACK_STRIP_FILES ${CONDOR_STRIP_PACKAGES})
if (NOT CONDOR_STRIP_PACKAGES)
  set (PACKAGE_REVISION "${PACKAGE_REVISION}+symbols" )
  set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-unstripped" )
else()
  set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-stripped" )
endif()

##################################################################
## Now onto platform specific package generation
## http://www.itk.org/Wiki/CMake:CPackPackageGenerators
##################################################################

#option used to enable/disable make package for rpm/deb with different install paths
option(CONDOR_PACKAGE_BUILD "Enables a package build" OFF)

# 1st set the location of the install targets, these are the defaults for
set( C_BIN			bin)
set( C_LIB			lib)
set( C_LIB_PUBLIC		lib)
set( C_LIB32		lib)
set( C_LIBEXEC		libexec )
set( C_SBIN			sbin)

set( C_PYTHONARCHLIB lib/python)

set( C_INCLUDE		include)
set( C_INCLUDE_PUBLIC		include)
set( C_MAN			man)
set( C_SRC			src)
set( C_SQL			sql)
set( C_SERVICES     services)

set( C_INIT			etc/init.d )
set( C_ETC			etc/examples )
set( C_CONFIGD		etc/condor/config.d )
set( C_GANGLIAD		etc/condor/ganglia.d )
set( C_SYSCONFIG	etc/sysconfig )

set( C_ETC_EXAMPLES etc/examples )
set( C_SHARE_EXAMPLES .)
set( C_DOC			. )

set( C_LOCAL_DIR	var/lib/condor )
set( C_LOG_DIR		var/log/condor )
set( C_LOCK_DIR		var/lock/condor )
set( C_RUN_DIR		var/run/condor )
# NOTE: any RPATH should use these variables + PREFIX for location

# set a default generator
set ( CPACK_GENERATOR "TGZ" )

# Here, we set CONDOR_RPATH for the tarball build. If we're doing a native
# package build, it'll be overwritten further below. EXTERNALS_RPATH must
# include both paths, as we build the externals once for both types. The
# settings for EXTERNALS_RPATH must be kept in synch with the C_LIB
# settings made below for package builds.
if ( ${OS_NAME} STREQUAL "LINUX" )
	set( EXTERNALS_LIB "${C_LIB}/condor" )
	if (${BIT_MODE} MATCHES "32" OR ${SYS_ARCH} MATCHES "IA64" )
		if ( ${SYSTEM_NAME} MATCHES "rhel3" )
			message (FATAL_ERROR "ERROR: RHEL3 is EOL you are trying to build new packages on a deprecated platform")
		else()
			set( CONDOR_RPATH "$ORIGIN/../lib:/lib:/usr/lib:$ORIGIN/../lib/condor:/usr/lib/condor" )
			set( EXTERNALS_RPATH "$ORIGIN/../lib:/lib:/usr/lib:$ORIGIN/../lib/condor:/usr/lib/condor" )
			set( PYTHON_RPATH "$ORIGIN/../:/lib:/usr/lib:$ORIGIN/../condor" )
		endif()
	else()
		set( CONDOR_RPATH "$ORIGIN/../lib:/lib64:/usr/lib64:$ORIGIN/../lib/condor:/usr/lib64/condor" )
		set( EXTERNALS_RPATH "$ORIGIN/../lib:/lib64:/usr/lib64:$ORIGIN/../lib/condor:/usr/lib64/condor" )
		set( PYTHON_RPATH "$ORIGIN/../:/lib64:/usr/lib64:$ORIGIN/../condor" )
	endif()
elseif( ${OS_NAME} STREQUAL "DARWIN" )
	set( EXTERNALS_LIB "${C_LIB}/condor" )
endif()

#this needs to be evaluated in order due to WIN collision.
if(${OS_NAME} STREQUAL "DARWIN")
	# enable if we desire native packaging.
	# set ( CPACK_GENERATOR "${CPACK_GENERATOR};PackageMaker" ) ;
	# set (CPACK_OSX_PACKAGE_VERSION)

elseif ( ${OS_NAME} STREQUAL "FREEBSD" )<commit_msg>(#6662) Reduced RPATH for UW RPM builds<commit_after>
 ###############################################################
 #
 # Copyright 2011 Red Hat, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License"); you
 # may not use this file except in compliance with the License.  You may
 # obtain a copy of the License at
 #
 #    http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
 ###############################################################


##################################################################
## Begin the CPACK variable on-slaught.
##
## Start with the common section.
##################################################################
set (PACKAGE_REVISION "${BUILDID}")
set (CPACK_PACKAGE_NAME ${PACKAGE_NAME})
set (CPACK_PACKAGE_VENDOR "Condor Team - University of Wisconsin Madison")
set (CPACK_PACKAGE_VERSION ${PACKAGE_VERSION})
set (CPACK_PACKAGE_CONTACT "<EMAIL>")
set (URL "http://www.cs.wisc.edu/condor/")
set (CONDOR_VERSION "${PACKAGE_NAME}-${PACKAGE_VERSION}")
GET_TIMEDATE( BUILD_TIMEDATE )

if(PRE_RELEASE)
  if(BUILDID)
    CLEAN_STRING( CLEAN_BUILDID "${BUILDID}" )
    set (CONDOR_PACKAGE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}-${CLEAN_BUILDID}")
    set (CONDOR_TEST_PACKAGE_NAME "${TEST_PACKAGE_NAME}-${PACKAGE_VERSION}-${CLEAN_BUILDID}")
  elseif(BUILD_DATETIME)
    set (CONDOR_PACKAGE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}-${BUILD_TIMEDATE}")
    set (CONDOR_TEST_PACKAGE_NAME "${TEST_PACKAGE_NAME}-${PACKAGE_VERSION}-${BUILD_TIMEDATE}")
  else()
    CLEAN_STRING( CLEAN_RELEASE "${PRE_RELEASE}" )
    set (CONDOR_PACKAGE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}-${CLEAN_RELEASE}")
    set (CONDOR_TEST_PACKAGE_NAME "${TEST_PACKAGE_NAME}-${PACKAGE_VERSION}-${CLEAN_RELEASE}")
  endif(BUILDID)
else()
  set (CONDOR_PACKAGE_NAME "${CONDOR_VERSION}")
  set (CONDOR_TEST_PACKAGE_NAME "${TEST_PACKAGE_NAME}-${CONDOR_VERSION}")
endif()

set (CPACK_PACKAGE_DESCRIPTION "Condor is a specialized workload management system for
compute-intensive jobs. Like other full-featured batch systems,
Condor provides a job queueing mechanism, scheduling policy,
priority scheme, resource monitoring, and resource management.
Users submit their serial or parallel jobs to Condor, Condor places
them into a queue, chooses when and where to run the jobs based
upon a policy, carefully monitors their progress, and ultimately
informs the user upon completion.")

set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Condor: High Throughput Computing")

# Debian need this indentation to look nicely
# Short describtion (1st line) copied from Ubuntu's package description
set(CPACK_DEBIAN_DESCRIPTION_SUMMARY "a workload management system for compute-intensive jobs
 Condor is a specialized workload management system for
 compute-intensive jobs. Condor provides a job queueing mechanism,
 scheduling policy, priority scheme, resource monitoring,
 and resource management. Users submit their serial or parallel jobs
 to Condor, Condor places them into a queue, chooses when and where
 to run the jobs based upon a policy, carefully monitors their progress,
 and ultimately informs the user upon completion.")

set(CPACK_RESOURCE_FILE_LICENSE "${CONDOR_SOURCE_DIR}/LICENSE-2.0.txt")
#set(CPACK_RESOURCE_FILE_README "${CONDOR_SOURCE_DIR}/build/backstage/release_notes/README")
#set(CPACK_RESOURCE_FILE_WELCOME "${CONDOR_SOURCE_DIR}/build/backstage/release_notes/DOC") # this should be more of a Hiya welcome.

if(SYSTEM_NAME)
  set(CPACK_SYSTEM_NAME "${SYSTEM_NAME}" )
else()
  set(CPACK_SYSTEM_NAME "${OS_NAME}-${SYS_ARCH}" )
endif()
set(CPACK_TOPLEVEL_TAG "${OS_NAME}-${SYS_ARCH}" )
set(CPACK_PACKAGE_ARCHITECTURE ${SYS_ARCH} )

# always strip the source files.
set(CPACK_SOURCE_STRIP_FILES TRUE)

# here is where we can
if (PLATFORM)
  set (CPACK_PACKAGE_FILE_NAME "${CONDOR_PACKAGE_NAME}-${PLATFORM}" )
  set (CPACK_TEST_PACKAGE_FILE_NAME "${CONDOR_TEST_PACKAGE_NAME}-${PLATFORM}" )
elseif(SYSTEM_NAME)
  set (CPACK_PACKAGE_FILE_NAME "${CONDOR_PACKAGE_NAME}-${SYSTEM_NAME}" )
  set (CPACK_TEST_PACKAGE_FILE_NAME "${CONDOR_TEST_PACKAGE_NAME}-${SYSTEM_NAME}" )
else()
  set (CPACK_PACKAGE_FILE_NAME "${CONDOR_PACKAGE_NAME}-${OS_NAME}-${SYS_ARCH}" )
  set (CPACK_TEST_PACKAGE_FILE_NAME "${CONDOR_TEST_PACKAGE_NAME}-${OS_NAME}-${SYS_ARCH}" )
endif()

# you can enable/disable file stripping.
option(CONDOR_STRIP_PACKAGES "Enables stripping of packaged binaries" ON)
set(CPACK_STRIP_FILES ${CONDOR_STRIP_PACKAGES})
if (NOT CONDOR_STRIP_PACKAGES)
  set (PACKAGE_REVISION "${PACKAGE_REVISION}+symbols" )
  set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-unstripped" )
else()
  set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-stripped" )
endif()

##################################################################
## Now onto platform specific package generation
## http://www.itk.org/Wiki/CMake:CPackPackageGenerators
##################################################################

#option used to enable/disable make package for rpm/deb with different install paths
option(CONDOR_PACKAGE_BUILD "Enables a package build" OFF)

#option used to control RPATH when using rpmbuild directly
option(CONDOR_RPMBUILD "Whether rpmbuild is being used to build HTCondor" OFF)

# 1st set the location of the install targets, these are the defaults for
set( C_BIN			bin)
set( C_LIB			lib)
set( C_LIB_PUBLIC		lib)
set( C_LIB32		lib)
set( C_LIBEXEC		libexec )
set( C_SBIN			sbin)

set( C_PYTHONARCHLIB lib/python)

set( C_INCLUDE		include)
set( C_INCLUDE_PUBLIC		include)
set( C_MAN			man)
set( C_SRC			src)
set( C_SQL			sql)
set( C_SERVICES     services)

set( C_INIT			etc/init.d )
set( C_ETC			etc/examples )
set( C_CONFIGD		etc/condor/config.d )
set( C_GANGLIAD		etc/condor/ganglia.d )
set( C_SYSCONFIG	etc/sysconfig )

set( C_ETC_EXAMPLES etc/examples )
set( C_SHARE_EXAMPLES .)
set( C_DOC			. )

set( C_LOCAL_DIR	var/lib/condor )
set( C_LOG_DIR		var/log/condor )
set( C_LOCK_DIR		var/lock/condor )
set( C_RUN_DIR		var/run/condor )
# NOTE: any RPATH should use these variables + PREFIX for location

# set a default generator
set ( CPACK_GENERATOR "TGZ" )

# Here, we set CONDOR_RPATH for the tarball build. If we're doing a native
# package build, it'll be overwritten further below. EXTERNALS_RPATH must
# include both paths, as we build the externals once for both types. The
# settings for EXTERNALS_RPATH must be kept in synch with the C_LIB
# settings made below for package builds.
if ( ${OS_NAME} STREQUAL "LINUX" )
	set( EXTERNALS_LIB "${C_LIB}/condor" )
	if (${BIT_MODE} MATCHES "32" OR ${SYS_ARCH} MATCHES "IA64" )
		set( CONDOR_RPATH "$ORIGIN/../lib:/lib:/usr/lib:$ORIGIN/../lib/condor:/usr/lib/condor" )
		set( EXTERNALS_RPATH "$ORIGIN/../lib:/lib:/usr/lib:$ORIGIN/../lib/condor:/usr/lib/condor" )
		set( PYTHON_RPATH "$ORIGIN/../:/lib:/usr/lib:$ORIGIN/../condor" )
	else()
		set( CONDOR_RPATH "$ORIGIN/../lib:/lib64:/usr/lib64:$ORIGIN/../lib/condor:/usr/lib64/condor" )
		set( EXTERNALS_RPATH "$ORIGIN/../lib:/lib64:/usr/lib64:$ORIGIN/../lib/condor:/usr/lib64/condor" )
		set( PYTHON_RPATH "$ORIGIN/../:/lib64:/usr/lib64:$ORIGIN/../condor" )
	endif()
elseif( ${OS_NAME} STREQUAL "DARWIN" )
	set( EXTERNALS_LIB "${C_LIB}/condor" )
endif()

# Use the limited RPATH when building directly with RPM
if ( CONDOR_RPMBUILD )
	if (${BIT_MODE} MATCHES "32" OR ${SYS_ARCH} MATCHES "IA64" )
	    set( CONDOR_RPATH "/usr/lib:/usr/lib/condor" )
	    set( PYTHON_RPATH "/usr/lib/condor" )
	else()
	    set( CONDOR_RPATH "/usr/lib64:/usr/lib64/condor" )
	    set( PYTHON_RPATH "/usr/lib64/condor" )
	endif ()
endif()

#this needs to be evaluated in order due to WIN collision.
if(${OS_NAME} STREQUAL "DARWIN")
	# enable if we desire native packaging.
	# set ( CPACK_GENERATOR "${CPACK_GENERATOR};PackageMaker" ) ;
	# set (CPACK_OSX_PACKAGE_VERSION)

elseif ( ${OS_NAME} STREQUAL "FREEBSD" )
{'fraction_non_alphanumeric': 0.1577724761426419, 'fraction_numerical': 0.00527373179306881, 'mean_word_length': 5.678825995807128, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5883991', 'n_tokens_mistral': 5592, 'n_tokens_neox': 5410, 'n_words': 1404}