Skip to content
Snippets Groups Projects
Commit 50953318 authored by Martyn Gigg's avatar Martyn Gigg
Browse files

Fix RPM packaging under Python 3

Refs #27631
parent 7eedce06
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# ${DESTDIR}${CMAKE_INSTALL_PREFIX} but this should be evaluated at CPack time # ${DESTDIR}${CMAKE_INSTALL_PREFIX} but this should be evaluated at CPack time
# so escape the $ to its written literally. # so escape the $ to its written literally.
set(PACKAGE_ROOT \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}) set(PACKAGE_ROOT \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX})
set(EXCLUDE_REGEX ".*_template|.*port_v3") set(EXCLUDE_REGEX ".*_template")
set(COMPILE_SCRIPT "message ( \"Byte-compiling Python in ${PACKAGE_ROOT}\")") set(COMPILE_SCRIPT "message ( \"Byte-compiling Python in ${PACKAGE_ROOT}\")")
set( set(
......
...@@ -63,6 +63,8 @@ ${_lib_site_packages} ...@@ -63,6 +63,8 @@ ${_lib_site_packages}
import sys; new = sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p = getattr(sys, '__egginsert', 0); sys.path[p:p] = new; sys.__egginsert = p + len(new) import sys; new = sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p = getattr(sys, '__egginsert', 0); sys.path[p:p] = new; sys.__egginsert = p + len(new)
") ")
# Package PyQt # Package PyQt. We assume this is for Python 3
install(DIRECTORY ${_lib_site_packages}/PyQt4 install(DIRECTORY ${_lib_site_packages}/PyQt4
DESTINATION ${LIB_DIR}) DESTINATION ${LIB_DIR}
PATTERN "__pycache__" EXCLUDE
PATTERN "port_v2" EXCLUDE)
...@@ -30,6 +30,9 @@ if ( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT ) ...@@ -30,6 +30,9 @@ if ( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
set ( CMAKE_INSTALL_PREFIX /opt/mantid${CPACK_PACKAGE_SUFFIX} CACHE PATH "Install path" FORCE ) set ( CMAKE_INSTALL_PREFIX /opt/mantid${CPACK_PACKAGE_SUFFIX} CACHE PATH "Install path" FORCE )
endif() endif()
# Tell rpm to use the appropriate python executable
set(CPACK_RPM_SPEC_MORE_DEFINE "%define __python ${PYTHON_EXECUTABLE}")
# Tell rpm that this package does not own /opt /usr/share/{applications,pixmaps} # Tell rpm that this package does not own /opt /usr/share/{applications,pixmaps}
# Required for Fedora >= 18 and RHEL >= 7 # Required for Fedora >= 18 and RHEL >= 7
set ( CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /opt /usr/share/applications /usr/share/pixmaps ) set ( CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /opt /usr/share/applications /usr/share/pixmaps )
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
# NScD Oak Ridge National Laboratory, European Spallation Source # NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin # & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 + # SPDX - License - Identifier: GPL - 3.0 +
from __future__ import print_function
import math import math
import numpy import numpy
import re import re
...@@ -35,7 +37,7 @@ def parse_mask(xml_name): ...@@ -35,7 +37,7 @@ def parse_mask(xml_name):
det_range_list = re.split(',', det_list_str) det_range_list = re.split(',', det_list_str)
for det_range in det_range_list: for det_range in det_range_list:
print det_range print(det_range)
# int_count = 0 # int_count = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment