Skip to content
Snippets Groups Projects
Commit f4cde41d authored by Eric Cano's avatar Eric Cano
Browse files

Added compilation of gc, hsmtools and dbtools.

Some source files were renamed when they did not match the name of the command line utility they generated. Imakefile also updated accordingly.
Added necessary support for python in main CMakeLists.txt (very similar to oracle's).
parent e1633e82
Branches
Tags
No related merge requests found
......@@ -49,6 +49,21 @@ set (CASTOR_DEST_BIN_DIR /usr/bin)
set (CASTOR_DEST_LIB_DIR /usr/lib64)
set (CASTOR_DEST_MAN_DIR /usr/share/man)
set (CASTOR_DEST_INCLUDE_DIR /usr/include)
set (CASTOR_DEST_PERL_LIBDIR /usr/lib/perl/CASTOR)
execute_process (COMMAND python ${CMAKE_SOURCE_DIR}/config/pycompile.py --libs
OUTPUT_VARIABLE CASTOR_PYTHON_LIBS)
string(REGEX REPLACE "\n" "" CASTOR_PYTHON_LIBS ${CASTOR_PYTHON_LIBS})
message(STATUS "CASTOR_PYTHON_LIBS = '${CASTOR_PYTHON_LIBS}'")
execute_process (COMMAND python ${CMAKE_SOURCE_DIR}/config/pycompile.py --inc
OUTPUT_VARIABLE CASTOR_PYTHON_INC)
string(REGEX REPLACE "\n" "" CASTOR_PYTHON_INC ${CASTOR_PYTHON_INC})
message(STATUS "CASTOR_PYTHON_INC = '${CASTOR_PYTHON_INC}'")
execute_process (
COMMAND python -c "from distutils import sysconfig; print sysconfig.get_python_lib()"
OUTPUT_VARIABLE CASTOR_DEST_PYTHON_LIBDIR)
string(REGEX REPLACE "\n" "" CASTOR_DEST_PYTHON_LIBDIR ${CASTOR_DEST_PYTHON_LIBDIR})
message(STATUS "CASTOR_DEST_PYTHON_LIBDIR = '${CASTOR_DEST_PYTHON_LIBDIR}'")
set (CASTOR_MAN_PAGE_PERMS
OWNER_READ OWNER_WRITE
......@@ -160,6 +175,13 @@ function (CastorInstallSysconfig _name)
RENAME ${_name})
endfunction ()
function (CastorInstallSysconfigExample _name)
install (FILES ${_name}.sysconfig
DESTINATION /etc/sysconfig
PERMISSIONS ${CASTOR_SYSCONFIG_PERMS}
RENAME ${_name}.example)
endfunction ()
set (CASTOR_INITSCRIPT_PERMS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
......@@ -190,6 +212,16 @@ function (CastorInstallConfigFileLowercase _name)
RENAME ${_name}.example)
endfunction ()
set (CASTOR_SCRIPT_PERMS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)
set (CASTOR_PYTHON_LIB_PERMS
OWNER_READ OWNER_WRITE
GROUP_READ
WORLD_READ )
set (CMAKE_C_FLAGS
"-pthread -fPIC -Wall -Wextra -Werror -Wno-unused-parameter")
......@@ -240,6 +272,8 @@ add_subdirectory (vmgr)
add_subdirectory (h)
add_subdirectory (config)
add_subdirectory (shlib)
add_subdirectory (hsmtools)
add_subdirectory (client/src/stager)
if(${COMPILE_SERVER} STREQUAL "1")
add_subdirectory (tape)
endif(${COMPILE_SERVER} STREQUAL "1")
......@@ -266,6 +300,7 @@ if(${COMPILE_PACKAGING} STREQUAL "1")
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE result)
if(NOT ${result} STREQUAL "")
string(REGEX REPLACE "\n$" "" result ${result})
message(STATUS "${result}")
endif(NOT ${result} STREQUAL "")
RPMTools_ADD_RPM_TARGETS(
......
......@@ -25,6 +25,7 @@ cmake_minimum_required (VERSION 2.6)
add_subdirectory (db)
add_subdirectory (tape)
add_subdirectory (vdqm)
add_subdirectory (gc)
################################################################################
# Rules to build and install libcastorclient.so
......@@ -264,3 +265,9 @@ set_target_properties (castorclient
PROPERTIES SOVERSION ${MAJOR_CASTOR_VERSION})
target_link_libraries (castorclient castordlf)
install (TARGETS castorclient DESTINATION ${CASTOR_DEST_LIB_DIR})
################################################################################
# Create shared directory strcutures at install time
################################################################################
INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}/var/log/castor)")
INSTALL(CODE "FILE(MAKE_DIRECTORY \$ENV{DESTDIR}/var/spool/castor)")
# CMakeLists.txt
#
# This file is part of the Castor project.
# See http://castor.web.cern.ch/castor
#
# Copyright (C) 2003 CERN
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
# Steven.Murray@cern.ch Eric.Cano@cern.ch
#
cmake_minimum_required (VERSION 2.6)
################################################################################
# Rules to build and install gc
################################################################################
set(GCBIN_SRCS
GcDaemon.cpp
DeletionThread.cpp
SynchronizationThread.cpp)
add_executable (gcd ${GCBIN_SRCS})
target_link_libraries (gcd castorcommon castordlf castorns castorclient)
install (TARGETS gcd DESTINATION ${CASTOR_DEST_BIN_DIR})
################################################################################
# Rules to install gc's man page(s) and init scripts
################################################################################
CastorInstallInitScript(gcd)
CastorInstallSysconfigExample(gcd)
CastorInstallLogrotate(castor-gc-server)
CastorInstallAdmManPage(gcd)
\ No newline at end of file
# CMakeLists.txt
#
# This file is part of the Castor project.
# See http://castor.web.cern.ch/castor
#
# Copyright (C) 2003 CERN
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
# Steven.Murray@cern.ch Eric.Cano@cern.ch
#
cmake_minimum_required (VERSION 2.6)
################################################################################
# Rules to build stager client tools
################################################################################
set(STAGER_CLIENT_PROGS
stager_get
stager_update
stager_put
stager_putdone
stager_qry
stager_rm
stager_setfilegcweight
castor
stager_addprivilege
stager_removeprivilege
stager_abort
stager_listprivileges
)
foreach(PROG ${STAGER_CLIENT_PROGS})
add_executable(${PROG} ${PROG})
target_link_libraries (${PROG} castorcommon castorns castorclient)
endforeach(PROG)
install(TARGETS ${STAGER_CLIENT_PROGS}
DESTINATION ${CASTOR_DEST_BIN_DIR})
################################################################################
# Rules to install hsmtools's man page(s) and init scripts
################################################################################
set(STAGER_CLIENT_MAN_PAGES
stager_get
stager_update
stager_put
stager_putdone
stager_qry
stager_rm
stager_setfilegcweight
stager_addprivilege
stager_removeprivilege
stager_listprivileges
stager_abort)
foreach(PAGE ${STAGER_CLIENT_MAN_PAGES})
CastorInstallExeManPage(${PAGE})
endforeach(PAGE)
......@@ -15,11 +15,11 @@ ClientProgramTarget(stager_put,stager_put.o,,,0755)
ClientProgramTarget(stager_putdone,stager_putdone.o,,,0755)
ClientProgramTarget(stager_qry,stager_qry.o,,,0755)
ClientProgramTarget(stager_rm,stager_rm.o,,,0755)
ClientProgramTarget(stager_setfilegcweight,stager_setFileGCWeight.o,,,0755)
ClientProgramTarget(stager_setfilegcweight,stager_setfilegcweight.o,,,0755)
ClientProgramTarget(castor,castor.o,,,0755)
ClientProgramTarget(stager_addprivilege,stager_addPrivilege.o,,,0755)
ClientProgramTarget(stager_removeprivilege,stager_removePrivilege.o,,,0755)
ClientProgramTarget(stager_listprivileges,stager_listPrivileges.o,,,0755)
ClientProgramTarget(stager_addprivilege,stager_addprivilege.o,,,0755)
ClientProgramTarget(stager_removeprivilege,stager_removeprivilege.o,,,0755)
ClientProgramTarget(stager_listprivileges,stager_listprivileges.o,,,0755)
NormalProgramTarget(stager_abort,stager_abort.o,,,0755)
CLIENTEXEMANPAGE(stager_get)
......
# CMakeLists.txt
#
# This file is part of the Castor project.
# See http://castor.web.cern.ch/castor
#
# Copyright (C) 2003 CERN
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
# Steven.Murray@cern.ch Eric.Cano@cern.ch
#
cmake_minimum_required (VERSION 2.6)
################################################################################
# Rules to build and install hsmtools
################################################################################
# We rely here on a hacked version of rfcp
add_custom_command (
OUTPUT rfcpupd.c
DEPENDS ${CMAKE_SOURCE_DIR}/rfio/rfcp.c
COMMAND
cp ${CMAKE_SOURCE_DIR}/rfio/rfcp.c ${CMAKE_CURRENT_BINARY_DIR}/rfcpupd.c
COMMAND
sed -i 's/| *O_TRUNC//' ${CMAKE_CURRENT_BINARY_DIR}/rfcpupd.c
COMMAND
sed -i 's/O_WRONLY/O_RDWR|O_APPEND/' ${CMAKE_CURRENT_BINARY_DIR}/rfcpupd.c)
# The c programs
set(HSM_SINGLE_FILE_C_TARGETS
adler32
c2probe
reclaim
rfcpupd)
foreach(TOOL ${HSM_SINGLE_FILE_C_TARGETS})
add_executable(${TOOL} ${TOOL}.c)
target_link_libraries (${TOOL} castorcommon castorns castorclient castorrfio castorvmgr)
endforeach(TOOL)
target_link_libraries (adler32 -lz)
# The c++ programs
set(HSM_SINGLE_FILE_CPP_TARGETS
stager_actualget
stager_actualput)
foreach(TOOL ${HSM_SINGLE_FILE_CPP_TARGETS})
add_executable(${TOOL} ${TOOL}.cpp)
target_link_libraries (${TOOL} castorcommon castorns castorclient castorrfio castorvmgr)
endforeach(TOOL)
# Common installation
install(TARGETS ${HSM_SINGLE_FILE_C_TARGETS} ${HSM_SINGLE_FILE_CPP_TARGETS}
DESTINATION ${CASTOR_DEST_BIN_DIR})
# The scripts
set(HSM_SCRIPTS
repack
enterfileclass
deletefileclass
printfileclass
entersvcclass
modifysvcclass
deletesvcclass
printsvcclass
enterdiskpool
deletediskpool
printdiskpool
enterrecallgroup
modifyrecallgroup
deleterecallgroup
printrecallgroup
enterrecalluser
modifyrecalluser
deleterecalluser
printrecalluser
entertapepool
modifytapepool
deletetapepool
printtapepool
entermigrationroute
modifymigrationroute
deletemigrationroute
printmigrationroute
modifydiskserver
deletediskserver
printdiskserver
modifydbconfig
printdbconfig
fixFileSize
deletediskcopy
diskserver_qry
draindiskserver
migratenewcopy
vdqmlistpriority
vdqmlistrequest
vdqmsetpriority
vdqmdeletepriority
printmigrationstatus
printrecallstatus
printrecallfilestatus
printrecalltapequeue
printrecalluserqueue
)
install(FILES ${HSM_SCRIPTS}
DESTINATION ${CASTOR_DEST_BIN_DIR}
PERMISSIONS ${CASTOR_SCRIPT_PERMS})
# The libraries
install(FILES castor_tools.py dlf.py
DESTINATION ${CASTOR_DEST_PYTHON_LIBDIR}
PERMISSIONS ${CASTOR_PYTHON_LIB_PERMS})
install(FILES castor_tools.pm
DESTINATION ${CASTOR_DEST_PERL_LIBDIR}
PERMISSIONS ${CASTOR_SCRIPT_PERMS})
################################################################################
# Rules to install hsmtools's man page(s) and init scripts
################################################################################
set(HSM_MAN_PAGES
adler32
adminMultiInstance
c2probe
deletediskcopy
deletediskpool
deletediskserver
deletefileclass
deletemigrationroute
deleterecallgroup
deleterecalluser
deletesvcclass
deletetapepool
diskserver_qry
draindiskserver
enterdiskpool
enterfileclass
entermigrationroute
enterrecallgroup
enterrecalluser
entersvcclass
entertapepool
migratenewcopy
modifydbconfig
modifydiskserver
modifymigrationroute
modifyrecallgroup
modifyrecalluser
modifysvcclass
modifytapepool
printdbconfig
printdiskpool
printdiskserver
printfileclass
printmigrationroute
printmigrationstatus
printrecallfilestatus
printrecallgroup
printrecallstatus
printrecalltapequeue
printrecalluser
printrecalluserqueue
printsvcclass
printtapepool
reclaim
repack
vdqmdeletepriority
vdqmlistpriority
vdqmlistrequest
vdqmsetpriority)
foreach(PAGE ${HSM_MAN_PAGES})
CastorInstallExeManPage(${PAGE})
endforeach(PAGE)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment