Skip to content

Commit

Permalink
rename scripts to have extensions for automatic syntax highlighting
Browse files Browse the repository at this point in the history
python scripts do not have standard shebangs that editors can use
also fixes accidental creation of gufi_client_jail during make install
    gufi_jail should only exist on the server side
  • Loading branch information
calccrypto committed Nov 2, 2023
1 parent 4cfba13 commit d4458af
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,13 @@

cmake_minimum_required(VERSION 3.1.0)

# gufi_* scripts
# gufi_*.py scripts
set(TOOLS
find
getfattr
ls
stat
stats

jail # gufi_jail is used by sshd_config to prevent commands other than gufi_* from running
)

# python libraries installed into bin for convenience
Expand All @@ -82,32 +80,37 @@ set(LIBRARIES
if (CLIENT)
# add the paramiko source for installing
# keep the trailing / to rename the directory
install(DIRECTORY ${DEP_BUILD_PREFIX}/paramiko-master/ DESTINATION lib/GUFI/paramiko COMPONENT Client)
install(DIRECTORY "${DEP_BUILD_PREFIX}/paramiko-master/" DESTINATION lib/GUFI/paramiko COMPONENT Client)
endif()

foreach(TOOL ${TOOLS})
configure_file(gufi_${TOOL} gufi_${TOOL} @ONLY)
configure_file("gufi_${TOOL}.py" "gufi_${TOOL}" @ONLY)

install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/gufi_${TOOL} DESTINATION bin COMPONENT Server)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/gufi_${TOOL}" DESTINATION bin COMPONENT Server)

# when running make install, client files will not overwrite server files
# when building, client files WILL NOT overwrite server files
# when installing, client files WILL overwrite server files
if (CLIENT)
configure_file(gufi_client gufi_client_${TOOL} @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/gufi_client_${TOOL}
RENAME gufi_${TOOL}
configure_file("gufi_client.py" "gufi_client_${TOOL}" @ONLY)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/gufi_client_${TOOL}"
RENAME "gufi_${TOOL}"
DESTINATION bin
COMPONENT Client)
endif()
endforeach()

# gufi_jail is used by sshd_config to prevent commands other than gufi_* from running
configure_file(gufi_jail gufi_jail @ONLY)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/gufi_jail" DESTINATION bin COMPONENT Server)

foreach(LIB ${LIBRARIES})
configure_file(${LIB} ${LIB} @ONLY)
configure_file("${LIB}" "${LIB}" @ONLY)

install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${LIB} DESTINATION bin COMPONENT Server)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${LIB}" DESTINATION bin COMPONENT Server)

# when running make install, client files will not overwrite server files
if (CLIENT)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIB} DESTINATION bin COMPONENT Client)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LIB}" DESTINATION bin COMPONENT Client)
endif()
endforeach()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d4458af

Please sign in to comment.