pax_global_header00006660000000000000000000000064145360353000014511gustar00rootroot0000000000000052 comment=17edee04d1390f6b7aa2d82a3fcf75888b015ec0 gfal2-bindings-v1.12.2/000077500000000000000000000000001453603530000145505ustar00rootroot00000000000000gfal2-bindings-v1.12.2/.gitignore000066400000000000000000000001241453603530000165350ustar00rootroot00000000000000.project .cproject .settings .idea *.rpm *.log *.tar.gz *.gz *.dsc *.egg-info *.pyc gfal2-bindings-v1.12.2/.gitlab-ci.yml000066400000000000000000000107361453603530000172130ustar00rootroot00000000000000stages: - build - test - publish #-------------------------- # Build templates #-------------------------- .build-template: &build-template_definition stage: build script: - ci/fedora-packages.sh - ci/common-rpm-build.sh - mkdir ${CI_JOB_NAME} - cp -rv build/RPMS build/SRPMS ${CI_JOB_NAME} - tree ${CI_JOB_NAME} variables: BRANCH: ${CI_COMMIT_REF_NAME} artifacts: paths: - "$CI_JOB_NAME" #-------------------------- # Build jobs #-------------------------- cc7: image: gitlab-registry.cern.ch/linuxsupport/cc7-base before_script: - if [[ -z "$CI_COMMIT_TAG" ]]; then export RPMBUILD_FLAGS="--without docs" ; fi <<: *build-template_definition alma8: image: gitlab-registry.cern.ch/linuxsupport/alma8-base <<: *build-template_definition alma9: image: gitlab-registry.cern.ch/linuxsupport/alma9-base <<: *build-template_definition fedora-37: image: fedora:37 <<: *build-template_definition fedora-38: image: fedora:38 <<: *build-template_definition fedora-rawhide: image: fedora:rawhide <<: *build-template_definition allow_failure: true when: manual pypi: stage: build image: gitlab-registry.cern.ch/linuxsupport/cc7-base when: manual allow_failure: true script: - yum install -y git python3-pip tree - python3 -m pip install --upgrade pip - python3 -m pip install setuptools - python3 setup.py sdist - cp -rv dist ${CI_JOB_NAME} - tree ${CI_JOB_NAME} artifacts: paths: - "$CI_JOB_NAME" #-------------------------- # Test templates #-------------------------- .test-template: &test-template_definition stage: test script: - dnf install -y git - PLATFORM=${CI_JOB_NAME%-*} - ci/write-repo-file.sh - dnf install -y ${PLATFORM}/RPMS/*/*.rpm - shopt -s expand_aliases - python --version &>/dev/null || alias python=python3 - python test/unit/creat_instance_all.py variables: BRANCH: ${CI_COMMIT_REF_NAME} #-------------------------- # Test jobs #-------------------------- cc7-test: image: gitlab-registry.cern.ch/linuxsupport/cc7-base needs: - job: cc7 before_script: - yum install -y dnf epel-release <<: *test-template_definition alma8-test: image: gitlab-registry.cern.ch/linuxsupport/alma8-base needs: - job: alma8 before_script: - dnf install -y epel-release <<: *test-template_definition alma9-test: image: gitlab-registry.cern.ch/linuxsupport/alma9-base needs: - job: alma9 before_script: - dnf install -y epel-release <<: *test-template_definition fedora-37-test: image: fedora:37 needs: - job: fedora-37 <<: *test-template_definition fedora-38-test: image: fedora:38 needs: - job: fedora-38 <<: *test-template_definition #-------------------------- # Publish templates #-------------------------- .publish-template: &publish-template_definition stage: publish image: gitlab-registry.cern.ch/eos/gitlab-eos/alma9:latest dependencies: - cc7 - alma8 - alma9 - fedora-37 - fedora-38 - fedora-rawhide script: - automount - cat "$repo_passwd" | kinit "$repo_user" - | for platform in cc7 alma8 alma9 fedora-37 fedora-38 fedora-rawhide; do if [[ "${platform}" == "fedora-rawhide" ]] && [[ ! -d ${platform} ]] ; then echo "Skipping ${platform} packages..." ; continue ; fi packaging/gfal2-repo-manager.py --action add --base /eos/project-d/dmc/www/repos/ --ref ${CI_COMMIT_REF_NAME} --packages ${platform}/RPMS/*/*.rpm ${platform}/SRPMS/* done tags: - docker-privileged-xl retry: 2 #-------------------------- # Publish jobs #-------------------------- rpms: <<: *publish-template_definition rules: - if: '$CI_PROJECT_NAMESPACE != "dmc"' when: never - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' when: never - if: '$CI_COMMIT_REF_NAME == "develop" || $CI_COMMIT_TAG != null' - if: '$CI_COMMIT_REF_NAME != "develop" && $CI_COMMIT_TAG == null' when: manual pypi-publish: needs: - job: pypi stage: publish image: gitlab-registry.cern.ch/linuxsupport/cc7-base when: manual script: - PLATFORM=${CI_JOB_NAME%-*} - yum install -y git python3-pip - python3 -m pip install --upgrade pip - python3 -m pip install setuptools twine - twine check ${PLATFORM}/* - python3 -m twine upload --repository-url ${PYPI_REPOSITORY} ${PLATFORM}/* --verbose rules: - if: '$CI_COMMIT_TAG != null' when: manual - when: never gfal2-bindings-v1.12.2/.gitmodules000066400000000000000000000000001453603530000167130ustar00rootroot00000000000000gfal2-bindings-v1.12.2/CMakeLists.txt000066400000000000000000000052071453603530000173140ustar00rootroot00000000000000## cmake build script for gfal2 bindings project (gfal2-bindings) cmake_minimum_required (VERSION 2.6) message("cmake source dir : ${CMAKE_SOURCE_DIR}") # build type set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "build type") set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/") # global options # Find out details if we're on a redhat style platform execute_process (COMMAND rpm -E "%{?fedora}" OUTPUT_VARIABLE FEDORA OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process (COMMAND rpm -E "%{?rhel}" OUTPUT_VARIABLE RHEL OUTPUT_STRIP_TRAILING_WHITESPACE) # load module include(DefineInstallationPaths REQUIRED) include(MacroCopyFile REQUIRED) include(ReleaseDebugAutoFlags REQUIRED) include(CMakeGeneratePkgConfig REQUIRED) set(Boost_NO_BOOST_CMAKE ON) find_package(PythonEasy REQUIRED) if (PYTHON_EXECUTABLE) if(RHEL STREQUAL "7") find_package(Boost COMPONENTS python REQUIRED) endif() endif(PYTHON_EXECUTABLE) if (PYTHON3_CURRENT_VERSION) string(REPLACE "." "" Boost_PYTHON_3_SUFFIX "${PYTHON3_CURRENT_VERSION}") find_library(Boost_PYTHON_3_LIBRARY NAMES boost_python${Boost_PYTHON_3_SUFFIX} boost_python-py${Boost_PYTHON_3_SUFFIX} boost_python3 HINTS ${Boost_LIBRARYDIR} "/usr/lib" "/usr/lib64" ) if (Boost_PYTHON_3_LIBRARY) message(STATUS "Boost Python3 library: ${Boost_PYTHON_3_LIBRARY}") else() message(WARNING "Boost Python3 library not found") endif() endif() #define PROJECT vars set(PROJECT_NAME_MAIN "gfal2-python") # EPYDOC definition for EPEL5 support if (BUILDDOCS) set(EPYDOC_MODULE_PATH "${CMAKE_BINARY_DIR}/src/python2/gfal2.so") set(EPYDOC_MODULE_URL "http://dmc.web.cern.ch/projects/gfal2-python") set(EPYDOC_MODULE_NAME "gfal2") include(MacroAddepydoc REQUIRED) endif (BUILDDOCS) set(VERSION_MAJOR 1) set(VERSION_MINOR 12) set(VERSION_PATCH 2) set(VERSION_STRING ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) add_definitions(-DGFAL2_PYTHON_VERSION="${VERSION_STRING}") # libs checks find_package (GLIB2 REQUIRED) find_package (GTHREAD2 REQUIRED) # GFAL2 find_package(GFAL2 REQUIRED) # Install doc license if (BUILDDOCS) install(FILES "LICENSE" "RELEASE-NOTES" "README" "readme.html" DESTINATION ${DOC_INSTALL_DIR}) endif (BUILDDOCS) add_definitions( -D_FILE_OFFSET_BITS=64 ) add_subdirectory (src) if (NOT SKIP_TESTS) enable_testing() add_subdirectory (test) endif (NOT SKIP_TESTS) if (BUILDDOCS) add_subdirectory(doc) # Install examples install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/example/python/" DESTINATION ${DOC_INSTALL_DIR}/examples) endif (BUILDDOCS) gfal2-bindings-v1.12.2/LICENSE000066400000000000000000000236761453603530000155730ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS gfal2-bindings-v1.12.2/MANIFEST.in000066400000000000000000000001471453603530000163100ustar00rootroot00000000000000include CMakeLists.txt recursive-include src *.cpp *.h CMakeLists.txt recursive-include cmake *.cmake gfal2-bindings-v1.12.2/README000066400000000000000000000003471453603530000154340ustar00rootroot00000000000000***************** gfal2-python ********************* Python bindings for gfal 2.0 More information at: http://dmc.web.cern.ch/projects/gfal2-python Support at : dmc-support@cern.ch https://ggus.eu/pages/home.php gfal2-bindings-v1.12.2/RELEASE-NOTES000066400000000000000000000167101453603530000164460ustar00rootroot00000000000000GFAL2-PYTHON RELEASE NOTES ========================== * Tue Dec 12 2023 Mihai Patrascoiu - 1.12.2-1 ** New Feature - [DMC-1344] - Propagate Scitags during TPC transfers ** Task - [DMC-1392] - Support for Gfal2 Python bindings + Python 3.13 (Fedora 41) * Tue Sep 05 2023 Mihai Patrascoiu - 1.12.1-1 ** Task - [DMC-1327] - DMC packages for Centos Stream 9 - [DMC-1330] - Support for Gfal2 Python bindings compiled with Python 3.11 (Fedora 37) - [DMC-1336] - Data Management Clients for Fedora 36 - [DMC-1359] - Data Management Clients for Fedora 37 - [DMC-1379] - Move DMC projects to Alma8 and Alma9 - [DMC-1385] - Support for Gfal2 Python bindings compiled with Python 3.12 (Fedora 39) (bugzilla#2220000) - [DMC-1387] - Data Management Clients for Fedora 38 - [DMC-1389] - Port Gfal2 Python3 projects away from "distutils" * Fri Jul 08 2022 Joao Lopes - 1.12.0-1 ** Improvement - [DMC-1260] - Expose Gfal2 XRootD eviction via the file API - [DMC-1312] - Provide release file function without token argument in Gfal2 Python bindings - [DMC-1325] - Expose gfal2_archive_poll via Gfal2 Python bindings - [DMC-1326] - Expose gfal2_bring_online_v2 via Gfal2 Python bindings * Mon Mar 07 2022 Mihai Patrascoiu - 1.11.1-1 ** Bug - [DMC-1277] - Use of uninitialized variable in "cred_get" method - [DMC-1287] - GridFTP SEGV during positional read on CentOS 7 ** Improvement - [DMC-1274] - Provide credential delete method in the Gfal2 credential API - [DMC-1308] - Move Data Management Clients to Fedora 34 & 35 * Thu Sep 23 2021 Joao Lopes - 1.11.0-1 ** Epic - [DMC-1249] - Migrate CI infrastructure to gitlab-CI ** Bug - [DMC-1263] - Gfal2 bindings segfault on Python3.9 due to improper GIL release ** New Feature - [DMC-1265] - Export SE token retrieval in Gfal2 Python binding ** Task - [DMC-1250] - Gfal2 packages for Centos8 - [DMC-1264] - Gfal2 packages for Fedora >= 33 * Wed Mar 24 2021 Mihai Patrascoiu - 1.10.1 ** Bug - [DMC-1241] - Segfault when using cred set/clean methods (gfal2-python bindings) - [DMC-1242] - UnicodeDecodeError encountered in Python3 on File read/pread methods (gfal2-python bindings) * Fri Dec 04 2020 Mihai Patrascoiu - 1.10.0 ** Bug - [DMC-1128] - gfal2-python cannot be installed with python 3.6 and 3.7 ** Task - [DMC-1059] - Extend the gfal2 HTTP plugin to implement CDMI QoS operations - [DMC-1180] - merge f29+ and EPEL8 changes to develop ** Improvement - [DMC-1229] - Introduce Gfal2 transfer parameter to enable/disable proxy delegation - [DMC-1232] - Expose local transfers permission flag in Gfal2 transfer parameters ** Interface - This version exposes the QoS Gfal2 API * Thu Oct 25 2018 Andrea Manzi - 1.9.5 ** Bug - [DMC-1104] - [python 3] gfal2-python segfaults when freeing the context - [DMC-1105] - [python 3] The gfal2-python examples have python2 only syntax ** Task - [DMC-1079] - Add gfal2-python3 to EPEL7 * Tue Aug 28 2018 Andrea Manzi - 1.9.4 ** Task - [DMC-980] - Build gfal2-python for Python 3 in CC7 - [DMC-1045] - Add support for multiple credentials on gfal2-python * Wed Jun 21 2017 Alejandro Álvarez - 1.9.3 ** Bug - [DMC-930] - Avoid "no handlers could be found for logger gfal2" * Wed Mar 01 2017 Alejandro Álvarez - 1.9.2 ** Bug - [DMC-922] - Deadlock on listdir when logging is verbose * Mon Feb 20 2017 Alejandro Álvarez - 1.9.1 ** Bug - [DMC-920] - Missing incref on GfaltParams callbacks * Mon Jan 06 2017 Alejandro Álvarez - 1.9.0 ** Bug - [DMC-911] - setup.py broken ** New Feature - [DMC-892] - Generalize checksum methods ** Improvement - [DMC-873] - Explicit context destructor for gfal2 python bindings - [DMC-875] - Make possible to build gfal2-python with Python3 * Mon Aug 01 2016 Alejandro Álvarez - 1.8.5 ** Bug - [DMC-814] - No to_python (by-value) converter found for C++ type: boost::shared_ptr - [DMC-832] - Segmentation Fault in gridftp plugin with thread locking * Mon Oct 12 2015 Alejandro Álvarez - 1.8.4 - [DMC-698] - Port DMC clients to MacOSX - [DMC-725] - Provide a gfal2-python build linked against python2.7, system stdc++ and statically against boost python * Fri Jul 03 2015 Alejandro Álvarez - 1.8.3 ** Bug - [DMC-690] - Segfault inside set_opt_string_list ** New feature - [DMC-689] - Add __version__ to gfal2 bindings * Fri Jun 19 2015 Alejandro Álvarez - 1.8.2 ** Bug - [DMC-677] - Need to reduce scope of ScopedGILRelease (see DMC-670) - [DMC-686] - Missing GIL release on gfal2 context constructor (Was Listing endpoints via WebFTS intermittently fails ) ** Improvement - [DMC-674] - Validate version as part of the packaging * Mon Apr 13 2015 Alejandro Álvarez - 1.8.1 ** Bug - [DMC-670] - Several calls are missing a ScopedGILRelease ** Improvement - [DMC-649] - Core: Improve logger system, deprecate old methods - [DMC-651] - Core and plugins: Allow to send custom key/value to the servers ** New Feature - [DMC-641] - Core: Allow to register multiple event listeners * Fri Feb 03 2015 Alejandro Álvarez - 1.7.0 - [DMC-543] - listdir leaks the file descriptor - [DMC-546] - Expose bulk bring-online operations in gfal2-python - [DMC-583] - Core: Add call to recover list of installed plugins - [DMC-623] - Expose abort files call - [DMC-616] - Facilitate build integration with PH-SFT tools * Fri Nov 07 2014 Alejandro Álvarez - 1.6.0 - [DMC-479] - Expose gfal_version in the Python wrappers - [DMC-496] - Pythonize names transfer_parameters and gfalt_event - [DMC-459] - Core: New method to load configuration from a file (gfal2_load_opts_from_file) - [DMC-481] - Expose 'strict mode' parameter via Python bindings and gfal2-util - [DMC-495] - Improve docstrings generated by boost::python * Tue Jul 01 2014 Alejandro Álvarez - 1.5.0 - [LCGUTIL-387] - Add buffer size parameter to gfal-cp - [LCGUTIL-391] - Python bindings do not expose create parent option for copies * 1.4.1-1 : - fix [LCGUTIL-351] * 1.4.0-1 : - [LCGUTIL-329] - GFal segmentation fault listing folders with a huge quantity of files - Bug correction and shared_ptr support for Stat() and readdirpp() - Fix a problem in the __str__() value of Gfal::Stat() * 1.3.0-1 : - Correct a GError to python exception translation problem - implement callback for transfer ( performance marker ) - correct bug concerning verbose level - add calls needed by LHCb ( stating ) - several bug fixes related to gfal2-utils - implement partial list directory content ( readdir / readdirpp ) - First release compatible with gfal2-utils * Fri Apr 26 2013 Adrien Devresse - 1.2.0-0 - include partial r/w operations (pread/pwrite) - switch the internal api from old style posix to gfal2 file api - switch the license from EGEE to EMI - map the gfal2_cancel function - initial compatible EPEL release * Thu Nov 29 2012 Adrien Devresse - 1.1.0-0 - bug correction for set integer function - map the new parameter system properly - add verbose level management and new namespace to gfal python bindings - add pydoc - convert to off_t =64 bits on the 32 bits platform * Fri Jul 20 2012 Adrien Devresse - 1.0.0-1 - initial 1.0 release for gfal 2.0 python bindings gfal2-bindings-v1.12.2/ci/000077500000000000000000000000001453603530000151435ustar00rootroot00000000000000gfal2-bindings-v1.12.2/ci/common-rpm-build.sh000077500000000000000000000030431453603530000206630ustar00rootroot00000000000000#!/usr/bin/env bash set -e function print_info { printf "======================\n" printf "%-17s%s\n" "Distribution:" "${DIST}" printf "%-17s%s\n" "Dist name:" "${DISTNAME}" printf "%-17s%s\n" "Build type:" "${BUILD}" printf "%-17s%s\n" "Branch:" "${BRANCH}" printf "%-17s%s\n" "Release:" "${RELEASE}" printf "%-17s%s\n" "DMC Repository:" "${REPO_FILE}" printf "%-17s%s\n" "RPM build flags:" "${RPMBUILD_FLAGS}" printf "======================\n" } TIMESTAMP=`date +%y%m%d%H%M` GITREF=`git rev-parse --short HEAD` RELEASE=r${TIMESTAMP}git${GITREF} BUILD="devel" if [[ -z ${BRANCH} ]]; then BRANCH=`git name-rev $GITREF --name-only` else printf "Using environment set variable BRANCH=%s\n" "${BRANCH}" fi if [[ $BRANCH =~ ^(tags/)?(v)[.0-9]+(-(rc)?([0-9]+))?$ ]]; then RELEASE="${BASH_REMATCH[4]}${BASH_REMATCH[5]}" BUILD="rc" fi DIST=$(rpm --eval "%{dist}" | cut -d. -f2) DISTNAME=${DIST} # Special handling of FC rawhide [[ "${DISTNAME}" == "fc39" ]] && DISTNAME="fc-rawhide" [[ "${DISTNAME}" == "fc40" ]] && DISTNAME="fc-rawhide" # Write repository files to /etc/yum.repos.d/ based on the branch name REPO_FILE=$(./ci/write-repo-file.sh) print_info RPMBUILD=${PWD}/build SRPMS=${RPMBUILD}/SRPMS cd packaging/ make srpm RELEASE=${RELEASE} RPMBUILD=${RPMBUILD} SRPMS=${SRPMS} RPMBUILD_SRC_EXTRA_FLAGS="${RPMBUILD_FLAGS}" if [[ -f /usr/bin/dnf ]]; then dnf install -y epel-release || true dnf builddep -y ${SRPMS}/* else yum-builddep -y ${SRPMS}/* fi rpmbuild --rebuild --define="_topdir ${RPMBUILD}" ${RPMBUILD_FLAGS} ${SRPMS}/* gfal2-bindings-v1.12.2/ci/fedora-packages.sh000077500000000000000000000004651453603530000205230ustar00rootroot00000000000000#!/usr/bin/env bash set -e if [[ -f /usr/bin/dnf ]]; then dnf update -y dnf install -y dnf-plugins-core git rpm-build tree which \ cmake make gcc gcc-c++ else yum install -y yum-utils git rpm-build epel-rpm-macros tree which python2 \ cmake cmake3 make gcc gcc-c++ fi gfal2-bindings-v1.12.2/ci/write-repo-file.sh000077500000000000000000000017521453603530000205210ustar00rootroot00000000000000#!/usr/bin/env bash set -e GITREF=`git rev-parse --short HEAD` if [[ -z ${BRANCH} ]]; then BRANCH=`git name-rev $GITREF --name-only` fi if [[ $BRANCH =~ ^(tags/)?(v)[.0-9]+(-(rc)?([0-9]+))?$ ]]; then BUILD="rc" elif [[ ! -z ${DMC_REPO_BRANCH} ]]; then BUILD="${DMC_REPO_BRANCH}" else BUILD="develop" fi DIST=$(rpm --eval "%{dist}" | cut -d. -f2) DISTNAME=${DIST} # Special handling of FC rawhide [[ "${DISTNAME}" == "fc39" ]] && DISTNAME="fc-rawhide" [[ "${DISTNAME}" == "fc40" ]] && DISTNAME="fc-rawhide" if [[ ${BUILD} == "rc" ]]; then REPO_PATH="${BUILD}/${DISTNAME}/\$basearch" elif [[ ${BUILD} == "develop" ]]; then REPO_PATH="testing/${DISTNAME}/\$basearch" else REPO_PATH="testing/${BUILD}/${DISTNAME}/\$basearch" fi cat <<- EOF > "/etc/yum.repos.d/dmc-${BUILD}-${DISTNAME}.repo" [dmc-${BUILD}-${DISTNAME}] name=DMC Repository baseurl=http://dmc-repo.web.cern.ch/dmc-repo/${REPO_PATH} gpgcheck=0 enabled=1 protect=0 priority=3 EOF echo "dmc-${BUILD}-${DISTNAME}.repo" gfal2-bindings-v1.12.2/cmake/000077500000000000000000000000001453603530000156305ustar00rootroot00000000000000gfal2-bindings-v1.12.2/cmake/modules/000077500000000000000000000000001453603530000173005ustar00rootroot00000000000000gfal2-bindings-v1.12.2/cmake/modules/CMakeCXX11Support.cmake000066400000000000000000000022301453603530000234010ustar00rootroot00000000000000include(CheckCXXSourceCompiles REQUIRED) if(CMAKE_COMPILER_IS_GNUCXX) execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7) SET(HAVE_CXX011_FULL_SUPPORT TRUE) SET(HAVE_CXX011_PARTIAL_SUPPORT TRUE) SET(CXX11_FLAG_ENABLE "-std=c++11") elseif(GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3) message(STATUS "C++11 partial support") SET(HAVE_CXX011_PARTIAL_SUPPORT TRUE) SET(CXX11_FLAG_ENABLE "-std=c++0x") else () message(STATUS "C++11 no support ") SET(CXX11_FLAG_ENABLE "") endif() else(CMAKE_COMPILER_IS_GNUCXX) message(STATUS "C++11 activated full") SET(HAVE_CXX011_FULL_SUPPORT TRUE) SET(HAVE_CXX011_PARTIAL_SUPPORT TRUE) SET(CXX11_FLAG_ENABLE "-std=c++0x") endif(CMAKE_COMPILER_IS_GNUCXX) ## Check TR1 CHECK_CXX_SOURCE_COMPILES(" #include int main() { return 0; }" HAVE_TR1_SUPPORT) if(HAVE_TR1_SUPPORT) message(STATUS "TR1 support detected") else(HAVE_TR1_SUPPORT) message(STATUS "no TR1 support") endif(HAVE_TR1_SUPPORT) gfal2-bindings-v1.12.2/cmake/modules/CMakeGeneratePkgConfig.cmake000066400000000000000000000077231453603530000245360ustar00rootroot00000000000000# @title cmake macro for pkgconfig files generation # @brief generate a .pc package config file with a given name # @author Adrien Devresse include(DefineInstallationPaths REQUIRED) include(CMakeMacroParseArguments REQUIRED) include(CMakeStringHelpers REQUIRED) SET(CMAKE_PKGCONFIG_TEMPLATE "prefix=@PREFIX@ exec_prefix=@PREFIX@ libdir=@LIBDIR_VAR includedir=@INCLUDE_VAR@ Name: @NAME_PROJECT@ Description: @DESCRIPTION_PROJECT@ Version: @VERSION_PROJECT@ URL: @URL_PROJECT@ Requires: @REQUIRES_PROJECT@ Conflicts: @CONFLICTS_PROJECT@ Libs: @LIBS_PROJECT@ Libs.private: @LIBS_PRIVATE_PROJECT@ Cflags: @CFLAGS_PROJECT@ ") SET(CMAKE_PKGCONFIG_TEMPLATE_BASE " prefix=@PREFIX@ exec_prefix= \\\${prefix} libdir= @LIBDIR_VAR@ includedir=@INCLUDE_VAR@ Name: @NAME_PROJECT@ Description: @DESCRIPTION_PROJECT@ Version: @VERSION_PROJECT@ Requires: @REQUIRES_PROJECT@ Libs: @LIBS_PROJECT@ Cflags: @CFLAGS_PROJECT@ " ) LIST(APPEND CMAKE_PKGCONFIG_TEMPLATE_BASE_PATTERN "@PREFIX@" "@LIBDIR_VAR@" "@INCLUDE_VAR@" "@NAME_PROJECT@" "@DESCRIPTION_PROJECT@" "@VERSION_PROJECT@" "@REQUIRES_PROJECT@" "@LIBS_PROJECT@" "@CFLAGS_PROJECT@") # main function to use # FORMAT : add_PkgConfigFile_for_Library("string_filename.pc" target_library # [DESCRIPTION] "description of the pkgconfig files" # [HEADER_DIRS] dir1, dir2 # [REQUIRES] req1 req 2 ) # list of dir to include in $prefix/include/, ex : $prefix/include/dir1 # the pc file is produced in the ${CMAKE_CURRENT_BINARY_DIR} directory function(add_PkgConfigFile_for_Library) PARSE_ARGUMENTS(PKGCONFIGFILE "HEADER_DIRS;DESCRIPTION;REQUIRES;CFLAGS" "" ${ARGN} ) LIST(GET PKGCONFIGFILE_DEFAULT_ARGS 0 pkgconfig_filename) LIST(GET PKGCONFIGFILE_DEFAULT_ARGS 1 lib_target) LIST(GET PKGCONFIGFILE_DESCRIPTION 0 description) get_target_property(library_name ${lib_target} OUTPUT_NAME) get_target_property(library_version ${lib_target} VERSION) set(pkgconfig_prefix "${CMAKE_INSTALL_PREFIX}") set(pkgconfig_libdir_var "\\\${prefix}/lib${LIB_SUFFIX}") set(pkgconfig_include_var "\\\${prefix}/include") set(pkgconfig_linkflags "-l${library_name} -L\\\${libdir}") set(pkgconfig_name "${pkgconfig_filename}") set(pkgconfig_version "${library_version}") set(pkgconfig_description "pkgconfig file for ${library_name}") set(pkgconfig_requires " ") set(pkgconfig_cflags "") IF(PKGCONFIGFILE_REQUIRES) FOREACH(req ${PKGCONFIGFILE_REQUIRES}) set(pkgconfig_requires "${pkgconfig_requires} ${req}") ENDFOREACH(req PKGCONFIGFILE_REQUIRES) ENDIF(PKGCONFIGFILE_REQUIRES) IF(PKGCONFIGFILE_CFLAGS) FOREACH(req ${PKGCONFIGFILE_CFLAGS}) set(pkgconfig_cflags "${pkgconfig_cflags} ${req}") ENDFOREACH(req PKGCONFIGFILE_CFLAGS) ENDIF(PKGCONFIGFILE_CFLAGS) IF(PKGCONFIGFILE_HEADER_DIRS) FOREACH(dir ${PKGCONFIGFILE_HEADER_DIRS}) set(pkgconfig_includedir "${pkgconfig_includedir} -I\\\${includedir}/${dir}") ENDFOREACH(dir PKGCONFIGFILE_HEADER_DIRS) ELSE(PKGCONFIGFILE_HEADER_DIRS) set(pkgconfig_includedir " -I\\\${includedir}") ENDIF(PKGCONFIGFILE_HEADER_DIRS) IF(description) set(pkgconfig_description "${description}") ENDIF(description) set(pkgconfig_cflags "${pkgconfig_cflags} ${pkgconfig_includedir} ") LIST(APPEND pkgconfig_list_var ${pkgconfig_prefix} ${pkgconfig_libdir_var} ${pkgconfig_include_var} ${pkgconfig_name} ${pkgconfig_description} ${pkgconfig_version} ${pkgconfig_requires} ${pkgconfig_linkflags} ${pkgconfig_cflags}) replace_all_occurence(pc_file_content ${CMAKE_PKGCONFIG_TEMPLATE_BASE} LIST_PATTERN ${CMAKE_PKGCONFIG_TEMPLATE_BASE_PATTERN} LIST_REPLACER ${pkgconfig_list_var}) SET(filename "${CMAKE_CURRENT_BINARY_DIR}/${pkgconfig_filename}") FILE(WRITE ${filename} "${pc_file_content}" ) message(STATUS "generate pkgconfig file for ${lib_target} under ${filename}") endfunction(add_PkgConfigFile_for_Library) gfal2-bindings-v1.12.2/cmake/modules/CMakeMacroParseArguments.cmake000066400000000000000000000020651453603530000251300ustar00rootroot00000000000000 MACRO(PARSE_ARGUMENTS prefix arg_names option_names) SET(DEFAULT_ARGS) FOREACH(arg_name ${arg_names}) SET(${prefix}_${arg_name}) ENDFOREACH(arg_name) FOREACH(option ${option_names}) SET(${prefix}_${option} FALSE) ENDFOREACH(option) SET(current_arg_name DEFAULT_ARGS) SET(current_arg_list) FOREACH(arg ${ARGN}) SET(larg_names ${arg_names}) LIST(FIND larg_names "${arg}" is_arg_name) IF (is_arg_name GREATER -1) SET(${prefix}_${current_arg_name} ${current_arg_list}) SET(current_arg_name ${arg}) SET(current_arg_list) ELSE (is_arg_name GREATER -1) SET(loption_names ${option_names}) LIST(FIND loption_names "${arg}" is_option) IF (is_option GREATER -1) SET(${prefix}_${arg} TRUE) ELSE (is_option GREATER -1) SET(current_arg_list ${current_arg_list} ${arg}) ENDIF (is_option GREATER -1) ENDIF (is_arg_name GREATER -1) ENDFOREACH(arg) SET(${prefix}_${current_arg_name} ${current_arg_list}) ENDMACRO(PARSE_ARGUMENTS) gfal2-bindings-v1.12.2/cmake/modules/CMakeStringHelpers.cmake000066400000000000000000000032441453603530000237770ustar00rootroot00000000000000##convenience function for string manipulation function(replace_occurence output input pattern replacer) string(REGEX REPLACE ${pattern} ${replacer} tmp_str ${input}) set(${output} ${tmp_str} PARENT_SCOPE) endfunction(replace_occurence output input pattern replacer) function(replace_all_occurence) PARSE_ARGUMENTS(REPLACE_ALL "LIST_PATTERN;LIST_REPLACER" "" ${ARGN} ) LIST(APPEND list_pattern ${REPLACE_ALL_LIST_PATTERN}) LIST(APPEND list_replacer ${REPLACE_ALL_LIST_REPLACER}) LIST(LENGTH list_pattern list_size ) LIST(LENGTH list_replacer list2_size ) math(EXPR list_size ${list_size}-1) LIST(GET REPLACE_ALL_DEFAULT_ARGS 0 output_var) LIST(GET REPLACE_ALL_DEFAULT_ARGS 1 intput_content ) SET(tmp_str ${intput_content}) SET(tmp_str2 "") foreach(i RANGE ${list_size}) list(GET list_pattern ${i} current_pattern ) list(GET list_replacer ${i} current_replacer ) replace_occurence(tmp_str2 ${tmp_str} ${current_pattern} ${current_replacer} ) SET(tmp_str ${tmp_str2}) endforeach(i RANGE ${list_size}) SET(${output_var} ${tmp_str} PARENT_SCOPE) endfunction(replace_all_occurence) function(STRING_APPEND var_name content) SET(${var_name} "${${var_name}}${content}" PARENT_SCOPE) endfunction(STRING_APPEND var_name content) function(parse_lib_path lib_link lib_directory lib_path) string(REGEX REPLACE "^.*/(lib)?(.*)\\.(so|dll)" "\\2" my_lib_link ${lib_path}) string(REGEX REPLACE "^(.*)/(lib)?(.*)\\.(so|dll)" "\\1" my_lib_dir ${lib_path}) SET(${lib_link} ${my_lib_link} PARENT_SCOPE) SET(${lib_directory} ${my_lib_dir} PARENT_SCOPE) endfunction(parse_lib_path lib_link lib_directory lib_path) gfal2-bindings-v1.12.2/cmake/modules/DefineInstallationPaths.cmake000066400000000000000000000105621453603530000250620ustar00rootroot00000000000000if (UNIX) IF (NOT APPLICATION_NAME) MESSAGE(STATUS "${PROJECT_NAME} is used as APPLICATION_NAME") SET(APPLICATION_NAME ${PROJECT_NAME}) ENDIF (NOT APPLICATION_NAME) # Suffix for Linux IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") SET(LIB_SUFFIX "" CACHE STRING "Suffix of the lib") ELSE () IF (CMAKE_SIZEOF_VOID_P EQUAL 4) SET(LIB_SUFFIX "" CACHE STRING "Suffix of the lib") SET (PKG_ARCH "i386") ELSE (CMAKE_SIZEOF_VOID_P EQUAL 4) SET(LIB_SUFFIX "64" CACHE STRING "Suffix of the lib") SET (PKG_ARCH "x86_64") ENDIF (CMAKE_SIZEOF_VOID_P EQUAL 4) ENDIF () SET(EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Base directory for executables and libraries" ) SET(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share" CACHE PATH "Base directory for files which go to share/" ) SET(DATA_INSTALL_PREFIX "${SHARE_INSTALL_PREFIX}/${APPLICATION_NAME}" CACHE PATH "The parent directory where applications can install their data") # The following are directories where stuff will be installed to SET(BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" CACHE PATH "The ${APPLICATION_NAME} binary install dir (default prefix/bin)" ) SET(SBIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/sbin" CACHE PATH "The ${APPLICATION_NAME} sbin install dir (default prefix/sbin)" ) SET(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/lib)" ) SET(LIBEXEC_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/libexec" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/libexec)" ) SET(PKGCONFIG_FILES_DIR "${LIB_INSTALL_DIR}/pkgconfig/" CACHE PATH "subdirectory relative to the install prefix where pkgconfig files (.pc) will be installed" ) SET(PLUGIN_INSTALL_DIR "${LIB_INSTALL_DIR}/${APPLICATION_NAME}-plugins/" CACHE PATH "The subdirectory relative to the install prefix where plugins will be installed (default is prefix/lib/${APPLICATION_NAME})" ) SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The subdirectory to the header prefix (default prefix/include)" ) SET(DATA_INSTALL_DIR "${DATA_INSTALL_PREFIX}" CACHE PATH "The parent directory where applications can install their data (default prefix/share/${APPLICATION_NAME})" ) SET(DOC_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/doc/${APPLICATION_NAME}" CACHE PATH "The parent directory where applications can install their documentation (default prefix/share/doc/${APPLICATION_NAME})" ) SET(HTML_INSTALL_DIR "${DATA_INSTALL_PREFIX}/doc/HTML" CACHE PATH "The HTML install dir for documentation (default data/doc/html)" ) SET(ICON_INSTALL_DIR "${DATA_INSTALL_PREFIX}/icons" CACHE PATH "The icon install dir (default data/icons/)" ) SET(SOUND_INSTALL_DIR "${DATA_INSTALL_PREFIX}/sounds" CACHE PATH "The install dir for sound files (default data/sounds)" ) SET(LOCALE_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/locale" CACHE PATH "The install dir for translations (default prefix/share/locale)" ) SET(XDG_APPS_DIR "${SHARE_INSTALL_PREFIX}/applications/" CACHE PATH "The XDG apps dir" ) SET(XDG_DIRECTORY_DIR "${SHARE_INSTALL_PREFIX}/desktop-directories" CACHE PATH "The XDG directory" ) SET(SYSCONF_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/etc" CACHE PATH "The ${APPLICATION_NAME} sysconfig install dir (default prefix/etc)" ) SET(MAN_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/man" CACHE PATH "The ${APPLICATION_NAME} man install dir (default prefix/man)" ) SET(INFO_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/info" CACHE PATH "The ${APPLICATION_NAME} info install dir (default prefix/info)" ) endif (UNIX) if (WIN32) # Same same set(BIN_INSTALL_DIR "." CACHE PATH "-") set(SBIN_INSTALL_DIR "." CACHE PATH "-") set(LIB_INSTALL_DIR "lib" CACHE PATH "-") set(INCLUDE_INSTALL_DIR "include" CACHE PATH "-") set(PLUGIN_INSTALL_DIR "plugins" CACHE PATH "-") set(HTML_INSTALL_DIR "doc/HTML" CACHE PATH "-") set(ICON_INSTALL_DIR "." CACHE PATH "-") set(SOUND_INSTALL_DIR "." CACHE PATH "-") set(LOCALE_INSTALL_DIR "lang" CACHE PATH "-") endif (WIN32) gfal2-bindings-v1.12.2/cmake/modules/FindCGSI_GSOAP.cmake000066400000000000000000000040771453603530000225710ustar00rootroot00000000000000# # This module detects if CGSI_GSOAP is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # CGSI_GSOAP_LIBRARIES = full path to the CGSI_GSOAP libraries # CGSI_GSOAP_INCLUDE_DIRS = include dir to be used when using the CGSI_GSOAP library # CGSI_GSOAP_FOUND = set to true if CGSI_GSOAP was found successfully # # CGSI_GSOAP_LOCATION # setting this enables search for CGSI_GSOAP libraries / headers in this location include(CMakeStringHelpers) # ----------------------------------------------------- # CGSI_GSOAP Libraries # ----------------------------------------------------- find_library(CGSI_GSOAP_LIBRARIES NAMES cgsi_plugin HINTS ${CGSI_GSOAP_LOCATION} ${STAGE_DIR} ${CMAKE_INSTALL_PREFIX}/cgsigsoap/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/cgsigsoap/*/${PLATFORM}/lib64 ${CMAKE_INSTALL_PREFIX}/opt/cgsi-gsoap/lib ${CMAKE_INSTALL_PREFIX}/opt/cgsi-gsoap/lib64 DOC "The main CGSI_GSOAP library" ) # ----------------------------------------------------- # CGSI_GSOAP Include Directories # ----------------------------------------------------- find_path(CGSI_GSOAP_INCLUDE_DIRS NAMES cgsi_plugin.h HINTS ${CGSI_GSOAP_LOCATION} ${STAGE_DIR}/include ${CMAKE_INSTALL_PREFIX}/cgsigsoap/*/${PLATFORM} ${CMAKE_INSTALL_PREFIX}/cgsigsoap/*/${PLATFORM}/include DOC "The CGSI_GSOAP include directory" ) if(CGSI_GSOAP_INCLUDE_DIRS) message(STATUS "CGSI_GSOAP includes found in ${CGSI_GSOAP_INCLUDE_DIRS}") endif() if(CGSI_GSOAP_LIBRARIES) message(STATUS "CGSI_GSOAP libraries found in ${CGSI_GSOAP_LIBRARIES}") endif() # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set CGSI_GSOAP_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args(CGSI_GSOAP DEFAULT_MSG CGSI_GSOAP_LIBRARIES) mark_as_advanced(CGSI_GSOAP_INCLUDE_DIRS CGSI_GSOAP_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindDCAP.cmake000066400000000000000000000036151453603530000216170ustar00rootroot00000000000000# # This module detects if DCAP is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # DCAP_LIBRARIES = full path to the DCAP libraries # DCAP_INCLUDE_DIR = include dir to be used when using the DCAP library # DCAP_FOUND = set to true if DCAP was found successfully # # DCAP_LOCATION # setting this enables search for DCAP libraries / headers in this location # ----------------------------------------------------- # DCAP Libraries # ----------------------------------------------------- find_library(DCAP_LIBRARIES NAMES dcap HINTS ${DCAP_LOCATION} ${STAGE_DIR} ${CMAKE_INSTALL_PREFIX}/dcap/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/dcap/*/${PLATFORM}/lib64 ${CMAKE_INSTALL_PREFIX}/Grid/dcap/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Grid/dcap/*/${PLATFORM}/lib64 DOC "The main DCAP library" ) # ----------------------------------------------------- # DCAP Include Directories # ----------------------------------------------------- find_path(DCAP_INCLUDE_DIR NAMES dcap.h HINTS ${DCAP_LOCATION} ${STAGE_DIR} ${CMAKE_INSTALL_PREFIX}/dcap/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/dcap/*/${PLATFORM}/include DOC "The DCAP include directory" ) if (DCAP_LIBRARIES) message (STATUS "DCAP libraries found in ${DCAP_LIBRARIES}") endif (DCAP_LIBRARIES) if(DCAP_INCLUDE_DIR) message(STATUS "DCAP includes found in ${DCAP_INCLUDE_DIR}") endif() # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set DCAP_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args(DCAP DEFAULT_MSG DCAP_LIBRARIES DCAP_INCLUDE_DIR) mark_as_advanced(DCAP_INCLUDE_DIR DCAP_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindDPM.cmake000066400000000000000000000051531453603530000215270ustar00rootroot00000000000000# # This module detects if dpm is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # DPM_LIBRARIES = full path to the dpm libraries # DPM_INCLUDE_DIR = include dir to be used when using the dpm library # DPM_FOUND = set to true if dpm was found successfully # # DPM_LOCATION # setting this enables search for dpm libraries / headers in this location # ----------------------------------------------------- # DPM Libraries # ----------------------------------------------------- find_library(DPM_LIBRARIES NAMES dpm HINTS ${DPM_LOCATION} ${STAGE_DIR} ${CMAKE_INSTALL_PREFIX}/dcap/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/dcap/*/${PLATFORM}/ DOC "The main dpm library" ) # ----------------------------------------------------- # LCGDM Libraries # ----------------------------------------------------- find_library(LCGDM_LIBRARIES NAMES lcgdm HINTS ${DPM_LOCATION} ${STAGE_DIR} ${CMAKE_INSTALL_PREFIX}/dcap/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/dcap/*/${PLATFORM}/ DOC "The main lcgdm library" ) # ----------------------------------------------------- # DPM Include Directories # ----------------------------------------------------- find_path(DPM_INCLUDE_DIR NAMES dpm/dpm_api.h HINTS ${DPM_LOCATION} ${STAGE_DIR} ${CMAKE_INSTALL_PREFIX}/dcap/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/dcap/*/${PLATFORM}/ DOC "The dpm include directory" ) if(DPM_INCLUDE_DIR) message(STATUS "dpm includes found in ${DPM_INCLUDE_DIR}") endif() # ----------------------------------------------------- # LCGDM Include Directories # ----------------------------------------------------- find_path(LCGDM_INCLUDE_DIR NAMES Cinit.h HINTS ${LCGDM_LOCATION} ${STAGE_DIR} ${CMAKE_INSTALL_PREFIX}/dcap/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/dcap/*/${PLATFORM}/ DOC "The LCGDM include directory" ) if(LCGDM_INCLUDE_DIR) message(STATUS "lcgdm includes found in ${LCGDM_INCLUDE_DIR}") endif() # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set DPM_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args(dpm DEFAULT_MSG DPM_LIBRARIES DPM_INCLUDE_DIR) find_package_handle_standard_args(lcgdm DEFAULT_MSG LCGDM_LIBRARIES LCGDM_INCLUDE_DIR) mark_as_advanced(DPM_INCLUDE_DIR DPM_LIBRARIES) mark_as_advanced(LCGDM_INCLUDE_DIR LCGDM_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindDavix.cmake000066400000000000000000000056201453603530000221610ustar00rootroot00000000000000# # This module detects if SRM-IFCE is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # DAVIX_LIBRARIES = full path to the SRM-IFCE libraries # DAVIX_INCLUDE_DIR = include dir to be used when using the SRM-IFCE library # DAVIX_FOUND = set to true if SRM-IFCE was found successfully # # DAVIX_LOCATION # setting this enables search for SRM-IFCE libraries / headers in this location # ----------------------------------------------------- # Try with pkgconfig first # ----------------------------------------------------- pkg_check_modules(DAVIX_PKG davix>=0.3.5) pkg_check_modules(DAVIX_COPY_PKG davix_copy>=0.3.5) if (DAVIX_PKG_FOUND AND DAVIX_COPY_PKG_FOUND) set (DAVIX_INCLUDE_DIR "${DAVIX_PKG_INCLUDE_DIRS}" "${DAVIX_COPY_PKG_INCLUDE_DIRS}") set (DAVIX_LIBRARIES "${DAVIX_PKG_LIBRARIES}" "${DAVIX_COPY_PKG_LIBRARIES}") set (DAVIX_CFLAGS "${DAVIX_PKG_CFLAGS} ${DAVIX_COPY_PKG_FLAGS}") else () # Davix Libraries find_library(DAVIX_MAIN_LIBRARY NAMES davix HINTS ${DAVIX_LOCATION}/lib ${DAVIX_LOCATION}/lib64 ${DAVIX_LOCATION}/lib32 ${STAGE_DIR}/lib ${STAGE_DIR}/lib64 ${CMAKE_INSTALL_PREFIX}/Davix/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Davix/*/${PLATFORM}/lib64 ${CMAKE_INSTALL_PREFIX}/lib DOC "The main davix library" ) find_library(DAVIX_COPY_LIBRARY NAMES davix_copy HINTS ${DAVIX_LOCATION}/lib ${DAVIX_LOCATION}/lib64 ${DAVIX_LOCATION}/lib32 ${STAGE_DIR}/lib ${STAGE_DIR}/lib64 ${CMAKE_INSTALL_PREFIX}/Davix/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Davix/*/${PLATFORM}/lib64 ${CMAKE_INSTALL_PREFIX}/lib DOC "The davix copy library" ) set (DAVIX_LIBRARIES ${DAVIX_MAIN_LIBRARY} ${DAVIX_COPY_LIBRARY}) # Davix Include Directories find_path(DAVIX_INCLUDE_DIR NAMES davix.hpp HINTS ${DAVIX_LOCATION} ${DAVIX_LOCATION}/include ${DAVIX_LOCATION}/include/* ${STAGE_DIR}/include ${STAGE_DIR}/include ${CMAKE_INSTALL_PREFIX}/Davix/*/${PLATFORM}/include/* ${CMAKE_INSTALL_PREFIX}/include/davix DOC "Davix include directory" ) set (DAVIX_CFLAGS "") endif() if (DAVIX_LIBRARIES) message ("DAVIX libraries: ${DAVIX_LIBRARIES}") endif (DAVIX_LIBRARIES) if(DAVIX_INCLUDE_DIR) message(STATUS "DAVIX includes found in ${DAVIX_INCLUDE_DIR}") endif() # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set DAVIX_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args(DAVIX DEFAULT_MSG DAVIX_LIBRARIES DAVIX_INCLUDE_DIR) mark_as_advanced(DAVIX_LIBRARIES DAVIX_INCLUDE_DIR DAVIX_CFLAGS) gfal2-bindings-v1.12.2/cmake/modules/FindGFAL2.cmake000066400000000000000000000050121453603530000216740ustar00rootroot00000000000000# # This module detects if gfal2 is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # GFAL2_LIBRARIES = full path to the gfal2 libraries # GFAL2_INCLUDE_DIR = include dir to be used when using the gfal2 library # GFAL2_FOUND = set to true if gfal2 was found successfully # # GFAL2_LOCATION # setting this enables search for gfal2 libraries / headers in this location find_package (PkgConfig) pkg_check_modules(GFAL2_PKG gfal2) pkg_check_modules(GFAL2_TRANSFER_PKG gfal_transfer) if (GFAL2_PKG_FOUND AND GFAL2_TRANSFER_PKG_FOUND) set (GFAL2_LIBRARIES ${GFAL2_PKG_LIBRARIES} ${GFAL2_TRANSFER_PKG_LIBRARIES}) set (GFAL2_INCLUDE_DIRS ${GFAL2_PKG_INCLUDE_DIRS} ${GFAL2_TRANSFER_PKG_INCLUDE_DIRS}) set (GFAL2_DEFINITIONS "${GFAL2_PKG_CFLAGS} ${GFAL2_TRANSFER_PKG_CFLAGS}") set (GFAL2_LIBRARY_DIRS ${GFAL2_PKG_LIBRARY_DIRS}) else (GFAL2_PKG_FOUND AND GFAL2_TRANSFER_PKG_FOUND) find_library(GFAL2_CORE_LIBRARIES NAMES gfal2 HINTS ${GFAL2_LOCATION} ${CMAKE_INSTALL_PREFIX}/Grid/gfal2/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Grid/gfal2/*/${PLATFORM}/lib64 DOC "The main gfal2 library" ) find_library(GFAL2_TRANSFER_LIBRARIES NAMES gfal_transfer HINTS ${GFAL2_LOCATION} ${CMAKE_INSTALL_PREFIX}/Grid/gfal2/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Grid/gfal2/*/${PLATFORM}/lib64 DOC "The transfer gfal2 library" ) set (GFAL2_LIBRARIES ${GFAL2_CORE_LIBRARIES} ${GFAL2_TRANSFER_LIBRARIES}) find_path(GFAL2_INCLUDE_DIRS NAMES gfal_api.h HINTS ${GFAL2_LOCATION}/include/* ${CMAKE_INSTALL_PREFIX}/Grid/gfal2/*/${PLATFORM}/include/* DOC "The gfal2 include directory" ) set (GFAL2_DEFINITIONS "") endif (GFAL2_PKG_FOUND AND GFAL2_TRANSFER_PKG_FOUND) if (GFAL2_LIBRARIES) message (STATUS "GFAL2 libraries: ${GFAL2_LIBRARIES}") endif (GFAL2_LIBRARIES) if (GFAL2_INCLUDE_DIRS) message (STATUS "GFAL2 include dir: ${GFAL2_INCLUDE_DIRS}") endif (GFAL2_INCLUDE_DIRS) # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set GFAL2_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args (GFAL2 DEFAULT_MSG GFAL2_LIBRARIES GFAL2_INCLUDE_DIRS ) mark_as_advanced(GFAL2_INCLUDE_DIRS GFAL2_LIBRARIES GFAL2_LIBRARY_DIRS) gfal2-bindings-v1.12.2/cmake/modules/FindGLIB2.cmake000066400000000000000000000037451453603530000217130ustar00rootroot00000000000000# # This module detects if glib2 is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # GLIB2_LIBRARIES = full path to the glib2 libraries # GLIB2_INCLUDE_DIR = include dir to be used when using the glib2 library # GLIB2_FOUND = set to true if glib2 was found successfully # # GLIB2_LOCATION # setting this enables search for glib2 libraries / headers in this location find_package (PkgConfig) pkg_check_modules (GLIB2_PKG glib-2.0) if (GLIB2_PKG_FOUND) set (GLIB2_LIBRARIES ${GLIB2_PKG_LIBRARIES}) set (GLIB2_INCLUDE_DIRS ${GLIB2_PKG_INCLUDE_DIRS}) set (GLIB2_DEFINITIONS "${GLIB2_PKG_CFLAGS} ${GLIB2_PKG_CFLAGS_OTHER}") set (GLIB2_LIBRARY_DIRS ${GLIB2_PKG_LIBRARY_DIRS}) else (GLIB2_PKG_FOUND) find_library(GLIB2_LIBRARIES NAMES libglib-2.0 HINTS ${GLIB2_LOCATION} ${CMAKE_INSTALL_PREFIX}/glib2/*/${PLATFORM}/ DOC "The main glib2 library" ) find_path(GLIB2_INCLUDE_DIRS NAMES glib.h HINTS ${GLIB2_LOCATION}/include/* ${CMAKE_INSTALL_PREFIX}/glib2/*/${PLATFORM}/ DOC "The glib2 include directory" ) set (GLIB2_DEFINITIONS "") endif (GLIB2_PKG_FOUND) if (GLIB2_LIBRARIES) message (STATUS "GLIB2 libraries: ${GLIB2_LIBRARIES}") endif (GLIB2_LIBRARIES) if (GLIB2_INCLUDE_DIRS) message (STATUS "GLIB2 include dir: ${GLIB2_INCLUDE_DIRS}") endif (GLIB2_INCLUDE_DIRS) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") link_directories ("${CMAKE_INSTALL_PREFIX}/lib/gettext") endif () # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set GLIB2_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args (GLIB2 DEFAULT_MSG GLIB2_LIBRARIES GLIB2_INCLUDE_DIRS ) mark_as_advanced(GLIB2_INCLUDE_DIRS GLIB2_LIBRARIES GLIB2_LIBRARY_DIRS) gfal2-bindings-v1.12.2/cmake/modules/FindGRIDFTP_IFCE.cmake000066400000000000000000000033101453603530000227650ustar00rootroot00000000000000# # This module detects if GRIDFTP_IFCE is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # GRIDFTP_IFCE_LIBRARIES = full path to the dpm libraries # GRIDFTP_IFCE_INCLUDE_DIR = include dir to be used when using the dpm library # GRIDFTP_IFCE_FOUND = set to true if dpm was found successfully # # GRIDFTP_IFCE_LOCATION # setting this enables search for dpm libraries / headers in this location # ----------------------------------------------------- # DPM Libraries # ----------------------------------------------------- find_library(GRIDFTP_IFCE_LIBRARIES NAMES gridftp_ifce HINTS ${GRIDFTP_IFCE_LOCATION}/lib ${GRIDFTP_IFCE_LOCATION}/lib64 ${GRIDFTP_IFCE_LOCATION}/lib32 DOC "The main gridftp_ifce library" ) # ----------------------------------------------------- # GRIDFTP_IFCE Include Directories # ----------------------------------------------------- find_path(GRIDFTP_IFCE_INCLUDE_DIR NAMES gridftp-ifce.h HINTS ${GRIDFTP_IFCE_LOCATION} ${GRIDFTP_IFCE_LOCATION}/include ${GRIDFTP_IFCE_LOCATION}/include/* DOC "The gridftp-ifce.h include directory" ) if(GRIDFTP_IFCE_INCLUDE_DIR) message(STATUS "gridftp_ifce includes found in ${GRIDFTP_IFCE_INCLUDE_DIR}") endif() # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set GRIDFTP_IFCE_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args(gridftp_ifce DEFAULT_MSG GRIDFTP_IFCE_LIBRARIES GRIDFTP_IFCE_INCLUDE_DIR) mark_as_advanced(GRIDFTP_IFCE_INCLUDE_DIR GRIDFTP_IFCE_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindGTEST.cmake000066400000000000000000000037711453603530000220010ustar00rootroot00000000000000# # This module detects if GTEST is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # GTEST_LIBRARIES = full path to the GTEST libraries # GTEST_SSL_LIBRARIES = full path to the GTEST ssl libraries # GTEST_INCLUDE_DIR = include dir to be used when using the GTEST library # GTEST_WSDL2H = wsdl2h binary # GTEST_SOAPCPP2 = soapcpp2 binary # GTEST_FOUND = set to true if GTEST was found successfully # # GTEST_LOCATION # setting this enables search for GTEST libraries / headers in this location # ----------------------------------------------------- # GTEST Libraries # ----------------------------------------------------- find_library(GTEST_LIBRARIES NAMES gtest HINTS ${GTEST_LOCATION}/lib ${GTEST_LOCATION}/lib64 ${GTEST_LOCATION}/lib32 DOC "The main GTEST library" ) # ----------------------------------------------------- # GTEST Libraries # ----------------------------------------------------- find_library(GTEST_MAIN_LIBRARIES NAMES gtest_main HINTS ${GTEST_LOCATION}/lib ${GTEST_LOCATION}/lib64 ${GTEST_LOCATION}/lib32 DOC "The main GTEST main library" ) # ----------------------------------------------------- # GTEST Include Directories # ----------------------------------------------------- find_path(GTEST_INCLUDE_DIR NAMES gtest.h HINTS ${GTEST_LOCATION} ${GTEST_LOCATION}/include ${GTEST_LOCATION}/include/gtest ${GTEST_LOCATION}/include/* /usr/include/gtest DOC "The GTEST include directory" ) SET(GTEST_DEFINITIONS "") # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set GTEST_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GTEST DEFAULT_MSG GTEST_LIBRARIES GTEST_MAIN_LIBRARIES GTEST_INCLUDE_DIR) mark_as_advanced(GTEST_INCLUDE_DIR GTEST_LIBRARIES ) gfal2-bindings-v1.12.2/cmake/modules/FindGTHREAD2.cmake000066400000000000000000000036471453603530000222550ustar00rootroot00000000000000# # This module detects if gthread2 is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # GTHREAD2_LIBRARIES = full path to the glib2 libraries # GTHREAD2_INCLUDE_DIR = include dir to be used when using the glib2 library # GTHREAD2_FOUND = set to true if glib2 was found successfully # # GTHREAD2_LOCATION # setting this enables search for gthread2 libraries / headers in this location find_package (PkgConfig) pkg_check_modules(GTHREAD2_PKG gthread-2.0) if (GTHREAD2_PKG_FOUND) set (GTHREAD2_LIBRARIES ${GTHREAD2_PKG_LIBRARIES}) set (GTHREAD2_INCLUDE_DIRS ${GTHREAD2_PKG_INCLUDE_DIRS}) set (GTHREAD2_DEFINITIONS "${GTHREAD2_PKG_CFLAGS} ${GTHREAD2_PKG_CFLAGS_OTHER}") else (GTHREAD2_PKG_FOUND) find_library(GTHREAD2_LIBRARIES NAMES libgthread-2.0.so.0 HINTS ${GTHREAD2_LOCATION} ${CMAKE_INSTALL_PREFIX}/glib2/*/${PLATFORM}/ DOC "The main gthread2 library" ) find_path(GTHREAD2_INCLUDE_DIRS NAMES gthread.h HINTS ${GTHREAD2_LOCATION}/include/* ${CMAKE_INSTALL_PREFIX}/glib2/*/${PLATFORM}/ DOC "The gthread2 include directory" ) set (GTHREAD2_DEFINITIONS "") endif (GTHREAD2_PKG_FOUND) if (GTHREAD2_LIBRARIES) message (STATUS "GTHREAD2 libraries: ${GTHREAD2_LIBRARIES}") endif (GTHREAD2_LIBRARIES) if (GTHREAD2_INCLUDE_DIRS) message (STATUS "GTHREAD2 include dir: ${GTHREAD2_INCLUDE_DIRS}") endif (GTHREAD2_INCLUDE_DIRS) # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set GTHREAD2_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args (GTHREAD2 DEFAULT_MSG GTHREAD2_LIBRARIES GTHREAD2_INCLUDE_DIRS ) mark_as_advanced(GTHREAD2_INCLUDE_DIRS GTHREAD2_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindGlobus_COMMON.cmake000066400000000000000000000050741453603530000234140ustar00rootroot00000000000000# # This module detects if globus-common is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # GLOBUS_COMMON_LIBRARIES = full path to the globus-common libraries # GLOBUS_COMMON_INCLUDE_DIR = include dir to be used when using the globus-common library # GLOBUS_COMMON_FOUND = set to true if globus-common was found successfully # # GLOBUS_COMMON_LOCATION # setting this enables search for globus-common libraries / headers in this location find_package (PkgConfig) pkg_check_modules(GLOBUS_COMMON_PKG globus-common) if (GLOBUS_COMMON_PKG_FOUND) set (GLOBUS_COMMON_LIBRARIES ${GLOBUS_COMMON_PKG_LIBRARIES}) set (GLOBUS_COMMON_INCLUDE_DIRS ${GLOBUS_COMMON_PKG_INCLUDE_DIRS}) set (GLOBUS_COMMON_DEFINITIONS "${GLOBUS_COMMON_PKG_CFLAGS}") else (GLOBUS_COMMON_PKG_FOUND) set (CMAKE_FIND_FRAMEWORK NEVER) find_library(GLOBUS_COMMON_LIBRARIES NAMES globus_common HINTS ${GLOBUS_COMMON_LOCATION} ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib64 ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/lib ${GLOBUS_PREFIX}/libexec/lib DOC "The main globus-common library" ) find_path(GLOBUS_COMMON_INCLUDE_DIRS NAMES globus_common.h HINTS ${GLOBUS_COMMON_LOCATION}/include/* ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/include ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/include ${CMAKE_INSTALL_PREFIX}/globus-toolkit/libexec/include ${GLOBUS_PREFIX}/libexec/include DOC "The globus-common include directory" ) set (GLOBUS_COMMON_DEFINITIONS "") endif (GLOBUS_COMMON_PKG_FOUND) if (GLOBUS_COMMON_LIBRARIES) message (STATUS "GLOBUS_COMMON libraries: ${GLOBUS_COMMON_LIBRARIES}") endif (GLOBUS_COMMON_LIBRARIES) if (GLOBUS_COMMON_INCLUDE_DIRS) message (STATUS "GLOBUS_COMMON include dir: ${GLOBUS_COMMON_INCLUDE_DIRS}") endif (GLOBUS_COMMON_INCLUDE_DIRS) # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set GLOBUS_COMMON_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args (GLOBUS_COMMON DEFAULT_MSG GLOBUS_COMMON_LIBRARIES GLOBUS_COMMON_INCLUDE_DIRS ) mark_as_advanced(GLOBUS_COMMON_INCLUDE_DIRS GLOBUS_COMMON_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindGlobus_FTP_CLIENT.cmake000066400000000000000000000053541453603530000241140ustar00rootroot00000000000000# # This module detects if globus-ftp-client is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # GLOBUS_FTP_CLIENT_LIBRARIES = full path to the globus-ftp-client libraries # GLOBUS_FTP_CLIENT_INCLUDE_DIR = include dir to be used when using the globus-ftp-client library # GLOBUS_FTP_CLIENT_FOUND = set to true if globus-ftp-client was found successfully # # GLOBUS_FTP_CLIENT_LOCATION # setting this enables search for globus-ftp-client libraries / headers in this location find_package (PkgConfig) pkg_check_modules(GLOBUS_FTP_CLIENT_PKG globus-ftp-client) if (GLOBUS_FTP_CLIENT_PKG_FOUND) set (GLOBUS_FTP_CLIENT_LIBRARIES ${GLOBUS_FTP_CLIENT_PKG_LIBRARIES}) set (GLOBUS_FTP_CLIENT_INCLUDE_DIRS ${GLOBUS_FTP_CLIENT_PKG_INCLUDE_DIRS}) set (GLOBUS_FTP_CLIENT_DEFINITIONS "${GLOBUS_FTP_CLIENT_PKG_CFLAGS}") else (GLOBUS_FTP_CLIENT_PKG_FOUND) set (CMAKE_FIND_FRAMEWORK NEVER) find_library(GLOBUS_FTP_CLIENT_LIBRARIES NAMES globus_ftp_client HINTS ${GLOBUS_FTP_CLIENT_LOCATION} ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib64 ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/lib ${GLOBUS_PREFIX}/libexec/lib DOC "The main globus-ftp-client library" ) find_path(GLOBUS_FTP_CLIENT_INCLUDE_DIRS NAMES globus_ftp_client.h HINTS ${GLOBUS_FTP_CLIENT_LOCATION}/include/* ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/include ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/include ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/include ${GLOBUS_PREFIX}/libexec/include DOC "The globus-ftp-client include directory" ) set (GLOBUS_FTP_CLIENT_DEFINITIONS "") endif (GLOBUS_FTP_CLIENT_PKG_FOUND) if (GLOBUS_FTP_CLIENT_LIBRARIES) message (STATUS "GLOBUS_FTP_CLIENT libraries: ${GLOBUS_FTP_CLIENT_LIBRARIES}") endif (GLOBUS_FTP_CLIENT_LIBRARIES) if (GLOBUS_FTP_CLIENT_INCLUDE_DIRS) message (STATUS "GLOBUS_FTP_CLIENT include dir: ${GLOBUS_FTP_CLIENT_INCLUDE_DIRS}") endif (GLOBUS_FTP_CLIENT_INCLUDE_DIRS) # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set GLOBUS_FTP_CLIENT_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args (GLOBUS_FTP_CLIENT DEFAULT_MSG GLOBUS_FTP_CLIENT_LIBRARIES GLOBUS_FTP_CLIENT_INCLUDE_DIRS ) mark_as_advanced(GLOBUS_FTP_CLIENT_INCLUDE_DIRS GLOBUS_FTP_CLIENT_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindGlobus_GASS_COPY.cmake000066400000000000000000000052201453603530000240040ustar00rootroot00000000000000# # This module detects if globus-gass-copy is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # GLOBUS_GASS_COPY_LIBRARIES = full path to the globus-gass-copy libraries # GLOBUS_GASS_COPY_INCLUDE_DIR = include dir to be used when using the globus-gass-copy library # GLOBUS_GASS_COPY_FOUND = set to true if globus-gass-copy was found successfully # # GLOBUS_GASS_COPY_LOCATION # setting this enables search for globus-gass-copy libraries / headers in this location find_package (PkgConfig) pkg_check_modules(GLOBUS_GASS_COPY_PKG globus-gass-copy) if (GLOBUS_GASS_COPY_PKG_FOUND) set (GLOBUS_GASS_COPY_LIBRARIES ${GLOBUS_GASS_COPY_PKG_LIBRARIES}) set (GLOBUS_GASS_COPY_INCLUDE_DIRS ${GLOBUS_GASS_COPY_PKG_INCLUDE_DIRS}) set (GLOBUS_GASS_COPY_DEFINITIONS "${GLOBUS_GASS_COPY_PKG_CFLAGS}") else (GLOBUS_GASS_COPY_PKG_FOUND) find_library(GLOBUS_GASS_COPY_LIBRARIES NAMES globus_gass_copy HINTS ${GLOBUS_GASS_COPY_LOCATION} ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib64 ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/lib ${GLOBUS_PREFIX}/libexec/lib DOC "The main globus-gass-copy library" ) find_path(GLOBUS_GASS_COPY_INCLUDE_DIRS NAMES globus_gass_copy.h HINTS ${GLOBUS_GASS_COPY_LOCATION}/include/* ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/include ${GLOBUS_PREFIX}/libexec/include DOC "The globus-gass-copy include directory" ) set (GLOBUS_GASS_COPY_DEFINITIONS "") endif (GLOBUS_GASS_COPY_PKG_FOUND) if (GLOBUS_GASS_COPY_LIBRARIES) message (STATUS "GLOBUS_GSSAPI_GSI libraries: ${GLOBUS_GASS_COPY_LIBRARIES}") endif (GLOBUS_GASS_COPY_LIBRARIES) if (GLOBUS_GASS_COPY_INCLUDE_DIRS) message (STATUS "GLOBUS_GSSAPI_GSI include dir: ${GLOBUS_GASS_COPY_INCLUDE_DIRS}") endif (GLOBUS_GASS_COPY_INCLUDE_DIRS) # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set GLOBUS_GASS_COPY_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args (GLOBUS_GSSAPI_GSI DEFAULT_MSG GLOBUS_GASS_COPY_LIBRARIES GLOBUS_GASS_COPY_INCLUDE_DIRS ) mark_as_advanced(GLOBUS_GASS_COPY_INCLUDE_DIRS GLOBUS_GASS_COPY_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindGlobus_GSI_CERT_UTILS.cmake000066400000000000000000000056301453603530000246410ustar00rootroot00000000000000# # This module detects if globus-gsi-cert-utils is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # GLOBUS_GSI_CERT_UTILS_LIBRARIES = full path to the globus-gsi-cert-utils libraries # GLOBUS_GSI_CERT_UTILS_INCLUDE_DIR = include dir to be used when using the globus-gsi-cert-utils library # GLOBUS_GSI_CERT_UTILS_FOUND = set to true if globus-gsi-cert-utils was found successfully # # GLOBUS_GSI_CERT_UTILS_LOCATION # setting this enables search for globus-gsi-cert-utils libraries / headers in this location find_package (PkgConfig) pkg_check_modules(GLOBUS_GSI_CERT_UTILS_PKG globus-gsi-cert-utils) if (GLOBUS_GSI_CERT_UTILS_PKG_FOUND) set (GLOBUS_GSI_CERT_UTILS_LIBRARIES ${GLOBUS_GSI_CERT_UTILS_PKG_LIBRARIES}) set (GLOBUS_GSI_CERT_UTILS_INCLUDE_DIRS ${GLOBUS_GSI_CERT_UTILS_PKG_INCLUDE_DIRS}) set (GLOBUS_GSI_CERT_UTILS_DEFINITIONS "${GLOBUS_GSI_CERT_UTILS_PKG_CFLAGS}") else (GLOBUS_GSI_CERT_UTILS_PKG_FOUND) set (CMAKE_FIND_FRAMEWORK NEVER) find_library(GLOBUS_GSI_CERT_UTILS_LIBRARIES NAMES globus_gsi_cert_utils HINTS ${GLOBUS_GSI_CERT_UTILS_LOCATION} ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib64 ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/lib ${GLOBUS_PREFIX}/libexec/lib DOC "The main globus-gsi-cert-utils library" ) find_path(GLOBUS_GSI_CERT_UTILS_INCLUDE_DIRS NAMES globus_gsi_cert_utils.h HINTS ${GLOBUS_GSI_CERT_UTILS_LOCATION}/include/* ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/include ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/include ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/include ${GLOBUS_PREFIX}/libexec/include DOC "The globus-gsi-cert-utils include directory" ) set (GLOBUS_GSI_CERT_UTILS_DEFINITIONS "") endif (GLOBUS_GSI_CERT_UTILS_PKG_FOUND) if (GLOBUS_GSI_CERT_UTILS_LIBRARIES) message (STATUS "GLOBUS_GSI_CERT_UTILS libraries: ${GLOBUS_GSI_CERT_UTILS_LIBRARIES}") endif (GLOBUS_GSI_CERT_UTILS_LIBRARIES) if (GLOBUS_GSI_CERT_UTILS_INCLUDE_DIRS) message (STATUS "GLOBUS_GSI_CERT_UTILS include dir: ${GLOBUS_GSI_CERT_UTILS_INCLUDE_DIRS}") endif (GLOBUS_GSI_CERT_UTILS_INCLUDE_DIRS) # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set GLOBUS_GSI_CERT_UTILS_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args (GLOBUS_GSI_CERT_UTILS DEFAULT_MSG GLOBUS_GSI_CERT_UTILS_LIBRARIES GLOBUS_GSI_CERT_UTILS_INCLUDE_DIRS ) mark_as_advanced(GLOBUS_GSI_CERT_UTILS_INCLUDE_DIRS GLOBUS_GSI_CERT_UTILS_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindGlobus_GSI_CREDENTIAL.cmake000066400000000000000000000056311453603530000245370ustar00rootroot00000000000000# # This module detects if globus-gsi-credential is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # GLOBUS_GSI_CREDENTIAL_LIBRARIES = full path to the globus-gsi-credential libraries # GLOBUS_GSI_CREDENTIAL_INCLUDE_DIR = include dir to be used when using the globus-gsi-credential library # GLOBUS_GSI_CREDENTIAL_FOUND = set to true if globus-gsi-credential was found successfully # # GLOBUS_GSI_CREDENTIAL_LOCATION # setting this enables search for globus-gsi-credential libraries / headers in this location find_package (PkgConfig) pkg_check_modules(GLOBUS_GSI_CREDENTIAL_PKG globus-gsi-credential) if (GLOBUS_GSI_CREDENTIAL_PKG_FOUND) set (GLOBUS_GSI_CREDENTIAL_LIBRARIES ${GLOBUS_GSI_CREDENTIAL_PKG_LIBRARIES}) set (GLOBUS_GSI_CREDENTIAL_INCLUDE_DIRS ${GLOBUS_GSI_CREDENTIAL_PKG_INCLUDE_DIRS}) set (GLOBUS_GSI_CREDENTIAL_DEFINITIONS "${GLOBUS_GSI_CREDENTIAL_PKG_CFLAGS}") else (GLOBUS_GSI_CREDENTIAL_PKG_FOUND) set (CMAKE_FIND_FRAMEWORK NEVER) find_library(GLOBUS_GSI_CREDENTIAL_LIBRARIES NAMES globus_gsi_credential HINTS ${GLOBUS_GSI_CREDENTIAL_LOCATION} ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib64 ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/lib ${GLOBUS_PREFIX}/libexec/lib DOC "The main globus-gsi-credential library" ) find_path(GLOBUS_GSI_CREDENTIAL_INCLUDE_DIRS NAMES globus_gsi_credential.h HINTS ${GLOBUS_GSI_CREDENTIAL_LOCATION}/include/* ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/include ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/include ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/include ${GLOBUS_PREFIX}/libexec/include DOC "The globus-gsi-credential include directory" ) set (GLOBUS_GSI_CREDENTIAL_DEFINITIONS "") endif (GLOBUS_GSI_CREDENTIAL_PKG_FOUND) if (GLOBUS_GSI_CREDENTIAL_LIBRARIES) message (STATUS "GLOBUS_GSI_CREDENTIAL libraries: ${GLOBUS_GSI_CREDENTIAL_LIBRARIES}") endif (GLOBUS_GSI_CREDENTIAL_LIBRARIES) if (GLOBUS_GSI_CREDENTIAL_INCLUDE_DIRS) message (STATUS "GLOBUS_GSI_CREDENTIAL include dir: ${GLOBUS_GSI_CREDENTIAL_INCLUDE_DIRS}") endif (GLOBUS_GSI_CREDENTIAL_INCLUDE_DIRS) # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set GLOBUS_GSI_CREDENTIAL_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args (GLOBUS_GSI_CREDENTIAL DEFAULT_MSG GLOBUS_GSI_CREDENTIAL_LIBRARIES GLOBUS_GSI_CREDENTIAL_INCLUDE_DIRS ) mark_as_advanced(GLOBUS_GSI_CREDENTIAL_INCLUDE_DIRS GLOBUS_GSI_CREDENTIAL_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindGlobus_GSSAPI_GSI.cmake000066400000000000000000000053411453603530000241110ustar00rootroot00000000000000# # This module detects if globus-gssapi-gsi is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # GLOBUS_GSSAPI_GSI_LIBRARIES = full path to the globus-gssapi-gsi libraries # GLOBUS_GSSAPI_GSI_INCLUDE_DIR = include dir to be used when using the globus-gssapi-gsi library # GLOBUS_GSSAPI_GSI_FOUND = set to true if globus-gssapi-gsi was found successfully # # GLOBUS_GSSAPI_GSI_LOCATION # setting this enables search for globus-gssapi-gsi libraries / headers in this location find_package (PkgConfig) pkg_check_modules(GLOBUS_GSSAPI_GSI_PKG globus-gssapi-gsi) if (GLOBUS_GSSAPI_GSI_PKG_FOUND) set (GLOBUS_GSSAPI_GSI_LIBRARIES ${GLOBUS_GSSAPI_GSI_PKG_LIBRARIES}) set (GLOBUS_GSSAPI_GSI_INCLUDE_DIRS ${GLOBUS_GSSAPI_GSI_PKG_INCLUDE_DIRS}) set (GLOBUS_GSSAPI_GSI_DEFINITIONS "${GLOBUS_GSSAPI_GSI_PKG_CFLAGS}") else (GLOBUS_GSSAPI_GSI_PKG_FOUND) set (CMAKE_FIND_FRAMEWORK NEVER) find_library(GLOBUS_GSSAPI_GSI_LIBRARIES NAMES globus_gssapi_gsi HINTS ${GLOBUS_GSSAPI_GSI_LOCATION} ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib64 ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/lib ${GLOBUS_PREFIX}/libexec/lib DOC "The main globus-gssapi-gsi library" ) find_path(GLOBUS_GSSAPI_GSI_INCLUDE_DIRS NAMES gssapi.h HINTS ${GLOBUS_GSSAPI_GSI_LOCATION}/include/* ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/include ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/include ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/include ${GLOBUS_PREFIX}/libexec/include DOC "The globus-gssapi-gsi include directory" ) set (GLOBUS_GSSAPI_GSI_DEFINITIONS "") endif (GLOBUS_GSSAPI_GSI_PKG_FOUND) if (GLOBUS_GSSAPI_GSI_LIBRARIES) message (STATUS "GLOBUS_GSSAPI_GSI libraries: ${GLOBUS_GSSAPI_GSI_LIBRARIES}") endif (GLOBUS_GSSAPI_GSI_LIBRARIES) if (GLOBUS_GSSAPI_GSI_INCLUDE_DIRS) message (STATUS "GLOBUS_GSSAPI_GSI include dir: ${GLOBUS_GSSAPI_GSI_INCLUDE_DIRS}") endif (GLOBUS_GSSAPI_GSI_INCLUDE_DIRS) # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set GLOBUS_GSSAPI_GSI_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args (GLOBUS_GSSAPI_GSI DEFAULT_MSG GLOBUS_GSSAPI_GSI_LIBRARIES GLOBUS_GSSAPI_GSI_INCLUDE_DIRS ) mark_as_advanced(GLOBUS_GSSAPI_GSI_INCLUDE_DIRS GLOBUS_GSSAPI_GSI_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindGlobus_GSS_ASSIST.cmake000066400000000000000000000053021453603530000241400ustar00rootroot00000000000000# # This module detects if globus-gssapi-gsi is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # GLOBUS_GSS_ASSIST_LIBRARIES = full path to the globus-gssapi-gsi libraries # GLOBUS_GSS_ASSIST_INCLUDE_DIR = include dir to be used when using the globus-gssapi-gsi library # GLOBUS_GSS_ASSIST_FOUND = set to true if globus-gssapi-gsi was found successfully # # GLOBUS_GSS_ASSIST_LOCATION # setting this enables search for globus-gssapi-gsi libraries / headers in this location find_package (PkgConfig) pkg_check_modules(GLOBUS_GSS_ASSIST_PKG globus-gss-assist) if (GLOBUS_GSS_ASSIST_PKG_FOUND) set (GLOBUS_GSS_ASSIST_LIBRARIES ${GLOBUS_GSS_ASSIST_PKG_LIBRARIES}) set (GLOBUS_GSS_ASSIST_INCLUDE_DIRS ${GLOBUS_GSS_ASSIST_PKG_INCLUDE_DIRS}) set (GLOBUS_GSS_ASSIST_DEFINITIONS "${GLOBUS_GSS_ASSIST_PKG_CFLAGS}") else (GLOBUS_GSS_ASSIST_PKG_FOUND) find_library(GLOBUS_GSS_ASSIST_LIBRARIES NAMES globus_gss_assist HINTS ${GLOBUS_GSS_ASSIST_LOCATION} ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib64 ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/lib ${GLOBUS_PREFIX}/libexec/lib DOC "The main globus-gssapi-gsi library" ) find_path(GLOBUS_GSS_ASSIST_INCLUDE_DIRS NAMES globus_gss_assist.h HINTS ${GLOBUS_GSS_ASSIST_LOCATION}/include/* ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/include ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/include ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/include ${GLOBUS_PREFIX}/libexec/include DOC "The globus-gss-assist include directory" ) set (GLOBUS_GSS_ASSIST_DEFINITIONS "") endif (GLOBUS_GSS_ASSIST_PKG_FOUND) if (GLOBUS_GSS_ASSIST_LIBRARIES) message (STATUS "GLOBUS GSS ASSIST libraries: ${GLOBUS_GSS_ASSIST_LIBRARIES}") endif (GLOBUS_GSS_ASSIST_LIBRARIES) if (GLOBUS_GSS_ASSIST_INCLUDE_DIRS) message (STATUS "GLOBUS GSS ASSIST include dir: ${GLOBUS_GSS_ASSIST_INCLUDE_DIRS}") endif (GLOBUS_GSS_ASSIST_INCLUDE_DIRS) # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set GLOBUS_GSS_ASSIST_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args (GLOBUS_ASSIST DEFAULT_MSG GLOBUS_GSS_ASSIST_LIBRARIES GLOBUS_GSS_ASSIST_INCLUDE_DIRS ) mark_as_advanced(GLOBUS_GSS_ASSIST_INCLUDE_DIRS GLOBUS_GSS_ASSIST_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindGlobus_OPENSSL.cmake000066400000000000000000000051621453603530000235450ustar00rootroot00000000000000# # This module detects if globus-openssl is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # GLOBUS_OPENSSL_LIBRARIES = full path to the globus-openssl libraries # GLOBUS_OPENSSL_INCLUDE_DIR = include dir to be used when using the globus-openssl library # GLOBUS_OPENSSL_FOUND = set to true if globus-openssl was found successfully # # GLOBUS_OPENSSL_LOCATION # setting this enables search for globus-openssl libraries / headers in this location find_package (PkgConfig) pkg_check_modules(GLOBUS_OPENSSL_PKG globus-openssl-module) if (GLOBUS_OPENSSL_PKG_FOUND) set (GLOBUS_OPENSSL_LIBRARIES ${GLOBUS_OPENSSL_PKG_LIBRARIES}) set (GLOBUS_OPENSSL_INCLUDE_DIRS ${GLOBUS_OPENSSL_PKG_INCLUDE_DIRS}) set (GLOBUS_OPENSSL_DEFINITIONS "${GLOBUS_OPENSSL_PKG_CFLAGS}") else (GLOBUS_OPENSSL_PKG_FOUND) set (CMAKE_FIND_FRAMEWORK NEVER) find_library(GLOBUS_OPENSSL_LIBRARIES NAMES globus_openssl HINTS ${GLOBUS_OPENSSL_LOCATION} ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib64 ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/lib ${GLOBUS_PREFIX}/libexec/lib DOC "The main globus-openssl library" ) find_path(GLOBUS_OPENSSL_INCLUDE_DIRS NAMES globus_openssl.h HINTS ${GLOBUS_OPENSSL_LOCATION}/include/* ${CMAKE_INSTALL_PREFIX}/globus/*/${PLATFORM}/include ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/include ${CMAKE_INSTALL_PREFIX}/opt/globus-toolkit/libexec/include ${GLOBUS_PREFIX}/libexec/include DOC "The globus-openssl include directory" ) set (GLOBUS_OPENSSL_DEFINITIONS "") endif (GLOBUS_OPENSSL_PKG_FOUND) if (GLOBUS_OPENSSL_LIBRARIES) message (STATUS "GLOBUS_OPENSSL libraries: ${GLOBUS_OPENSSL_LIBRARIES}") endif (GLOBUS_OPENSSL_LIBRARIES) if (GLOBUS_OPENSSL_INCLUDE_DIRS) message (STATUS "GLOBUS_OPENSSL include dir: ${GLOBUS_OPENSSL_INCLUDE_DIRS}") endif (GLOBUS_OPENSSL_INCLUDE_DIRS) # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set GLOBUS_OPENSSL_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args (GLOBUS_OPENSSL DEFAULT_MSG GLOBUS_OPENSSL_LIBRARIES GLOBUS_OPENSSL_INCLUDE_DIRS ) mark_as_advanced(GLOBUS_OPENSSL_INCLUDE_DIRS GLOBUS_OPENSSL_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindLFC.cmake000066400000000000000000000040521453603530000215100ustar00rootroot00000000000000# # This module detects if LFC is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # LFC_LIBRARIES = full path to the LFC libraries # LFC_INCLUDE_DIR = include dir to be used when using the LFC library # LFC_FOUND = set to true if LFC was found successfully # # LFC_LOCATION # setting this enables search for LFC libraries / headers in this location # ----------------------------------------------------- # LFC Libraries # ----------------------------------------------------- find_library(LFC_LIBRARIES NAMES lfc lcgdm HINTS ${LFC_LOCATION} ${STAGE_DIR} ${CMAKE_INSTALL_PREFIX}/lfc/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/lfc/*/${PLATFORM}/ DOC "The main LFC library" ) # ----------------------------------------------------- # LFC Include Directories # ----------------------------------------------------- find_path(LFC_INCLUDE_DIR NAMES lfc/lfc_api.h HINTS ${LFC_LOCATION} ${STAGE_DIR} ${CMAKE_INSTALL_PREFIX}/lfc/*/${PLATFORM}/ ${CMAKE_INSTALL_PREFIX}/Grid/lfc/*/${PLATFORM}/ DOC "The LFC include directory" ) if(LFC_INCLUDE_DIR) message(STATUS "LFC includes found in ${LFC_INCLUDE_DIR}") endif() # ----------------------------------------------------- # LCGDM Include Directories # ----------------------------------------------------- find_path(LCGDM_INCLUDE_DIR NAMES Cinit.h HINTS ${LCGDM_LOCATION} ${LCGDM_LOCATION}/include ${LCGDM_LOCATION}/include/lcgdm /usr/include/lcgdm ${LCGDM_LOCATION}/include/dpm /usr/include/dpm /usr/include/lfc DOC "The LCGDM include directory" ) # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set LFC_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LFC DEFAULT_MSG LFC_LIBRARIES LFC_INCLUDE_DIR) mark_as_advanced(LFC_INCLUDE_DIR LFC_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindPugiXML.cmake000066400000000000000000000031301453603530000223650ustar00rootroot00000000000000# # This module detects if pugixml is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # PUGIXML_LIBRARIES = full path to the pugixml libraries # PUGIXML_INCLUDE_DIR = include dir to be used when using the pugixml library # PUGIXML_FOUND = set to true if pugixml was found successfully # # PUGIXML_LOCATION # setting this enables search for pugixml libraries / headers in this location # ----------------------------------------------------- # PUGIXML Libraries # ----------------------------------------------------- find_library(PUGIXML_LIBRARIES NAMES pugixml HINTS ${PUGIXML_LOCATION}/lib ${PUGIXML_LOCATION}/lib64 ${PUGIXML_LOCATION}/lib32 DOC "The main pugixml library" ) # ----------------------------------------------------- # PUGIXML Include Directories # ----------------------------------------------------- find_path(PUGIXML_INCLUDE_DIR NAMES pugixml.hpp HINTS ${PUGIXML_LOCATION} ${PUGIXML_LOCATION}/include ${PUGIXML_LOCATION}/include/* /usr/include DOC "The pugixml include directory" ) if(PUGIXML_INCLUDE_DIR) message(STATUS "pugixml includes found in ${PUGIXML_INCLUDE_DIR}") endif() # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set PUGIXML_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args(pugixml DEFAULT_MSG PUGIXML_LIBRARIES PUGIXML_INCLUDE_DIR) mark_as_advanced(PUGIXML_INCLUDE_DIR PUGIXML_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindPythonEasy.cmake000066400000000000000000000135041453603530000232110ustar00rootroot00000000000000# - Find python libraries # This module find the current version of python on your installation in a easy way # # PYTHON_LIBRARIES = path to the python library # PYTHON_LIBRARIES_${VERSION} = path to the python library for the distribution version # PYTHON_SITE_PACKAGES_${_VERSION} = path to the python modules dir # PYTHON_LIBRARIES = path to the python modules dir for the distribution version # PYTHON_INCLUDE_PATH = path to where Python.h is found # PYTHON_INCLUDE_PATH_${VERSION} = path to where Python.h for the distribution version # PYTHON_EXECUTABLE = python interpreter for the distribution version # PYTHON_EXECUTABLE_${VERSION} = available python version # PYTHON_AVAILABLE_VERSIONS = list all the version available on the system # -- LIST(APPEND L_PYTHON_VERSIONS "1.5" "1.6" "2.0" "2.1" "2.2" "2.4" "2.5" "2.6" "2.7" "2.8" "3" "3.0" "3.1" "3.2" "3.3" "3.4" "3.5" "3.6" "3.7" "3.8" "3.9" "3.10" "3.11" "3.12" "3.13" ) INCLUDE(FindPackageHandleStandardArgs) # determine the std version # main version executable FIND_PROGRAM(PYTHON_EXECUTABLE NAMES python | python3 HINTS ${ALT_PYTHON_LOCATION}/bin PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.13\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.12\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.6\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.5\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.4\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.3\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.2\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.1\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.0\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.8\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath] ) EXECUTE_PROCESS( COMMAND ${PYTHON_EXECUTABLE} -c "import sys; print('%s.%s' % sys.version_info[:2])" OUTPUT_VARIABLE PYTHON_CURRENT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) ## tests for all versions of the packages FOREACH(_VERSION ${L_PYTHON_VERSIONS}) STRING(REPLACE "." "" _VERSION_NO_DOTS ${_VERSION}) FIND_PROGRAM(PYTHON_EXECUTABLE_${_VERSION} NAMES python${_VERSION} HINTS ${ALT_PYTHON_LOCATION}/bin/ ) IF(PYTHON_EXECUTABLE_${_VERSION}) LIST(APPEND PYTHON_AVAILABLE_VERSIONS ${_VERSION}) EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE_${_VERSION}} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES_${_VERSION} OUTPUT_STRIP_TRAILING_WHITESPACE) # find libs EXECUTE_PROCESS(COMMAND python${_VERSION}-config --ldflags OUTPUT_VARIABLE PYTHON_LIBRARY_${_VERSION}_NOSTRIP OUTPUT_STRIP_TRAILING_WHITESPACE ) STRING(STRIP "${PYTHON_LIBRARY_${_VERSION}_NOSTRIP}" PYTHON_LIBRARY_${_VERSION}) SET(PYTHON_LIBRARIES_${_VERSION} ${PYTHON_LIBRARY_${_VERSION}}) # find include EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE_${_VERSION}} -c "from distutils import sysconfig; print(sysconfig.get_python_inc())" OUTPUT_VARIABLE PYTHON_INCLUDE_PATH_${_VERSION} OUTPUT_STRIP_TRAILING_WHITESPACE ) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Python${_VERSION} DEFAULT_MSG PYTHON_EXECUTABLE_${_VERSION}) MARK_AS_ADVANCED(PYTHON_EXECUTABLE_${_VERSION}) MARK_AS_ADVANCED(PYTHON_SITE_PACKAGES_${_VERSION}) MARK_AS_ADVANCED(PYTHON_LIBRARIES_${_VERSION}) MARK_AS_ADVANCED(PYTHON_INCLUDE_PATH_${_VERSION}) ENDIF(PYTHON_EXECUTABLE_${_VERSION}) ENDFOREACH(_VERSION ${L_PYTHON_VERSIONS}) SET(PYTHON_SITE_PACKAGES ${PYTHON_SITE_PACKAGES_${PYTHON_CURRENT_VERSION}} CACHE PATH "path to the python modules dir for the distribution version") SET(PYTHON_LIBRARIES ${PYTHON_LIBRARIES_${PYTHON_CURRENT_VERSION}} CACHE PATH "path to the python modules dir for the distribution version") SET(PYTHON_INCLUDE_PATH ${PYTHON_INCLUDE_PATH_${PYTHON_CURRENT_VERSION}} CACHE PATH "path to the python include dir for the distribution version") FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonCurrentVersion DEFAULT_MSG PYTHON_CURRENT_VERSION ) FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonCurrentInclude DEFAULT_MSG PYTHON_INCLUDE_PATH ) FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonCurrentLibs DEFAULT_MSG PYTHON_LIBRARIES ) FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonCurrentModsDir DEFAULT_MSG PYTHON_SITE_PACKAGES ) IF(PYTHON_EXECUTABLE_3) EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE_3} -c "import sys; print('%s.%s' % sys.version_info[:2])" OUTPUT_VARIABLE PYTHON3_CURRENT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) ENDIF() MARK_AS_ADVANCED(PYTHON_EXECUTABLE) MARK_AS_ADVANCED(PYTHON_SITE_PACKAGES) MARK_AS_ADVANCED(PYTHON_LIBRARIES) MARK_AS_ADVANCED(PYTHON_INCLUDE_PATH) gfal2-bindings-v1.12.2/cmake/modules/FindSRM_IFCE.cmake000066400000000000000000000045471453603530000223440ustar00rootroot00000000000000# # This module detects if SRM-IFCE is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # SRM_IFCE_LIBRARIES = full path to the SRM-IFCE libraries # SRM_IFCE_INCLUDE_DIR = include dir to be used when using the SRM-IFCE library # SRM_IFCE_FOUND = set to true if SRM-IFCE was found successfully # # SRM_IFCE_LOCATION # setting this enables search for SRM-IFCE libraries / headers in this location # ----------------------------------------------------- # Try with pkgconfig first # ----------------------------------------------------- find_package(PkgConfig) pkg_check_modules(SRM_IFCE_PKG REQUIRED srm-ifce>=1.15.0) if (SRM_IFCE_PKG_FOUND) set (SRM_IFCE_LIBRARIES "${SRM_IFCE_PKG_LIBRARIES}") set (SRM_IFCE_CFLAGS "${SRM_IFCE_PKG_CFLAGS}") if (SRM_IFCE_PKG_INCLUDE_DIRS) set (SRM_IFCE_INCLUDE_DIR "${SRM_IFCE_PKG_INCLUDE_DIRS}") else () set (SRM_IFCE_INCLUDE_DIR "/usr/include") endif () else () # SRM-IFCE Libraries find_library(SRM_IFCE_LIBRARIES NAMES gfal_srm_ifce HINTS ${SRM_IFCE_LOCATION}/lib ${SRM_IFCE_LOCATION}/lib64 ${SRM_IFCE_LOCATION}/lib32 ${STAGE_DIR}/lib ${STAGE_DIR}/lib64 ${CMAKE_INSTALL_PREFIX}/Grid/srm-ifce/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Grid/srm-ifce/*/${PLATFORM}/lib64 DOC "The main srm-ifce library" ) # SRM-IFCE Include Directories find_path(SRM_IFCE_INCLUDE_DIR NAMES gfal_srm_ifce.h HINTS ${SRM_IFCE_LOCATION} ${SRM_IFCE_LOCATION}/include ${SRM_IFCE_LOCATION}/include/* ${STAGE_DIR}/include ${STAGE_DIR}/include ${CMAKE_INSTALL_PREFIX}/Grid/srm-ifce/*/${PLATFORM}/include DOC "The srm-ifce include directory" ) set (SRM_IFCE_CFLAGS "") endif() if(SRM_IFCE_INCLUDE_DIR) message(STATUS "SRM-IFCE includes found in ${SRM_IFCE_INCLUDE_DIR}") endif() # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set SRM_IFCE_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args(SRM_IFCE DEFAULT_MSG SRM_IFCE_LIBRARIES SRM_IFCE_INCLUDE_DIR) mark_as_advanced(SRM_IFCE_LIBRARIES SRM_IFCE_INCLUDE_DIR SRM_IFCE_CFLAGS) gfal2-bindings-v1.12.2/cmake/modules/FindUUID.cmake000066400000000000000000000035341453603530000216560ustar00rootroot00000000000000# # This module detects if uuid is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # UUID_LIBRARIES = full path to the uuid libraries # UUID_INCLUDE_DIR = include dir to be used when using the uuid library # UUID_FOUND = set to true if uuid was found successfully # # UUID_LOCATION # setting this enables search for uuid libraries / headers in this location find_package (PkgConfig) pkg_check_modules(UUID_PKG uuid) if (UUID_PKG_FOUND) set (UUID_LIBRARIES ${UUID_PKG_LIBRARIES}) set (UUID_INCLUDE_DIRS ${UUID_PKG_INCLUDE_DIRS}) if (NOT UUID_INCLUDE_DIRS) set (UUID_INCLUDE_DIRS "/usr/include") endif (NOT UUID_INCLUDE_DIRS) set (UUID_DEFINITIONS "${UUID_PKG_CFLAGS} ${UUID_PKG_CFLAGS_OTHER}") else (UUID_PKG_FOUND) find_library(UUID_LIBRARIES NAMES uuid HINTS ${UUID_LOCATION} ${CMAKE_INSTALL_PREFIX}/uuid/*/${PLATFORM}/ DOC "The uuid library" ) find_path(UUID_INCLUDE_DIRS NAMES uuid.h HINTS ${UUID_LOCATION}/include/* ${CMAKE_INSTALL_PREFIX}/uuid/*/${PLATFORM}/ DOC "The uuid include directory" ) set (UUID_DEFINITIONS "") endif (UUID_PKG_FOUND) if (UUID_LIBRARIES) message (STATUS "UUID libraries: ${UUID_LIBRARIES}") endif (UUID_LIBRARIES) if (UUID_INCLUDE_DIRS) message (STATUS "UUID include dir: ${UUID_INCLUDE_DIRS}") endif (UUID_INCLUDE_DIRS) # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set UUID_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args (UUID DEFAULT_MSG UUID_LIBRARIES UUID_INCLUDE_DIRS ) mark_as_advanced(UUID_INCLUDE_DIRS UUID_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindVOMS.cmake000066400000000000000000000041161453603530000216710ustar00rootroot00000000000000# # This module detects if voms is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # VOMS_LIBRARIES = full path to the voms libraries # VOMS_INCLUDE_DIR = include dir to be used when using the voms library # VOMS_DEFINITIONS = compiler flags # VOMS_FOUND = set to true if voms was found successfully # # VOMS_LOCATION # setting this enables search for voms libraries / headers in this location find_package (PkgConfig) pkg_search_module(VOMS_PKG voms-2.0 voms) if (VOMS_PKG_FOUND) set (VOMS_LIBRARIES ${VOMS_PKG_LIBRARIES}) set (VOMS_INCLUDE_DIRS ${VOMS_PKG_INCLUDE_DIRS}) if (NOT VOMS_INCLUDE_DIRS) set (VOMS_INCLUDE_DIRS "/usr/include") endif (NOT VOMS_INCLUDE_DIRS) set (VOMS_DEFINITIONS "${VOMS_PKG_CFLAGS} ${VOMS_PKG_CFLAGS_OTHER}") else (VOMS_PKG_FOUND) message("SEARCH FOR ${CMAKE_INSTALL_PREFIX}/Grid/voms/*/${PLATFORM}/lib64") find_library(VOMS_LIBRARIES NAMES vomsapi HINTS ${VOMS_LOCATION} ${CMAKE_INSTALL_PREFIX}/Grid/voms/*/${PLATFORM}/lib ${CMAKE_INSTALL_PREFIX}/Grid/voms/*/${PLATFORM}/lib64 DOC "The voms library" ) find_path(VOMS_INCLUDE_DIRS NAMES voms/voms_api.h HINTS ${VOMS_LOCATION}/include/* ${CMAKE_INSTALL_PREFIX}/Grid/voms/*/${PLATFORM}/include DOC "The voms include directory" ) set (VOMS_CFLAGS "") endif (VOMS_PKG_FOUND) if (VOMS_LIBRARIES) message (STATUS "VOMS libraries: ${VOMS_LIBRARIES}") endif (VOMS_LIBRARIES) if (VOMS_INCLUDE_DIRS) message (STATUS "VOMS include dir: ${VOMS_INCLUDE_DIRS}") endif (VOMS_INCLUDE_DIRS) # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set VOMS_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args (VOMS DEFAULT_MSG VOMS_LIBRARIES VOMS_INCLUDE_DIRS ) mark_as_advanced(VOMS_LIBRARIES VOMS_INCLUDE_DIRS VOMS_DEFINITIONS) gfal2-bindings-v1.12.2/cmake/modules/FindXROOTD.cmake000066400000000000000000000041511453603530000221230ustar00rootroot00000000000000# - Try to find XROOTD libraries # # XROOTD_FOUND - System has XROOTD # XROOTD_INCLUDE_DIR - The XROOTD include directory # XROOTD_LIBRARIES - The libraries needed to use XROOTD # # XROOTD_LOCATION # setting this enables search for xrootd libraries / headers in this location # ----------------------------------------------------- # XROOTD Libraries # ----------------------------------------------------- find_library(XROOTD_CL NAMES XrdCl HINTS ${XROOTD_LOCATION}/lib ${XROOTD_LOCATION}/lib64 ${XROOTD_LOCATION}/lib32 DOC "xrootd cl" ) find_library(XROOTD_CLIENT NAMES XrdClient HINTS ${XROOTD_LOCATION}/lib ${XROOTD_LOCATION}/lib64 ${XROOTD_LOCATION}/lib32 DOC "xrootd client" ) find_library(XROOTD_POSIX NAMES XrdPosix HINTS ${XROOTD_LOCATION}/lib ${XROOTD_LOCATION}/lib64 ${XROOTD_LOCATION}/lib32 DOC "xrootd posix libraries" ) find_library(XROOTD_UTIL NAMES XrdUtils HINTS ${XROOTD_LOCATION}/lib ${XROOTD_LOCATION}/lib64 ${XROOTD_LOCATION}/lib32 DOC "xrootd util" ) set(XROOTD_LIBRARIES ${XROOTD_CL} ${XROOTD_CLIENT} ${XROOTD_POSIX} ${XROOTD_UTIL} ) if(XROOTD_LIBRARIES) message(STATUS "xrootd library found in ${XROOTD_LIBRARIES}") endif() # ----------------------------------------------------- # XROOTD Include Directories # ----------------------------------------------------- find_path(XROOTD_INCLUDE_DIR NAMES XrdVersion.hh HINTS ${XROOTD_LOCATION} ${XROOTD_LOCATION}/include ${XROOTD_LOCATION}/include/* ${XROOTD_LOCATION}/src/ /usr/include/xrootd ${CMAKE_INSTALL_PREFIX}/include/xrootd DOC "The xrootd include directory" ) if(XROOTD_INCLUDE_DIR) message(STATUS "xrootd includes found in ${XROOTD_INCLUDE_DIR}") endif() # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set XROOTD_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args(xrootd DEFAULT_MSG XROOTD_LIBRARIES XROOTD_INCLUDE_DIR) mark_as_advanced(XROOTD_INCLUDE_DIR XROOTD_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindZLIB.cmake000066400000000000000000000035441453603530000216510ustar00rootroot00000000000000# # This module detects if zlib is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # ZLIB_LIBRARIES = full path to the zlib libraries # ZLIB_INCLUDE_DIR = include dir to be used when using the glib2 library # ZLIB_FOUND = set to true if zlib was found successfully # # ZLIB_LOCATION # setting this enables search for zlib libraries / headers in this location find_package (PkgConfig) pkg_check_modules(ZLIB_PKG zlib) if (ZLIB_PKG_FOUND) set (ZLIB_LIBRARIES ${ZLIB_PKG_LIBRARIES}) set (ZLIB_INCLUDE_DIRS ${ZLIB_PKG_INCLUDE_DIRS}) if (NOT ZLIB_INCLUDE_DIRS) set (ZLIB_INCLUDE_DIRS "/usr/include") endif (NOT ZLIB_INCLUDE_DIRS) set (ZLIB_DEFINITIONS "${ZLIB_PKG_CFLAGS} ${ZLIB_PKG_CFLAGS_OTHER}") else (ZLIB_PKG_FOUND) find_library(ZLIB_LIBRARIES NAMES zlib HINTS ${ZLIB_LOCATION} ${CMAKE_INSTALL_PREFIX}/zlib/*/${PLATFORM}/ DOC "The main glib2 library" ) find_path(ZLIB_INCLUDE_DIRS NAMES zlib.h HINTS ${ZLIB_LOCATION}/include/* ${CMAKE_INSTALL_PREFIX}/zlib/*/${PLATFORM}/ DOC "The glib2 include directory" ) set (ZLIB_DEFINITIONS "") endif (ZLIB_PKG_FOUND) if (ZLIB_LIBRARIES) message (STATUS "ZLIB libraries: ${ZLIB_LIBRARIES}") endif (ZLIB_LIBRARIES) if (ZLIB_INCLUDE_DIRS) message (STATUS "ZLIB include dir: ${ZLIB_INCLUDE_DIRS}") endif (ZLIB_INCLUDE_DIRS) # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args (ZLIB DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS ) mark_as_advanced(ZLIB_INCLUDE_DIRS ZLIB_LIBRARIES) gfal2-bindings-v1.12.2/cmake/modules/FindgSOAP.cmake000066400000000000000000000105441453603530000220200ustar00rootroot00000000000000# # This module detects if gsoap is installed and determines where the # include files and libraries are. # # This code sets the following variables: # # GSOAP_LIBRARIES = full path to the gsoap libraries # GSOAP_SSL_LIBRARIES = full path to the gsoap ssl libraries # GSOAP_INCLUDE_DIR = include dir to be used when using the gsoap library # GSOAP_WSDL2H = wsdl2h binary # GSOAP_SOAPCPP2 = soapcpp2 binary # GSOAP_FOUND = set to true if gsoap was found successfully # # GSOAP_LOCATION # setting this enables search for gsoap libraries / headers in this location # ------------------------------------------------------ # try pkg config search # # ----------------------------------------------------- find_package(PkgConfig) pkg_check_modules(PC_GSOAP gsoap) IF(PC_GSOAP_FOUND) SET(GSOAP_LIBRARIES ${PC_GSOAP_LIBRARIES}) SET(GSOAP_INCLUDE_DIR ${PC_GSOAP_INCLUDE_DIRS}) if (NOT GSOAP_INCLUDE_DIR) set (GSOAP_INCLUDE_DIR "/usr/include") endif (NOT GSOAP_INCLUDE_DIR) SET(GSOAP_DEFINITIONS "${PC_GSOAP_CFLAGS} ${PC_GSOAP_CFLAGS_OTHER}") ELSE(PC_GSOAP_FOUND) # ----------------------------------------------------- # GSOAP Libraries # ----------------------------------------------------- find_library(GSOAP_LIBRARIES NAMES gsoap HINTS ${GSOAP_LOCATION} ${CMAKE_INSTALL_PREFIX}/gsoap/*/${PLATFORM}/ DOC "The main gsoap library" ) # ----------------------------------------------------- # GSOAP Include Directories # ----------------------------------------------------- find_path(GSOAP_INCLUDE_DIR NAMES stdsoap2.h HINTS ${GSOAP_LOCATION} ${CMAKE_INSTALL_PREFIX}/gsoap/*/${PLATFORM}/ DOC "The gsoap include directory" ) SET(GSOAP_DEFINITIONS "") ENDIF(PC_GSOAP_FOUND) # ----------------------------------------------------- # GSOAP ssl Libraries # ----------------------------------------------------- find_library(GSOAP_SSL_LIBRARIES NAMES gsoapssl HINTS ${GSOAP_LOCATION} ${CMAKE_INSTALL_PREFIX}/gsoap/*/${PLATFORM}/ DOC "The ssl gsoap library" ) # ----------------------------------------------------- # GSOAP Binaries # ----------------------------------------------------- find_program(GSOAP_WSDL2H NAMES wsdl2h HINTS ${GSOAP_LOCATION}/bin ${CMAKE_INSTALL_PREFIX}/gsoap/*/${PLATFORM}/bin/ DOC "The gsoap bin directory" ) find_program(GSOAP_SOAPCPP2 NAMES soapcpp2 HINTS ${GSOAP_LOCATION}/bin ${CMAKE_INSTALL_PREFIX}/gsoap/*/${PLATFORM}/bin/ DOC "The gsoap bin directory" ) # ----------------------------------------------------- # GSOAP_276_COMPAT_FLAGS and GSOAPVERSION # try to determine the flagfor the 2.7.6 compatiblity, break with 2.7.13 and re-break with 2.7.16 # ---------------------------------------------------- message(STATUS " - wsdlh : ${GSOAP_WSDL2H}") message(STATUS " - SOAPCPP2 : ${GSOAP_SOAPCPP2}") # some versions of soapcpp2 interpret "-v" as verbose, and hang while waiting for input # try "-help" first, and if it fails, do "-v" execute_process(COMMAND ${GSOAP_SOAPCPP2} "-help" OUTPUT_VARIABLE GSOAP_STRING_VERSION ERROR_VARIABLE GSOAP_STRING_VERSION ) string(REGEX MATCH "[0-9]*\\.[0-9]*\\.[0-9]*" GSOAP_VERSION ${GSOAP_STRING_VERSION}) if( "${GSOAP_VERSION}" STREQUAL "..") execute_process(COMMAND ${GSOAP_SOAPCPP2} "-v" OUTPUT_VARIABLE GSOAP_STRING_VERSION ERROR_VARIABLE GSOAP_STRING_VERSION ) string(REGEX MATCH "[0-9]*\\.[0-9]*\\.[0-9]*" GSOAP_VERSION ${GSOAP_STRING_VERSION}) endif() message(STATUS " - GSOAP VERSION : ${GSOAP_VERSION}") if( "${GSOAP_VERSION}" VERSION_LESS "2.7.6") set(GSOAP_276_COMPAT_FLAGS "") elseif ( "${GSOAP_VERSION}" VERSION_LESS "2.7.14") set(GSOAP_276_COMPAT_FLAGS "-z") else ( "${GSOAP_VERSION}" VERSION_LESS "2.7.14") set(GSOAP_276_COMPAT_FLAGS "-z1 -z2") endif ( "${GSOAP_VERSION}" VERSION_LESS "2.7.6") # ----------------------------------------------------- # handle the QUIETLY and REQUIRED arguments and set GSOAP_FOUND to TRUE if # all listed variables are TRUE # ----------------------------------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args(gsoap DEFAULT_MSG GSOAP_LIBRARIES GSOAP_INCLUDE_DIR GSOAP_WSDL2H GSOAP_SOAPCPP2) mark_as_advanced(GSOAP_INCLUDE_DIR GSOAP_LIBRARIES GSOAP_DEFINITIONS GSOAP_WSDL2H GSOAP_SOAPCPP2) gfal2-bindings-v1.12.2/cmake/modules/MacroAddDoxygen.cmake000066400000000000000000000010611453603530000233100ustar00rootroot00000000000000## ## Doxygen macro, allow Doxygen generation from cmake ## do a ""make doc" for the generation macro(addDoxyGeneration DOXYFILE_LOCATION) find_package(Doxygen) if(DOXYGEN_FOUND) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${DOXYFILE_LOCATION} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation with Doxygen" VERBATIM ) endif(DOXYGEN_FOUND) endmacro(addDoxyGeneration DOXYFILE_LOCATION) gfal2-bindings-v1.12.2/cmake/modules/MacroAddepydoc.cmake000066400000000000000000000036451453603530000231700ustar00rootroot00000000000000## ## Doxygen macro, allow Doxygen generation from cmake ## do a ""make doc" for the generation # for old version < 3.0 cmake variables replace config files ( not supported ) ( needed for EPEL 5 support ) # EPYDOC_MODULE_PATH path of the module to configure # EPYDOC_MODULE_URL project url # EPYDOC_MODULE_NAME project name # macro(addEpydocGeneration EPYDOC_CONFIG_LOCATION) IF(NOT EPYDOC_FOUND) execute_process(COMMAND epydoc --version OUTPUT_VARIABLE EPYDOC_VERSION_UNPARSED ERROR_VARIABLE EPYDOC_ERROR ) IF(${EPYDOC_ERROR}) message(SEND_ERROR "epydoc not found....") ELSE(${EPYDOC_ERROR}) string(REGEX REPLACE ".*version (.*)\n" "\\1" EPYDOC_VERSION ${EPYDOC_VERSION_UNPARSED}) message(STATUS " epydoc version ..... ${EPYDOC_VERSION} ") ENDIF(${EPYDOC_ERROR}) ENDIF(NOT EPYDOC_FOUND) IF(${EPYDOC_VERSION} VERSION_GREATER "3.0.0") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${EPYDOC_CONFIG_LOCATION} ${CMAKE_CURRENT_BINARY_DIR}/epydoc_config @ONLY) add_custom_target(doc epydoc --config ${CMAKE_CURRENT_BINARY_DIR}/epydoc_config -v WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generate API documentation with epydoc" VERBATIM ) ELSE(${EPYDOC_VERSION} VERSION_GREATER "3.0.0") # VERSION TOO OLD, NO CONFIG FILE MANAGEMENT add_custom_target(doc epydoc --html -u ${EPYDOC_MODULE_URL} -n ${EPYDOC_MODULE_NAME} -v -o ${CMAKE_CURRENT_BINARY_DIR}/html ${EPYDOC_MODULE_PATH} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generate API documentation with epydoc" VERBATIM ) ENDIF(${EPYDOC_VERSION} VERSION_GREATER "3.0.0") endmacro(addEpydocGeneration EPYDOC_CONFIG_LOCATION) gfal2-bindings-v1.12.2/cmake/modules/MacroCopyFile.cmake000066400000000000000000000017141453603530000230010ustar00rootroot00000000000000# - macro_copy_file(_src _dst) # Copies a file to ${_dst} only if ${_src} is different (newer) than ${_dst} # # Example: # macro_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/icon.png ${CMAKE_CURRENT_BINARY_DIR}/.) # Copies file icon.png to ${CMAKE_CURRENT_BINARY_DIR} directory # # Copyright (c) 2006-2007 Wengo # Copyright (c) 2006-2008 Andreas Schneider # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING file. macro(copy_files GLOBPAT DESTINATION) file(GLOB COPY_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${GLOBPAT}) add_custom_target(copy ALL COMMENT "Copying files: ${GLOBPAT}") foreach(FILENAME ${COPY_FILES}) set(SRC "${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}") set(DST "${DESTINATION}/${FILENAME}") add_custom_command( TARGET copy COMMAND ${CMAKE_COMMAND} -E copy ${SRC} ${DST} ) endforeach(FILENAME) endmacro(copy_files) gfal2-bindings-v1.12.2/cmake/modules/ReleaseDebugAutoFlags.cmake000066400000000000000000000006201453603530000244350ustar00rootroot00000000000000## debug / release autoManagement set(CMAKE_C_FLAGS_RELEASE "-O2") set(CMAKE_C_FLAGS_DEBUG "-g3 -O0 -ggdb -Wall -fstack-protector-all") set(CMAKE_CXX_FLAGS_RELEASE "-O2") set(CMAKE_CXX_FLAGS_DEBUG "-g3 -O0 -ggdb -Wall -fstack-protector-all") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -Wall -fstack-protector-all") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -Wall -fstack-protector-all") gfal2-bindings-v1.12.2/doc/000077500000000000000000000000001453603530000153155ustar00rootroot00000000000000gfal2-bindings-v1.12.2/doc/CMakeLists.txt000066400000000000000000000007441453603530000200620ustar00rootroot00000000000000 SET(MAIN_DOC TRUE CACHE STRING "enable installation of the main library documentation") ## ## execute make doc for doc generation # IF(MAIN_DOC AND BUILDDOCS) file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html/") addEpydocGeneration("epydoc_config.in") SET( l_doc "${CMAKE_CURRENT_BINARY_DIR}/html/") install(DIRECTORY ${l_doc} DESTINATION ${DOC_INSTALL_DIR}/html/) # install examples ENDIF(MAIN_DOC AND BUILDDOCS) gfal2-bindings-v1.12.2/doc/Doxyfile000066400000000000000000001452361453603530000170360ustar00rootroot00000000000000# Doxyfile 1.4.7 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = gfal2-bindings # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = 2.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = build/ # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, # Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, # Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, # Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, # Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # This tag can be used to specify the encoding used in the generated output. # The encoding is not always determined by the language that is chosen, # but also whether or not the output is meant for Windows or non-Windows users. # In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES # forces the Windows encoding (this is the default for the Windows binary), # whereas setting the tag to NO uses a Unix-style encoding (the default for # all platforms other than Windows). USE_WINDOWS_ENCODING = NO # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like the Qt-style comments (thus requiring an # explicit @brief command for a brief description. JAVADOC_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to # include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from the # version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = ../src/ ./src/ # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py FILE_PATTERNS = *.cpp *.h *.c # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = ../example/python/ # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = *.py # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = YES # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. Otherwise they will link to the documentstion. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = YES # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will # generate a call dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will # generate a caller dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected # functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_WIDTH = 1024 # The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_HEIGHT = 1024 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that a graph may be further truncated if the graph's # image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH # and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), # the graph is not depth-constrained. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, which results in a white background. # Warning: Depending on the platform used, enabling this option may lead to # badly anti-aliased labels on the edges of a graph (i.e. they become hard to # read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO gfal2-bindings-v1.12.2/doc/epydoc_config.in000066400000000000000000000007051453603530000204570ustar00rootroot00000000000000[epydoc] # Epydoc section marker (required by ConfigParser) # Information about the project. name: gfal2 python bindings url: http://dmc.web.cern.ch/projects/gfal2-python # The list of modules to document. Modules can be named using # dotted names, module filenames, or package directory names. # This option may be repeated. modules: @CMAKE_BINARY_DIR@/src/python2/gfal2.so # Write html output to the directory "apidocs" output: html target: html/ gfal2-bindings-v1.12.2/example/000077500000000000000000000000001453603530000162035ustar00rootroot00000000000000gfal2-bindings-v1.12.2/example/python/000077500000000000000000000000001453603530000175245ustar00rootroot00000000000000gfal2-bindings-v1.12.2/example/python/gfal2_bring_online.py000077500000000000000000000017531453603530000236270ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- ## # Example : bring online a file with gfal 2.0 # import gfal2 import sys if __name__ == '__main__': if len(sys.argv) < 2: print("Usage: %s [surl]" % sys.argv[0]) sys.exit(1) surl = sys.argv[1] ctx = gfal2.creat_context() try: # bring_online(surl, pintime, timeout, async) (status, token) = ctx.bring_online(surl, 60, 60, False) print("Got token %s" % token) while status == 0: status = ctx.bring_online_poll(surl, token) print("File brought online!") except gfal2.GError as e: print("Could not bring the file online:") print("\t", e.message) print("\t Code", e.code) sys.exit(2) try: ctx.release(surl, token) print("File released!") except gfal2.GError as e: print("Could not release the file:") print("\t", e.message) print("\t Code", e.code) sys.exit(3) sys.exit(0) gfal2-bindings-v1.12.2/example/python/gfal2_bulk_bring_online.py000077500000000000000000000031561453603530000246430ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- ## # Example : bring online a set of files with gfal2 # import errno import gfal2 import sys import time def evaluate_errors(errors, surls, polling): n_terminal = 0 for surl, error in zip(surls, errors): if error: if error.code != errno.EAGAIN: print "%s => FAILED: %s" % (surl, error.message) n_terminal += 1 else: print "%s QUEUED" elif not polling: print "%s QUEUED" % surl else: n_terminal += 1 print "%s READY" % surl return n_terminal if __name__ == '__main__': if len(sys.argv) < 2: print "Usage: %s [surl1] [surl2] [...]" % sys.argv[0] sys.exit(1) surls = sys.argv[1:] ctx = gfal2.creat_context() print "Bring online" print "============" (errors, token) = ctx.bring_online(surls, 60, 60, True) print "Got token %s" % token n_terminal = evaluate_errors(errors, surls, polling=False) sleep_time = 1 while n_terminal != len(surls): time.sleep(sleep_time) sleep_time = min(sleep_time * 2, 600) print print "Polling" print "=======" errors = ctx.bring_online_poll(surls, token) n_terminal = evaluate_errors(errors, surls, polling=True) print print "Release" print "=======" errors = ctx.release(surls, token) for surl, error in zip(surls, errors): if error: print "%s => RELEASE FAILED: %s" % (surl, error.message) else: print "%s RELEASED" % surl sys.exit(0) gfal2-bindings-v1.12.2/example/python/gfal2_bulk_copy.py000077500000000000000000000050261453603530000231460ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- ## # Example : copy a set of files in one go # import gfal2 import optparse import shlex import sys def event_callback(event): print("[%s] %s %s %s" % (event.timestamp, event.domain, event.stage, event.description)) def monitor_callback(src, dst, average, instant, transferred, elapsed): print("[%4d] %.2fMB (%.2fKB/s)\r" % (elapsed, transferred / 1048576, average / 1024)), sys.stdout.flush() if __name__ == '__main__': # Parse arguments parser = optparse.OptionParser(usage = 'usage: %prog [options] file') parser.add_option('-K', '--validate', dest = 'validate', action = 'store_true', help = 'Validate source and destination checksum', default = False) parser.add_option('-o', '--overwrite', dest = 'overwrite', action = 'store_true', help = 'Overwrite destination') (options, args) = parser.parse_args() if len(args) != 1: parser.error('Incorrect number of arguments. Need a file containing the list of sources and destinations.') sources = [] destinations = [] for line in open(args[0]).readlines(): l = shlex.split(line) if l: sources.append(l[0]) destinations.append(l[1]) print("Found %d pairs" % len(sources)) # Instantiate gfal2 ctx = gfal2.creat_context() # Set transfer parameters params = ctx.transfer_parameters() params.event_callback = event_callback params.monitor_callback = monitor_callback if options.overwrite: params.overwrite = True print("Enabled overwrite") if options.validate: params.checksum_check = True print("Enabled checksum check") # Copy! # In this case, an exception will be thrown if the whole process fails # If any transfer fail, the method will return a list of GError objects, one per file # being None if that file succeeded try: errors = ctx.filecopy(params, sources, destinations) if not errors: print("Copy succeeded!") else: for i in range(len(errors)): e = errors[i] src = sources[i] dst = destinations[i] if e: print("%s => %s failed [%d] %s" % (src, dst, e.code, e.message)) else: print("%s => %s succeeded!" % (src, dst)) except Exception as e: print("Copy failed: %s" % str(e)) sys.exit(1) gfal2-bindings-v1.12.2/example/python/gfal2_copy.py000077500000000000000000000051421453603530000221300ustar00rootroot00000000000000#!/usr/bin/env python import gfal2 import logging import optparse import sys gfal2.set_verbose(gfal2.verbose_level.debug) def event_callback(event): #print event print("[%s] %s %s %s" % (event.timestamp, event.domain, event.stage, event.description)) def monitor_callback(src, dst, average, instant, transferred, elapsed): print("[%4d] %.2fMB (%.2fKB/s)\r" % (elapsed, transferred / 1048576, average / 1024)), sys.stdout.flush() if __name__ == '__main__': # Parse arguments parser = optparse.OptionParser(usage = 'usage: %prog [options] source destination') parser.add_option('-s', '--source-space-token', dest = 'source_space_token', help = 'Source space token') parser.add_option('-d', '--dest-space-token', dest = 'dest_space_token', help = 'Destination space token') parser.add_option('-K', '--validate', dest = 'validate', action = 'store_true', help = 'Validate source and destination checksum', default = False) parser.add_option('-c', '--checksum', dest = 'checksum', help = 'Checksum (i.e. ADLER32:1234)') parser.add_option('-o', '--overwrite', dest = 'overwrite', action = 'store_true', help = 'Overwrite destination') (options, args) = parser.parse_args() if len(args) != 2: parser.error('Incorrect number of arguments. Need a source and a destination.') source = args[0] dest = args[1] print("Source: %s" % source) print("Destination: %s" % dest) # Instantiate gfal2 ctx = gfal2.creat_context() # Set transfer parameters params = ctx.transfer_parameters() params.event_callback = event_callback params.monitor_callback = monitor_callback if options.overwrite: params.overwrite = True print("Enabled overwrite") if options.validate or options.checksum: params.checksum_check = True print("Enabled checksum check") if options.checksum: (alg, val) = options.checksum.split(':') params.set_user_defined_checksum(alg, val) print("User defined checksum: %s:%s" % params.get_user_defined_checksum()) if options.source_space_token: params.src_spacetoken = options.source_space_token print("Source space token: %s" % params.src_spacetoken) if options.dest_space_token: params.dst_spacetoken = options.dest_space_token print("Destination space token: %s" % params.dst_spacetoken) # Five minutes timeout params.timeout = 300 # Copy! # Keep in mind source and destination can have different protocols, # and gfal2 will deal with it # (i.e. source can be file:/// and destination gsiftp://) try: r = ctx.filecopy(params, source, dest) print("Copy succeeded!") except Exception as e: print("Copy failed: %s" % str(e)) sys.exit(1) gfal2-bindings-v1.12.2/example/python/gfal2_copy_multiple_cred.py000077500000000000000000000063521453603530000250440ustar00rootroot00000000000000#!/usr/bin/env python import gfal2 import logging import optparse import sys def event_callback(event): #print event print("[%s] %s %s %s" % (event.timestamp, event.domain, event.stage, event.description)) def monitor_callback(src, dst, average, instant, transferred, elapsed): print("[%4d] %.2fMB (%.2fKB/s)\r" % (elapsed, transferred / 1048576, average / 1024)), sys.stdout.flush() if __name__ == '__main__': # Parse arguments parser = optparse.OptionParser(usage = 'usage: %prog [options] source destination') parser.add_option('-s', '--source-space-token', dest = 'source_space_token', help = 'Source space token') parser.add_option('-d', '--dest-space-token', dest = 'dest_space_token', help = 'Destination space token') parser.add_option('-K', '--validate', dest = 'validate', action = 'store_true', help = 'Validate source and destination checksum', default = False) parser.add_option('-c', '--checksum', dest = 'checksum', help = 'Checksum (i.e. ADLER32:1234)') parser.add_option('-o', '--overwrite', dest = 'overwrite', action = 'store_true', help = 'Overwrite destination') parser.add_option('--source_cred', dest = 'source_cred', help = 'Credentials for the source storage') parser.add_option('--dest_cred', dest = 'dest_cred', help = 'Credentials for the destination storage') (options, args) = parser.parse_args() if len(args) != 2: parser.error('Incorrect number of arguments. Need a source and a destination.') source = args[0] dest = args[1] print("Source: %s" % source) print("Destination: %s" % dest) # Instantiate gfal2 ctx = gfal2.creat_context() gfal2.set_verbose(gfal2.verbose_level.debug) # Set transfer parameters params = ctx.transfer_parameters() params.event_callback = event_callback params.monitor_callback = monitor_callback if options.overwrite: params.overwrite = True print("Enabled overwrite") if options.validate or options.checksum: params.checksum_check = True print("Enabled checksum check") if options.checksum: (alg, val) = options.checksum.split(':') params.set_user_defined_checksum(alg, val) print("User defined checksum: %s:%s" % params.get_user_defined_checksum()) if options.source_space_token: params.src_spacetoken = options.source_space_token print("Source space token: %s" % params.src_spacetoken) if options.dest_space_token: params.dst_spacetoken = options.dest_space_token print("Destination space token: %s" % params.dst_spacetoken) if options.source_cred: s_cred = gfal2.cred_new("X509_CERT",options.source_cred) gfal2.cred_set(ctx,source,s_cred) print("Source credentials: %s" % options.source_cred) if options.dest_cred: d_cred = gfal2.cred_new("X509_CERT",options.dest_cred) gfal2.cred_set(ctx,dest,d_cred) print("Destination credentials: %s" % options.dest_cred) # Five minutes timeout params.timeout = 300 # Copy! # Keep in mind source and destination can have different protocols, # and gfal2 will deal with it # (i.e. source can be file:/// and destination gsiftp://) try: r = ctx.filecopy(params, source, dest) print("Copy succeeded!") except Exception as e: print("Copy failed: %s" % str(e)) sys.exit(1) gfal2-bindings-v1.12.2/example/python/gfal2_get_turls.py000077500000000000000000000010761453603530000231700ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- ## # Example : get list of turls/replicas with gfal 2.0 # import gfal2 import sys if __name__ == '__main__': if len(sys.argv) < 2: print("Usage: %s [surl]" % sys.argv[0]) sys.exit(1) surl = sys.argv[1] ctx = gfal2.creat_context() try: replicas = ctx.getxattr(surl, 'user.replicas') print(replicas) except gfal2.GError as e: print("Could not get the replicas:") print("\t", e.message) print("\t Code", e.code) sys.exit(2) sys.exit(0) gfal2-bindings-v1.12.2/example/python/gfal2_long_listing.py000077500000000000000000000005501453603530000236440ustar00rootroot00000000000000#!/usr/bin/env python import sys import gfal2 if(len(sys.argv) < 2): print("Usage %s [URL]"%(sys.argv[0])) exit(1) ctxt = gfal2.creat_context() dirp = ctxt.opendir(sys.argv[1]) while(True): (dirent, stat) = dirp.readpp() if(dirent is None): break; print("filename %s, filesize: %d, filerights 0%o"%(dirent.d_name, stat.st_size, stat.st_mode)) gfal2-bindings-v1.12.2/example/python/gfal2_python_listdir.py000077500000000000000000000010731453603530000242300ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- ## # Example : list the content of a directory with gfal 2.0 # import sys import os import gfal2 ## main func if __name__ == '__main__': # comment for usage if(len(sys.argv) < 2): print("\nUsage\t %s [gfal_folder] \n"%(sys.argv[0])) print(" Example: %s lfn:/grid/dteam/ "%(sys.argv[0])) print(" %s srm://myserver.com/myhome/ \n"%(sys.argv[0])) os._exit(1) ctx = gfal2.creat_context() my_dir = ctx.listdir(sys.argv[1]) for d in my_dir: print(d) # no closedir needed, done automatically gfal2-bindings-v1.12.2/example/python/gfal2_python_read.py000077500000000000000000000015361453603530000234750ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- ## # Example : open/read/close a file with gfal 2.0 # import sys import os import gfal2 from string import printable ## main func if __name__ == '__main__': # comment for usage if(len(sys.argv) < 2): print("\nUsage\t %s [gfal_url] \n"%(sys.argv[0])) print(" Example: %s lfn:/grid/dteam/myfile "%(sys.argv[0])) print(" %s srm://myserver.com/myhome/myfile \n"%(sys.argv[0])) os._exit(1) ctx = gfal2.creat_context() # open the file f = ctx.open(sys.argv[1], 'r') # read first 10 bytesthe max_size first bytes. content = f.read(10) # Hex dump str = [] for byte in content: print("%2X " % ord(byte)), if byte in printable: str.append(byte) else: str.append('.') print('\t', ' '.join(str)) # no close needed, done automatically with the destruction of the file handle gfal2-bindings-v1.12.2/example/python/gfal2_qos_api.py000077500000000000000000000043741453603530000226170ustar00rootroot00000000000000#!/usr/bin/python import gfal2 import optparse import sys from urlparse import urlparse if __name__ == "__main__": # Override epilog parser to allow newlines optparse.OptionParser.format_epilog = lambda self, formatter: self.epilog helptext = """ Supported actions: - list-classes - list-transitions - get-qos - get-target-qos - change-qos Example: [list-classes]: https://cdmi-server.cern.ch:8443/ [list-transitions]: https://cdmi-server.cern.ch:8443/cdmi_capabilities/dataobject/class_name [get-qos]: https://cdmi-server.cern.ch:8443/path/to/file [get-target-qos]: https://cdmi-server.cern.ch:8443/path/to/file [change-qos]: https://cdmi-server.cern.ch:8443/path/to/file """ # Parse arguments parser = optparse.OptionParser(usage = "usage: %prog []", epilog = helptext) (options, args) = parser.parse_args() if len(args) < 3: parser.error("Incorrect number of arguments!") action = args[0] url = args[1] token = args[2] if action not in ["list-classes", "list-transitions", "get-qos", "get-target-qos", "change-qos"]: parser.error("Unrecognized action: %s" % action) if action == "change-qos": if len(args) < 4: parser.error("Missing argument!") target_qos = args[3] # Create Gfal2 handler context = gfal2.creat_context() cred = gfal2.cred_new("BEARER", token) host = '{uri.scheme}://{uri.netloc}/'.format(uri=urlparse(url)) gfal2.cred_set(context, host, cred) if action == "list-classes": print "Dataobject: %s" % context.qos_check_classes(host, "dataobject") print "Container: %s" % context.qos_check_classes(host, "container") elif action == "list-transitions": print context.check_available_qos_transitions(url) elif action == "get-qos": print context.check_file_qos(url) elif action == "get-target-qos": print context.check_target_qos(url) elif action == "change-qos": print context.change_object_qos(url, target_qos) else: # Should not reach here print "Unrecognized action" exit(1) gfal2-bindings-v1.12.2/example/python/gfal2_recursive_ls.py000077500000000000000000000061221453603530000236620ustar00rootroot00000000000000#!/usr/bin/env python import gfal2 import optparse import stat import sys from datetime import datetime class Crawler: def __init__(self, long=False, recursive=False, max_levels=2, context=gfal2.creat_context()): self.context = context self.long = long self.recursive = recursive self.max_levels = max_levels def _short_format(self, fname): return fname def _mode2str(self, mode): s = ['-'] * 10 if stat.S_ISDIR(mode): s[0] = 'd' elif stat.S_ISLNK(mode): s[0] = 'l' elif not stat.S_ISREG(mode): s[0] = '?' for i in range(3): if mode & stat.S_IRUSR: s[1 + i * 3] = 'r' if mode & stat.S_IWUSR: s[2 + i * 3] = 'w' if mode & stat.S_IXUSR: s[3 + i * 3] = 'x' mode = mode << 3 return ''.join(s) def _long_format(self, fname, fstat): return "%s %3d %5d %5d %10d %s %s" % \ (self._mode2str(fstat.st_mode), fstat.st_nlink, fstat.st_uid, fstat.st_gid, fstat.st_size, datetime.fromtimestamp(fstat.st_mtime).strftime('%b %d %H:%M'), fname) def _crawl(self, url, out, level=0): if level > self.max_levels: return tabbing = ' ' * level try: entries = [f for f in self.context.listdir(url) if f != '.' and f != '..'] except gfal2.GError: out.write(tabbing, '!') return for f in entries: full = url + '/' + f # Do the stat only if we need to if self.recursive or self.long: try: fstat = self.context.stat(full) except gfal2.GError: fstat = self.context.st_stat() # Print entry if self.long: out.write(tabbing, self._long_format(f, fstat)) else: out.write(tabbing, self._short_format(f)) # Descend if self.recursive and stat.S_ISDIR(fstat.st_mode): self._crawl(full, out, level + 1) def crawl(self, url, out=sys.stdout): self._crawl(url, out) if __name__ == '__main__': # Get the options parser = optparse.OptionParser() parser.add_option('-l', '--long', dest='long', default=False, action='store_true', help='Long format') parser.add_option('-r', '--recursive', dest='recursive', default=False, action='store_true', help='Recursive') parser.add_option('-m', '--max', dest='max_recursive', default=1, type='int', help='Maximum recursive level') (options, args) = parser.parse_args() if len(args) != 1: parser.error('Incorrect number of arguments. Need a path') url = args[0] # List recursively crawler = Crawler(options.long, options.recursive, options.max_recursive) crawler.crawl(url, sys.stdout) gfal2-bindings-v1.12.2/example/python/gfal2_simple_listing.py000077500000000000000000000003471453603530000242020ustar00rootroot00000000000000#!/usr/bin/env python import sys import gfal2 if(len(sys.argv) < 2): print("Usage %s [URL]"%(sys.argv[0])) exit(1) ctxt = gfal2.creat_context() r = ctxt.listdir(sys.argv[1]) map(lambda y: sys.stdout.write(("%s\n")%(y)), r) gfal2-bindings-v1.12.2/packaging/000077500000000000000000000000001453603530000164745ustar00rootroot00000000000000gfal2-bindings-v1.12.2/packaging/Makefile000066400000000000000000000044111453603530000201340ustar00rootroot00000000000000NAME=gfal2-python SPEC=rpm/$(NAME).spec VERSION=${shell grep '^Version:' $(SPEC) | awk '{print $$2}' } # Leave blank. To be overriden by CI tools. RELEASE= CWD=${shell pwd} RPMBUILD=/tmp/rpmbuild SRPMS=$(CWD) RPMS=$(CWD)/out MOCK_CHROOT=epel-6-cernonly-x86_64 MOCK_FLAGS=--verbose RPMDEFINES_SRC=--define='_topdir $(RPMBUILD)' \ --define='_sourcedir $(CWD)' \ --define='_builddir %{_topdir}/BUILD' \ --define='_srcrpmdir $(SRPMS)' \ --define='_rpmdir $(RPMS)' \ --define "_source_filedigest_algorithm md5" \ $(RPMBUILD_SRC_EXTRA_FLAGS) RPMDEFINES_BIN=--define='_topdir $(RPMBUILD)' \ --define='_sourcedir %{_topdir}/SOURCES' \ --define='_builddir %{_topdir}/BUILD' \ --define='_srcrpmdir $(SRPMS).' \ --define='_rpmdir $(RPMS)' \ --define "_binary_filedigest_algorithm md5" \ $(RPMBUILD_BIN_EXTRA_FLAGS) PBUILDER_FLAGS= PBUILDER_TMP="/tmp/" all: srpm clean: rm -fv *.tar rm -fv *.tar.gz rm -fv *.rpm rm -fv *.log rm -rfv out rm -fv *.deb rm -fv *.gz rm -fv *.dsc rm -fv *.changes rm -rfv "$(RPMBUILD)" dist: clean tar vczf "$(NAME)-$(VERSION).tar.gz" --exclude="packaging" --exclude-vcs --exclude=".git*" --exclude="ci/repo" --exclude="*.pyc" --exclude="setup.py" --transform="s,^,$(NAME)-$(VERSION)/," .. $(RPMBUILD): mkdir -p "$(RPMBUILD)" override_release: $(SPEC) $(if $(RELEASE), sed -i "s/Release:.*/Release: $(RELEASE)%{?dist}/g" "$(SPEC)") srpm: dist $(SPEC) $(RPMBUILD) override_release /usr/bin/rpmbuild --nodeps -bs $(RPMDEFINES_SRC) $(SPEC) rpm: srpm /usr/bin/rpmbuild --rebuild $(RPMDEFINES_BIN) $(NAME)-$(VERSION)-*.src.rpm mock: srpm /usr/bin/mock $(MOCK_FLAGS) -r $(MOCK_CHROOT) $(NAME)-$(VERSION)-*.src.rpm deb-src: dist rm -rf "$(PBUILDER_TMP)/$(NAME)-$(VERSION)" tar xzf "$(NAME)-$(VERSION).tar.gz" -C "$(PBUILDER_TMP)" cp -rv debian "$(PBUILDER_TMP)/$(NAME)-$(VERSION)" $(if $(RELEASE), sed -ri "s/($(NAME) )\((([0-9]+\.)+[0-9]+)-[0-9]+\)/\\1(\\2-$(RELEASE))/g" "$(PBUILDER_TMP)/$(NAME)-$(VERSION)/debian/changelog") cp -f "$(NAME)-$(VERSION).tar.gz" "$(PBUILDER_TMP)/$(NAME)_$(VERSION).orig.tar.gz" cd "$(PBUILDER_TMP)/$(NAME)-$(VERSION)"; \ debuild -us -uc -S mv $(PBUILDER_TMP)/$(NAME)_$(VERSION)*.gz . mv $(PBUILDER_TMP)/$(NAME)_$(VERSION)*.dsc . deb: deb-src pbuilder build $(PBUILDER_FLAGS) $(NAME)_$(VERSION)*.dsc gfal2-bindings-v1.12.2/packaging/build-debian.sh000077500000000000000000000014441453603530000213550ustar00rootroot00000000000000#!/bin/bash if [ -z "$1" ]; then echo "Missing distribution name (i.e. debian/testing)" exit 1 fi dist=$(echo $1 | cut -d '/' -f 1) name=$(echo $1 | cut -d '/' -f 2) BASETGZ="/var/cache/pbuilder/base-${dist}-${name}.tgz" MIRROR="ftp://mirror.switch.ch/mirror/${dist}/" OTHERMIRROR="deb [trusted=yes] http://grid-deployment.web.cern.ch/grid-deployment/dms/dmc/repos/apt/${distribution}/ dmc/" if [ "${dist}" = "ubuntu" ]; then OTHERMIRROR="$OTHERMIRROR|deb ftp://mirror.switch.ch/mirror/${dist} ${name} universe" fi TEMPDIR=`mktemp -d` sudo make deb \ PBUILDER_FLAGS="--buildresult . --distribution '${name}' --basetgz '${BASETGZ}' --mirror '${MIRROR}' --othermirror '${OTHERMIRROR}'" \ RELEASE=r`date +%y%m%d%H%M`\ PBUILDER_TMP="${TEMPDIR}" ls *.deb sudo rm -rf "${TEMPDIR}" gfal2-bindings-v1.12.2/packaging/debian/000077500000000000000000000000001453603530000177165ustar00rootroot00000000000000gfal2-bindings-v1.12.2/packaging/debian/changelog000066400000000000000000000034661453603530000216010ustar00rootroot00000000000000gfal2-python (1.12.2-1) unstable; urgency=low * New release -- DMC Devel Tue, 12 Dec 2023 12:00:00 +0100 gfal2-python (1.12.1-1) unstable; urgency=low * New release -- DMC Devel Tue, 05 Sep 2023 14:00:00 +0100 gfal2-python (1.12.0-1) unstable; urgency=low * New release -- DMC Devel Fri, 08 Mar 2022 15:00:00 +0100 gfal2-python (1.11.1-1) unstable; urgency=low * New release -- DMC Devel Mon, 07 Mar 2022 11:00:00 +0100 gfal2-python (1.11.0-1) unstable; urgency=low * New release -- DMC Devel Thu, 23 Sep 2021 11:00:00 +0100 gfal2-python (1.10.1-1) unstable; urgency=low * New release -- DMC Devel Wed, 24 Mar 2021 17:00:00 +0100 gfal2-python (1.10.0-1) unstable; urgency=low * New release -- DMC Devel Fri, 04 Dec 2020 18:00:00 +0100 gfal2-python (1.9.5-1) unstable; urgency=low * New release -- DMC Devel Fri, 12 Oct 2018 13:21:00 +0100 gfal2-python (1.9.4-1) unstable; urgency=low * New release -- DMC Devel Wed, 06 Jun 2018 13:21:00 +0100 gfal2-python (1.9.3-1) unstable; urgency=low * New release -- DMC Devel Wed, 21 Jun 2017 13:21:00 +0100 gfal2-python (1.9.2-1) unstable; urgency=low * New release -- DMC Devel Mon, 08 Aug 2016 15:29:00 +0100 gfal2-python (1.8.5-1) unstable; urgency=low * New release -- DMC Devel Thu, 21 Oct 2016 09:02:00 +0100 gfal2-python (1.8.4-1) unstable; urgency=low * New release -- DMC Devel Tue, 13 Oct 2015 14:04:00 +0200 gfal2-python (1.8.3-1) unstable; urgency=low * Deb packaging for gfal2-python -- DMC Devel Tue, 14 Jul 2015 14:00:00 +0200 gfal2-bindings-v1.12.2/packaging/debian/compat000066400000000000000000000000021453603530000211140ustar00rootroot000000000000008 gfal2-bindings-v1.12.2/packaging/debian/control000066400000000000000000000025611453603530000213250ustar00rootroot00000000000000Source: gfal2-python Priority: optional Maintainer: DMC Devel Build-Depends: debhelper (>= 8.0.0), cmake, python-epydoc, libgfal2-dev(>=2.9.0), libboost-dev, libboost-python-dev, libpython-dev, libpython3-dev, python3, pkg-config Standards-Version: 3.9.5 Section: net Homepage: http://dmc.web.cern.ch/ Package: gfal2-python Architecture: any Depends: libgfal2-2 (>= 2.9.0), libgfal-transfer2 (>= 2.9.0), ${shlibs:Depends}, ${misc:Depends} Recommends: gfal2-plugin-file (>= 2.9.0), gfal2-plugin-srm (>= 2.9.0), gfal2-plugin-gridftp (>= 2.9.0), gfal2-plugin-http (>= 2.9.0) Description: Python bindings for gfal 2 Python bindings for gfal2. GFAL2 offers an a single, simple and portable API for the file operations in grids and cloud environments. Package: gfal2-python3 Architecture: any Depends: libgfal2-2 (>= 2.9.0), libgfal-transfer2 (>= 2.9.0), ${shlibs:Depends}, ${misc:Depends} Recommends: gfal2-plugin-file (>= 2.9.0), gfal2-plugin-srm (>= 2.9.0), gfal2-plugin-gridftp (>= 2.9.0), gfal2-plugin-http (>= 2.9.0) Description: Python3 bindings for gfal 2 Python bindings for gfal2. GFAL2 offers an a single, simple and portable API for the file operations in grids and cloud environments. Package: gfal2-python-doc Section: doc Architecture: all Depends: ${misc:Depends} Description: Documentation for gfal2-python Documentation files for gfal2-python gfal2-bindings-v1.12.2/packaging/debian/copyright000066400000000000000000000022011453603530000216440ustar00rootroot00000000000000Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: gfal2 Source: https://gitlab.cern.ch/dmc/gfal2-bindings/repository/archive.tar.gz Files: * Copyright: Copyright (c) Members of the EGEE Collaboration. 2004-2013. See http://www.eu-egee.org/partners/ for details on the copyright holders. Copyright (c) CERN 2013-2015 License: Apache-2.0 Files: debian/* Copyright: 2015, DMC Devel / CERN License: Apache-2.0 License: Apache-2.0 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. . On Debian systems the full text of the Apache-2.0 license can be found in the /usr/share/common-licenses/Apache-2.0 file. gfal2-bindings-v1.12.2/packaging/debian/gfal2-python-doc.install000066400000000000000000000001601453603530000243600ustar00rootroot00000000000000usr/share/doc/gfal2-python/readme.html usr/share/doc/gfal2-python/examples/* usr/share/doc/gfal2-python/html/* gfal2-bindings-v1.12.2/packaging/debian/gfal2-python.docs000066400000000000000000000000361453603530000231010ustar00rootroot00000000000000LICENSE RELEASE-NOTES README gfal2-bindings-v1.12.2/packaging/debian/gfal2-python.install000066400000000000000000000002301453603530000236130ustar00rootroot00000000000000usr/lib/python2.7/dist-packages/gfal2.so usr/share/doc/gfal2-python/LICENSE usr/share/doc/gfal2-python/README usr/share/doc/gfal2-python/RELEASE-NOTES gfal2-bindings-v1.12.2/packaging/debian/gfal2-python3.install000066400000000000000000000000501453603530000236760ustar00rootroot00000000000000usr/lib/python3/dist-packages/gfal2.so gfal2-bindings-v1.12.2/packaging/debian/rules000077500000000000000000000010111453603530000207670ustar00rootroot00000000000000#!/usr/bin/make -f # -*- makefile -*- -include /usr/share/dpkg/buildflags.mk CFLAGS += $(CPPFLAGS) CXXFLAGS += $(CPPFLAGS) export CFLAGS CXXFLAGS LDFLAGS %: dh $@ override_dh_auto_configure: dh_auto_configure -- -DUNIT_TESTS=TRUE -DSKIP_DOC=FALSE override_dh_auto_build: dh_auto_build -- all doc override_dh_install: mv debian/tmp/usr/share/doc/gfal2-bindings \ debian/tmp/usr/share/doc/gfal2-python dh_install --fail-missing override_dh_auto_clean: dh_auto_clean override_dh_auto_test: dh_auto_test gfal2-bindings-v1.12.2/packaging/gfal2-repo-manager.py000077500000000000000000000164361453603530000224310ustar00rootroot00000000000000#!/usr/bin/env python3 # Author: Georgios Bitzes import os, subprocess, sys, inspect, argparse, re, shutil, errno DRY_RUN = False NO_CREATE_REPO = False RAWHIDE_VERSIONS = ["fc39", "fc40"] def sh(cmd): # poor man's subprocess.check_output, not supported on SL6 process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, stderr=subprocess.STDOUT) output, unused_err = process.communicate() retcode = process.poll() if retcode: raise Exception("Command {0} exited with code {1}. Output: {2}".format(cmd, retcode, output)) return output def ensure_valid_choice(parser, choice, text, available): if choice: if type(choice) == str: choice = [choice] for item in choice: if item not in available: parser.error("unrecognized {0}: '{1}'. Available choices: {2}".format(text, item, available)) def add_dependency(parser, when_present, dependency): if hasattr(parser, when_present): if not hasattr(parser, dependency): parser.error("argument --{0} is required when --{1} is present".format(dependency, when_present)) def declare_required(parser, args, choice): choice = choice.replace("-", "_") if not hasattr(args, choice): parser.error("argument --{0} is required".format(choice)) def bailout(msg): raise ValueError(msg) # poor man's enum class PackageType: Binary, NoArch, Source = range(1, 4) class Package(object): def __init__(self, path): self.path = path if not os.path.isfile(self.path): bailout("Not a file: {0}".format(self.path)) self.filename = os.path.basename(self.path) if self.filename.endswith(".src.rpm"): self.type = PackageType.Source tmp = self.filename[0:-8] elif self.filename.endswith(".noarch.rpm"): self.type = PackageType.NoArch tmp = self.filename[0:-11] elif self.filename.endswith(".rpm"): self.type = PackageType.Binary tmp = self.filename[0:-4] else: bailout("Unable to parse RPM type for {0}".format(self.path)) if self.type == PackageType.Source or self.type == PackageType.NoArch: self.arch = None elif tmp.endswith(".x86_64"): tmp = tmp[0:-7] self.arch = "x86_64" elif tmp.endswith(".i386"): tmp = tmp[0:-5] self.arch = "i386" else: bailout("Unable to determine architecture for {0}".format(self.path)) self.platform = tmp.split(".")[-1] tmp = tmp[0:-len(self.platform)-1] if self.platform == "cern": self.platform = tmp.split(".")[-1] tmp = tmp[0:-len(self.platform)-1] if self.platform in RAWHIDE_VERSIONS: self.platform = "fc-rawhide" self.packagename = tmp def construct_location(platform, arch, filename): return "{0}/{1}/{2}".format(platform, arch, filename) def is_tag(ref): return (re.compile("""^(v)(\d+)\.(\d+)\.(\d+)(-(rc)?(\d+))?$""").match(ref) != None or re.compile("""^(v)(\d+)\.(\d+)$""").match(ref) != None) def mkdir_p(path): try: os.makedirs(path) except OSError as exc: # Python >2.5 if exc.errno == errno.EEXIST and os.path.isdir(path): pass else: raise def createrepo(repo): print("-- Running createrepo on {0}".format(repo)) if NO_CREATE_REPO: return sh("rm -rf {0}".format(repo + "/.olddata")) sh("createrepo -q {0}".format(repo)) def copy_to_repo(source, repo): print("-- Copying {0} to {1}".format(source, repo)) if DRY_RUN: return mkdir_p(repo) shutil.copyfile(source, "{0}/{1}".format(repo, os.path.basename(source))) class Repository(object): def __init__(self, base): self.base = base if not os.path.isdir(self.base): bailout("Not a directory: {0}".format(self.base)) def store(self, ref, packages): platforms = set([x.platform for x in packages]) if len(platforms) != 1: raise ValueError("Cannot mix packages of different platforms in the same invocation: {0}".format(list(platforms))) archs = set([x.arch for x in packages]) archs.discard(None) if len(archs) != 1: raise ValueError("Cannot mix packages of different architectures in the same invocation: {0}".format(list(archs))) tag = is_tag(ref) if tag: base = "{0}/rc".format(self.base) else: base = "{0}/testing".format(self.base) if ref != "develop": base = "{0}/testing/{1}".format(self.base, ref) base += "/" + list(platforms)[0] reposToCreate = set() for package in packages: repo = "{0}/{1}".format(base, list(archs)[0]) copy_to_repo(package.path, repo) reposToCreate.add(repo) for repo in reposToCreate: createrepo(repo) def declare_incompatible_options(parser, option, group): if option not in sys.argv: return for item in group: if item in sys.argv: parser.error("argument {0} is incompatible with argument {1}".format(option, item)) def parseargs(): parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, description="An opinionated yum repository manager.\n") parser.add_argument('--base', type=str, required=True, help="The base directory for your project.") parser.add_argument('--action', type=str, required=True, help="The action to perform. Choices: ['add', 'cleanup']") parser.add_argument('--dry-run', action="store_true", help="If set, don't actually change any files, just show what would happen if ran.") parser.add_argument('--no-create-repo', action="store_true", help="If set, don't run createrepo at the end.") parser.set_defaults(dry_run=False, no_create_repo=False) group = parser.add_argument_group('add options') group.add_argument('--ref', type=str, help="The branch or tag that is being built. Tag names must match 'x.y' or 'x.y.z' (may be prepended by 'v')") group.add_argument('--packages', type=str, nargs='+', help="The list of packages to add") group = parser.add_argument_group('cleanup options') group.add_argument('--keep-last-days', type=int, help="How many days worth of RPMs to keep. (only affects branches)") args = parser.parse_args() ensure_valid_choice(parser, args.action, "action", ["add", "cleanup"]) declare_incompatible_options(parser, "--no-create-repo", ["--dry-run"]) if args.action == "add": declare_required(parser, args, "ref") declare_required(parser, args, "packages") if args.action == "cleanup": declare_required(parser, args, "keep-last-days") bailout("NYI") if args.ref == "tags" or args.ref == "tag": bailout("A branch named '{0}'? Really?".format(args.ref)) global DRY_RUN global NO_CREATE_REPO if args.dry_run: DRY_RUN = True NO_CREATE_REPO = True if args.no_create_repo: NO_CREATE_REPO = True return args def main(): args = parseargs() repository = Repository(args.base) packages = [Package(x) for x in args.packages] repository.store(args.ref, packages) if __name__ == '__main__': main() gfal2-bindings-v1.12.2/packaging/rpm/000077500000000000000000000000001453603530000172725ustar00rootroot00000000000000gfal2-bindings-v1.12.2/packaging/rpm/gfal2-python.spec000066400000000000000000000246221453603530000224660ustar00rootroot00000000000000%undefine __cmake_in_source_build %undefine __cmake3_in_source_build # Use static linking against boost %bcond_with static_boost_python #------------------------------------------------------------------------------- # Configure python2/3 according to platform and passed-in parameter #------------------------------------------------------------------------------- # Require --without=python3 in order to disable python3 build package %bcond_without python3 # Require --without=python2 in order to disable python2 build package on RHEL7 %if 0%{?rhel} == 7 %bcond_without python2 %endif # Require --without=docs in order to disable gfal2-python-doc package on RHEL7 %if 0%{?rhel} == 7 %bcond_without docs %endif # Python path discovery %if 0%{?with_python2} %if 0%{?rhel} == 7 %{!?python_sitearch: %define python_sitearch %(%{__python2} -c "from sysconfig import get_path; print get_path('platlib')")} %else %{!?python2_sitearch: %define python2_sitearch %(%{__python2} -c "from sysconfig import get_path; print get_path('platlib')")} %endif %endif %if 0%{?with_python3} %{!?python3_sitearch: %define python3_sitearch %(%{__python3} -c "from sysconfig import get_path; print(get_path('platlib'))")} %endif # Python modules filtering %global __provides_exclude_from ^((%{python2_sitearch})|(%{python3_sitearch})/.*\\.so)$ Name: gfal2-python Version: 1.12.2 Release: 1%{?dist} Summary: Python bindings for gfal 2 License: ASL 2.0 URL: http://dmc.web.cern.ch/ # git clone --branch master https://gitlab.cern.ch/dmc/gfal2-bindings.git gfal2-python-1.12.1 # pushd gfal2-python-1.12.1 # git checkout v1.12.1 # popd # tar czf gfal2-python-1.12.1.tar.gz --exclude-vcs gfal2-python-1.12.1 Source0: %{name}-%{version}.tar.gz BuildRequires: gcc-c++ BuildRequires: cmake3 BuildRequires: gfal2-devel >= 2.22.0 BuildRequires: boost-devel # Python 2 %if 0%{?with_python2} BuildRequires: python2-devel BuildRequires: python2-setuptools %endif # Epydoc %if 0%{?with_docs} BuildRequires: epydoc %endif # Python 3 %if 0%{?with_python3} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: boost-python%{python3_pkgversion}-devel %endif %global _description \ Python bindings for gfal2. \ GFAL2 offers an a single, simple and portable API \ for the file operations in grids and cloud environments. %description %_description %if 0%{?with_python2} %package -n python2-gfal2 Summary: %summary Requires: gfal2-core >= 2.22.0 Requires: python2 %{?python_provide:%python_provide python2-gfal2} # Remove before F30 Provides: gfal2-python = %{version}-%{release} Provides: gfal2-python%{?_isa} = %{version}-%{release} Obsoletes: gfal2-python < %{version}-%{release} %description -n python2-gfal2 %_description %endif %if 0%{?with_python3} %package -n python3-gfal2 Summary: gfal2 python bindings for Python 3 Requires: gfal2-core >= 2.22.0 Requires: python3 # Remove before F30 Provides: gfal2-python3 = %{version}-%{release} Provides: gfal2-python3%{?_isa} = %{version}-%{release} Obsoletes: gfal2-python3 < %{version}-%{release} %description -n python3-gfal2 Python 3 bindings for gfal2. GFAL2 offers an a single, simple and portable API for the file operations in grids and cloud environments. %endif %if 0%{?with_docs} %package doc Summary: Documentation for %{name} BuildArch: noarch %description doc Documentation files for %{name}. %endif %clean %cmake3_build --target clean %prep %setup -q %build # Make sure the version in the spec file and the version used # for building matches gfal2_python_cmake_ver=`sed -n 's/^set *(VERSION_\(MAJOR\|MINOR\|PATCH\) *\([0-9]\+\).*/\2/p' CMakeLists.txt | paste -sd '.'` gfal2_python_spec_ver=`expr "%{version}" : '\([0-9]*\\.[0-9]*\\.[0-9]*\)'` if [ "$gfal2_python_cmake_ver=" != "$gfal2_python_spec_ver=" ]; then echo "The version in the spec file does not match the CMakeLists.txt version!" echo "$gfal2_python_cmake_ver!= %{version}" exit 1 fi %cmake3 \ -DDOC_INSTALL_DIR=%{_pkgdocdir} \ %if 0%{?with_static_boost_python} -DBoost_USE_STATIC_LIBS=ON \ %endif %if 0%{?with_docs} -DBUILDDOCS=TRUE \ %endif -DUNIT_TESTS=TRUE %cmake3_build %if 0%{?with_docs} %cmake3_build --target doc %endif %install %cmake3_install %if 0%{?with_python2} %files -n python2-gfal2 %{python_sitearch}/gfal2.so %doc LICENSE %endif %if 0%{?with_python3} %files -n python3-gfal2 %{python3_sitearch}/gfal2.so %doc LICENSE %endif %if 0%{?with_docs} %files doc %{_pkgdocdir}/LICENSE %{_pkgdocdir}/RELEASE-NOTES %{_pkgdocdir}/README %{_pkgdocdir}/readme.html %dir %{_pkgdocdir}/html %dir %{_pkgdocdir}/examples %{_pkgdocdir}/html/* %{_pkgdocdir}/examples/* %endif %changelog * Tue Dec 12 2023 Mihai Patrascoiu - 1.12.2-1 - New upstream release * Tue Sep 05 2023 Mihai Patrascoiu - 1.12.1-1 - New upstream release * Fri Jul 08 2022 Joao Lopes - 1.12.0-1 - New upstream release * Mon Mar 07 2022 Mihai Patrascoiu - 1.11.1-1 - New upstream release * Thu Sep 23 2021 Joao Lopes - 1.11.0-1 - New upstream release - Introduces SE-Token retrieval * Wed Mar 24 2021 Mihai Patrascoiu - 1.10.1-1 - New upstream release * Fri Dec 04 2020 Mihai Patrascoiu - 1.10.0-1 - Introduces the QoS API - Enhancements to transfer parameters * Mon Sep 16 2019 Andrea Manzi - 1.9.5-5 - rename python3 package - remove python2 package from f32 on - remove el5 compilation * Mon Aug 19 2019 Miro Hrončok - 1.9.5-4 - Rebuilt for Python 3.8 * Thu Jul 25 2019 Fedora Release Engineering - 1.9.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Thu Jan 31 2019 Fedora Release Engineering - 1.9.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Thu Oct 25 2018 Andrea Manzi - 1.9.5-2 - Update for release 1.9.5 * Wed Feb 07 2018 Fedora Release Engineering - 1.9.3-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek - 1.9.3-5 - Add Provides for the old name without %%_isa * Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 1.9.3-4 - Python 2 binary package renamed to python2-gfal2 See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 * Wed Aug 02 2017 Fedora Release Engineering - 1.9.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - Rebuild with binutils fix for ppc64le (#1475636) * Wed Jul 26 2017 Alejandro Alvarez - 1.9.3-1 - Update for release 1.9.3 * Wed Jul 26 2017 Fedora Release Engineering - 1.9.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Thu Jul 20 2017 Kalev Lember - 1.9.2-3 - Rebuilt for Boost 1.64 * Fri Jul 07 2017 Igor Gnatenko - 1.9.2-2 - Rebuild due to bug in RPM (RHBZ #1468476) * Mon Apr 03 2017 Alejandro Alvarez - 1.9.2-1 - Update for release 1.9.2 * Mon Feb 20 2017 Alejandro Alvarez - 1.9.1-1 - Update for release 1.9.1 * Fri Feb 10 2017 Fedora Release Engineering - 1.8.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Fri Jan 27 2017 Jonathan Wakely - 1.8.5-2 - Rebuilt for Boost 1.63 * Wed Jan 18 2017 Alejandro Alvarez - 1.8.5-1 - Update to upstream release * Tue Jul 19 2016 Fedora Release Engineering - 1.8.4-5 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages * Tue Mar 08 2016 Alejandro Alvarez - 1.8.4-4 - Add patch to work with newer versions of Boost * Wed Feb 03 2016 Fedora Release Engineering - 1.8.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Fri Jan 15 2016 Jonathan Wakely - 1.8.4-2 - Rebuilt for Boost 1.60 * Mon Nov 09 2015 Alejandro Alvarez - 1.8.4-1 - Update for release 1.8.4 * Thu Aug 27 2015 Jonathan Wakely - 1.8.3-4 - Rebuilt for Boost 1.59 * Wed Jul 29 2015 Fedora Release Engineering - 1.8.3-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/F23Boost159 * Wed Jul 22 2015 David Tardon - 1.8.3-2 - rebuild for Boost 1.58 * Fri Jul 03 2015 Alejandro Alvarez - 1.8.3-1 - Update for release 1.8.3 * Wed Jun 17 2015 Fedora Release Engineering - 1.8.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Fri Apr 17 2015 Alejandro Alvarez - 1.8.1-1 - Update for release 1.8.1 * Thu Apr 02 2015 Alejandro Alvarez - 1.7.1-1 - Update for release 1.7.1 * Fri Feb 06 2015 Alejandro Alvarez - 1.7.0-1 - Update for release 1.7.0 * Tue Jan 27 2015 Petr Machata - 1.6.0-2 - Rebuild for boost 1.57.0 * Fri Nov 07 2014 Alejandro Alvarez - 1.6.0-1 - Update for release 1.6.0 * Sat Aug 16 2014 Fedora Release Engineering - 1.5.0-1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Tue Jul 01 2014 Alejandro Alvarez - 1.5.0-1 - Update for release 1.5.0 * Sat Jun 07 2014 Fedora Release Engineering - 1.4.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Fri May 23 2014 Petr Machata - 1.4.1-2 - Rebuild for boost 1.55.0 * Fri Feb 28 2014 Adrien Devresse - 1.4.1-1 - Release 1.4.1 of gfal2 python bindings, see RELEASE-NOTES for details * Sat Nov 16 2013 Ville Skyttä - 1.3.0-2 - Install docs to %%{_pkgdocdir} where available (#993774). - Own doc dirs. * Fri Nov 01 2013 Adrien Devresse - 1.3.0-1 - Release 1.3.0 of gfal2 python bindings, see RELEASE-NOTES for details * Wed May 08 2013 Adrien Devresse - 1.2.1-1 - First release compatible for EPEL gfal2-bindings-v1.12.2/readme.html000066400000000000000000000033641453603530000167010ustar00rootroot00000000000000 gfal2-python

gfal2-python

Description

Python bindings for gfal 2.

Installation

From EPEL

yum install gfal2-python gfal2-all

Sources

Anonymous
svn co http://svn.cern.ch/guest/lcgutil/gfal2-bindings/
Registered
svn co https://svn.cern.ch/reps/lcgutil/gfal/gfal2-bindings/

API documentation

You can query the documentation generated automatically from sources using Epydoc.

You can also have a look at our examples

License

This software is licensed under the Apache 2 License. See LICENSE for details.

Release Notes

See RELEASE-NOTES for a detailed changelog.

Contact

You can notify bugs or ask for feature requests via

Tracker
https://its.cern.ch/jira/browse/DMC/component/12201
Mailing list
dmc-support@cern.ch
gfal2-bindings-v1.12.2/setup.py000077500000000000000000000074521453603530000162750ustar00rootroot00000000000000#!/usr/bin/env python # # Copyright @ CERN, 2015 # # 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. # import os import re import shutil import sys import distutils.command.build_ext as _build_ext import distutils.spawn import distutils.dir_util from glob import glob from subprocess import check_call from setuptools import Extension, setup # Change this for a post release i.e when there are changes in the setup.py or MANIFEST.in but no version change POST_RELEASE = None def get_version(): ver_components = dict() if POST_RELEASE: ver_components['VERSION_RELEASE'] = POST_RELEASE with open('CMakeLists.txt') as cmake: for line in cmake: line = line.strip() if line.startswith('set') and line.endswith(')'): before, var, after = re.split(r'\(|\)', line) varname, varval = var.split() if varname.startswith('VERSION_'): ver_components[varname] = varval if len(ver_components) == 0: raise ValueError('Could not find the version') version = "%(VERSION_MAJOR)s.%(VERSION_MINOR)s.%(VERSION_PATCH)s" if POST_RELEASE: version += ".post%(VERSION_RELEASE)s" return version % ver_components def validate(): if distutils.spawn.find_executable('cmake') is None: print('Missing CMake executable') sys.exit(-1) def _run_make(build_dir, lib_path): validate() # prepare paths full_lib_path = os.path.dirname(os.path.abspath(lib_path)) source_dir = os.path.abspath(os.path.dirname(__file__)) # ensure involved directories exist if not os.path.exists(build_dir): os.makedirs(build_dir) if not os.path.exists(full_lib_path): os.makedirs(full_lib_path) # build the cmake command major = sys.version_info[0] cmake_cmd = ['cmake', '-DSKIP_TESTS=TRUE'] if major == 3: cmake_cmd += ['-DPYTHON_EXECUTABLE_3=%s' % sys.executable] cmake_cmd += [source_dir] # run the cmake command and make check_call(cmake_cmd, cwd=build_dir) check_call(['make'], cwd=build_dir) # install shutil.copy(os.path.join(build_dir, 'src/python%d/gfal2.so' % major), full_lib_path) class build_ext(_build_ext.build_ext): def run(self): _run_make(self.build_temp, self.get_ext_fullpath('gfal2')) setup( name='gfal2-python', version=get_version(), description='Python bindings for gfal2', long_description_content_type='text/markdown', requires=[], install_requires=[], url='https://dmc.web.cern.ch/', download_url='https://gitlab.cern.ch/dmc/gfal2-bindings', author='DMC Devel', author_email='dmc-devel@cern.ch', maintainer_email='dmc-devel@cern.ch', license='Apache 2', long_description='Python bindings for gfal2', keywords='gfal2, grid, dmc, data management clients', platforms=['GNU/Linux'], classifiers=[ "Intended Audience :: Developers", "Topic :: Software Development :: Libraries :: Python Modules", "License :: OSI Approved :: Apache Software License", "Development Status :: 5 - Production/Stable", "Operating System :: Unix", "Programming Language :: C" ], cmdclass={'build_ext': build_ext}, zip_safe=False, packages=[], ext_modules=[ Extension('gfal2', sources=glob("src/*.cpp")) ] ) gfal2-bindings-v1.12.2/src/000077500000000000000000000000001453603530000153375ustar00rootroot00000000000000gfal2-bindings-v1.12.2/src/CMakeLists.txt000066400000000000000000000047331453603530000201060ustar00rootroot00000000000000include_directories(${Boost_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS} ${GTHREAD2_INCLUDE_DIRS} ${GFAL2_INCLUDE_DIRS} ) file(GLOB src_python "*.cpp") set(Boost_USE_STATIC_LIBS OFF) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) link_directories ( ${GLIB2_LIBRARY_DIRS} ${GFAL2_LIBRARY_DIRS} ) # Python 2 if (Boost_LIBRARIES) if(RHEL STREQUAL "7") set(PYTHON2_VER "") else() set(PYTHON2_VER "_${PYTHON_CURRENT_VERSION}") endif() add_library(gfal-py MODULE ${src_python}) target_link_libraries(gfal-py ${Boost_LIBRARIES} ${GLIB2_LIBRARIES} ${GTHREAD2_LIBRARIES} ${GFAL2_LIBRARIES} ) set_target_properties(gfal-py PROPERTIES CLEAN_DIRECT_OUTPUT 1 PREFIX "" OUTPUT_NAME gfal2 LIBRARY_OUTPUT_DIRECTORY python2 ) set_property(TARGET gfal-py APPEND PROPERTY INCLUDE_DIRECTORIES ${PYTHON_INCLUDE_PATH${PYTHON2_VER}} ) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set_property(TARGET gfal-py APPEND PROPERTY LINK_FLAGS "-undefined dynamic_lookup") endif() install(TARGETS gfal-py RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES${PYTHON2_VER}} ) endif () # Python3 if (Boost_PYTHON_3_LIBRARY) set(PYTHON3_VER "_${PYTHON3_CURRENT_VERSION}") message(STATUS "Python${PYTHON3_CURRENT_VERSION} include: ${PYTHON_INCLUDE_PATH${PYTHON3_VER}}") message(STATUS "Python${PYTHON3_CURRENT_VERSION} libraries: ${PYTHON_LIBRARIES${PYTHON3_VER}}") message(STATUS "Python${PYTHON3_CURRENT_VERSION} site-packages: ${PYTHON_SITE_PACKAGES${PYTHON3_VER}}") add_library(gfal-py3 MODULE ${src_python}) target_link_libraries(gfal-py3 ${Boost_PYTHON_3_LIBRARY} ${GLIB2_LIBRARIES} ${GTHREAD_LIBRARIES} ${GFAL2_LIBRARIES} ) set_target_properties(gfal-py3 PROPERTIES CLEAN_DIRECT_OUTPUT 1 PREFIX "" OUTPUT_NAME gfal2 LIBRARY_OUTPUT_DIRECTORY python3 ) set_property(TARGET gfal-py3 APPEND PROPERTY INCLUDE_DIRECTORIES ${PYTHON_INCLUDE_PATH${PYTHON3_VER}} ) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set_property(TARGET gfal-py3 APPEND PROPERTY LINK_FLAGS "-undefined dynamic_lookup") endif() install(TARGETS gfal-py3 RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} LIBRARY DESTINATION ${PYTHON_SITE_PACKAGES${PYTHON3_VER}} ) endif () gfal2-bindings-v1.12.2/src/Cred.h000066400000000000000000000025031453603530000163650ustar00rootroot00000000000000/* * Copyright (c) CERN 2013-2021 * * Copyright (c) Members of the EMI Collaboration. 2010-2013 * See http://www.eu-emi.eu/partners for details on the copyright * holders. * * 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. */ #ifndef GCRED_H #define GCRED_H #include #include "GErrorWrapper.h" namespace PyGfal2 { // Wrapper for gfal2_cred_t class Cred { private: gfal2_cred_t* cred; public: Cred(const std::string& type, const std::string& value) { cred = gfal2_cred_new(type.c_str(), value.c_str()); } virtual ~Cred() { gfal2_cred_free(cred); } std::string get_type() { return std::string(cred->type); } std::string get_value() { return std::string(cred->value); } friend class Gfal2Context; }; } #endif /* GCRED_H */ gfal2-bindings-v1.12.2/src/Directory.cpp000066400000000000000000000034031453603530000200070ustar00rootroot00000000000000/* * Copyright @ CERN, 2014-2015 * * 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. */ #include "Gfal2Context.h" #include "Directory.h" #include "pyGIL.h" #include using namespace PyGfal2; Directory::Directory(const Gfal2Context & context, const std::string & path) : cont(context.getContext()), path(path) { ScopedGILRelease unlock; GError* tmp_err = NULL; d = gfal2_opendir(cont->get(), path.c_str(), &tmp_err); if (d == NULL) GErrorWrapper::throwOnError(&tmp_err); } Directory::~Directory() { ScopedGILRelease unlock; (void) gfal2_closedir(cont->get(), d, NULL); } boost::python::tuple Directory::readpp() { GError* tmp_err = NULL; Dirent dirent; Stat stat; { ScopedGILRelease unlock; dirent = gfal2_readdirpp(cont->get(), d, &stat._st, &tmp_err); } if (dirent.isValid() == false) { GErrorWrapper::throwOnError(&tmp_err); return boost::python::make_tuple(boost::python::object(), boost::python::object()); } return boost::python::make_tuple(dirent, stat); } Dirent Directory::read() { ScopedGILRelease unlock; GError* tmp_err = NULL; Dirent dirent(gfal2_readdir(cont->get(), d, &tmp_err)); GErrorWrapper::throwOnError(&tmp_err); return dirent; } gfal2-bindings-v1.12.2/src/Directory.h000066400000000000000000000021541453603530000174560ustar00rootroot00000000000000/* * Copyright @ CERN, 2014-2015 * * 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. */ #ifndef DIRECTORY_H_ #define DIRECTORY_H_ #include "Dirent.h" #include namespace PyGfal2 { class Gfal2Context; class GfalContextWrapper; class Directory : protected boost::noncopyable { public: Directory(const Gfal2Context & context, const std::string & path); virtual ~Directory(); boost::python::tuple readpp(); Dirent read(); private: boost::shared_ptr cont; std::string path; DIR* d; }; } #endif /* DIRECTORY_H_ */ gfal2-bindings-v1.12.2/src/Dirent.h000066400000000000000000000043711453603530000167420ustar00rootroot00000000000000/* * Copyright (c) CERN 2013-2015 * * Copyright (c) Members of the EMI Collaboration. 2010-2013 * See http://www.eu-emi.eu/partners for details on the copyright * holders. * * 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. */ #ifndef GDIRENT_H #define GDIRENT_H #include #include #include namespace PyGfal2 { class Dirent{ public: struct dirent _dir; bool _end_of_directory; bool isValid() { return !_end_of_directory; } Dirent(): _dir(), _end_of_directory(true) { memset(&_dir, 0, sizeof(struct dirent)); } Dirent(struct dirent* entry) { _end_of_directory = (entry == NULL); if (!_end_of_directory) { memcpy(&_dir, entry, sizeof(struct dirent)); } else { memset(&_dir, 0, sizeof(struct dirent)); } } Dirent(const Dirent & orig): _end_of_directory(orig._end_of_directory) { memcpy(&_dir, &orig._dir, sizeof(struct dirent)); } ino_t get_d_ino() { return _dir.d_ino; } off_t get_d_off() { #ifdef __linux__ return _dir.d_off; #else return 0; #endif } unsigned short get_d_reclen() { return _dir.d_reclen; } unsigned char get_d_type() { return _dir.d_type; } std::string get_d_name() { return std::string(_dir.d_name); } std::string __str__() { std::ostringstream res; res << "inode: " << _dir.d_ino << std::endl; #ifdef __linux__ res << "offset: " << _dir.d_off << std::endl; #endif res << "length: " << _dir.d_reclen << std::endl; res << "type: " << _dir.d_type << std::endl; res << "name: " << _dir.d_name << std::endl; return res.str(); } }; } #endif /* GDIRENT_H */ gfal2-bindings-v1.12.2/src/File.cpp000066400000000000000000000100021453603530000167130ustar00rootroot00000000000000/* * Copyright @ CERN, 2014-2015 * * 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. */ #include "File.h" #include "Gfal2Context.h" #include "pyGIL.h" #include #include #include using namespace PyGfal2; static int convert_open_flag_py_to_cpp(const std::string & str) { if (str.compare("rw") == 0 || str.compare("rw") == 0) return O_RDWR | O_CREAT; if (str.compare("r") == 0) return O_RDONLY; if (str.compare("w") == 0) return O_WRONLY | O_CREAT | O_TRUNC; throw std::runtime_error("Invalid open flag, must be r, w, or rw"); } File::File(const Gfal2Context & context, const std::string & path, const std::string & flag) : cont(context.getContext()), path(path), flag(flag) { ScopedGILRelease unlock; GError* tmp_err = NULL; int flags_i = convert_open_flag_py_to_cpp(flag); fd = gfal2_open(cont->get(), path.c_str(), flags_i, &tmp_err); if (fd <= 0) GErrorWrapper::throwOnError(&tmp_err); } File::~File() { ScopedGILRelease unlock; (void) gfal2_close(cont->get(), fd, NULL); } std::string File::read(size_t count) { ScopedGILRelease unlock; GError* tmp_err = NULL; std::vector buf(count + 1); // vector on the heap for massive buffer size ssize_t ret = gfal2_read(cont->get(), fd, &(buf.front()), count, &tmp_err); if (ret < 0) { GErrorWrapper::throwOnError(&tmp_err); } else if (ret > count) { std::stringstream errmsg; errmsg << "Read returned " << ret << " bytes, higher than expected " << count; throw GErrorWrapper(errmsg.str(), ENOMEM); } buf[ret] = '\0'; return std::string(&(buf.front()), ret); } std::string File::pread(off_t offset, size_t count) { ScopedGILRelease unlock; GError* tmp_err = NULL; std::vector buf(count + 1); // vector on the heap for massive buffer size ssize_t ret = gfal2_pread(cont->get(), fd, &(buf.front()), count, offset, &tmp_err); if (ret < 0) { GErrorWrapper::throwOnError(&tmp_err); } else if (ret > count) { std::stringstream errmsg; errmsg << "Positional read returned " << ret << " bytes, higher than expected " << count; throw GErrorWrapper(errmsg.str(), ENOMEM); } buf[ret] = '\0'; return std::string(&(buf.front()), ret); } PyObject* File::read_bytes(size_t count) { std::string result = read(count); return PyBytes_FromStringAndSize(result.c_str(), result.size()); } PyObject* File::pread_bytes(off_t offset, size_t count) { std::string result = pread(offset, count); return PyBytes_FromStringAndSize(result.c_str(), result.size()); } ssize_t File::write(const std::string & str) { ScopedGILRelease unlock; GError* tmp_err = NULL; const size_t s_str = str.size(); ssize_t ret = gfal2_write(cont->get(), fd, str.c_str(), s_str, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return ret; } ssize_t File::pwrite(const std::string & str, off_t offset) { ScopedGILRelease unlock; GError* tmp_err = NULL; const size_t s_str = str.size(); ssize_t ret = gfal2_pwrite(cont->get(), fd, str.c_str(), s_str, offset, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return ret; } off_t File::lseek(off_t offset, int flag) { ScopedGILRelease unlock; GError* tmp_err = NULL; off_t ret = gfal2_lseek(cont->get(), fd, offset, flag, &tmp_err); if (ret == ((off_t) 0) - 1) GErrorWrapper::throwOnError(&tmp_err); return ret; } gfal2-bindings-v1.12.2/src/File.h000066400000000000000000000032421453603530000163700ustar00rootroot00000000000000/* * Copyright @ CERN, 2014-2015 * * 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. */ #ifndef GFILE_H_ #define GFILE_H_ #include #include #include namespace PyGfal2 { class Gfal2Context; class GfalContextWrapper; class File: protected boost::noncopyable { public: File(const Gfal2Context & context, const std::string & path, const std::string & flag); virtual ~File(); /// wrapper to the gfal_read call std::string read(size_t count); /// position independent read call std::string pread(off_t offset, size_t count); /// bytes version of gfal_read call PyObject* read_bytes(size_t count); /// bytes version of position independent read call PyObject* pread_bytes(off_t offset, size_t count); /// wrapper to the gfal_write call ssize_t write(const std::string & str); /// position independent write call ssize_t pwrite(const std::string & str, off_t offset); /// wrapper to the gfal_lseek call off_t lseek(off_t offset, int flag = 0); private: boost::shared_ptr cont; std::string path; std::string flag; int fd; }; } #endif /* GFILE_H_ */ gfal2-bindings-v1.12.2/src/GErrorWrapper.cpp000066400000000000000000000121621453603530000206060ustar00rootroot00000000000000/* * Copyright (c) CERN 2013-2015 * * 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. */ #include "GErrorWrapper.h" // Python3 compat #if PY_MAJOR_VERSION >= 3 #define PyInt_FromLong PyLong_FromLong #define PyString_FromString PyUnicode_FromString #endif using namespace PyGfal2; PyObject *PyGfal2::GErrorPyType = NULL; GErrorWrapper::GErrorWrapper(const std::string &msg, int error): _message(msg), _code(error) { } GErrorWrapper::GErrorWrapper(const GError* gerr): _message(gerr->message), _code(gerr->code) { } GErrorWrapper::~GErrorWrapper() throw() { } const char *GErrorWrapper::what() const throw() { return this->_message.c_str(); } int GErrorWrapper::code() const { return this->_code; } void GErrorWrapper::throwOnError(GError **err) { if (err && *err) { std::string err_msg((*err)->message); int code = (*err)->code; g_clear_error(err); throw GErrorWrapper(err_msg, code); } } /*** Python Exception ***/ static PyObject* GErrorParent = PyExc_Exception; // GError constructor static PyObject* GError_init(PyObject* self, PyObject* args) { PyObject* parent_init = NULL; PyObject* res = NULL; PyObject* msgObj = NULL; PyObject* codeObj = NULL; char* message = NULL; int code; // Call parent constructor if (!(parent_init = PyObject_GetAttrString(GErrorParent, "__init__"))) goto exception; if (!(res = PyObject_CallObject(parent_init, args))) goto exception; // Setup self if (!PyArg_ParseTuple(args, "Osi:__init__", &self, &message, &code)) goto exception; msgObj = PyString_FromString(message); codeObj = PyInt_FromLong(code); PyObject_SetAttrString(self, "message", msgObj); PyObject_SetAttrString(self, "code", codeObj); Py_DECREF(msgObj); Py_DECREF(codeObj); return res; exception: Py_XDECREF(parent_init); Py_XDECREF(res); return NULL; } static PyObject* GError_str(PyObject* self, PyObject* args) { if (!PyArg_ParseTuple(args, "O:__str__", &self)) return NULL; return PyObject_GetAttrString(self, "message"); } static PyMethodDef GError_init_def = { "__init__", GError_init, METH_VARARGS }; static PyMethodDef GError_str_def = { "__str__", GError_str, METH_VARARGS }; static int add_method_to_dict(PyObject* klass, PyObject* dict, PyMethodDef* methodDef) { PyObject* func = NULL; PyObject* method = NULL; if (!(func = PyCFunction_NewEx(methodDef, NULL, NULL))) goto exception; #if PY_MAJOR_VERSION >= 3 if (!(method = PyInstanceMethod_New(func))) goto exception; #else if (!(method = PyMethod_New(func, NULL, klass))) goto exception; #endif if (PyDict_SetItemString(dict, methodDef->ml_name, method) < 0) goto exception; Py_DECREF(method); Py_DECREF(func); return 0; exception: Py_XDECREF(method); Py_XDECREF(func); return -1; } PyObject* PyGfal2::createGErrorExceptionType(boost::python::scope& scope) { PyObject* typeObj = NULL; PyObject* attrs = NULL; // Get name std::string scopeName = boost::python::extract(scope.attr("__name__")); std::string qualifiedName = scopeName + ".GError"; // Initialize class attributes if (!(attrs = PyDict_New())) goto exception; PyDict_SetItemString(attrs, "code", PyInt_FromLong(0)); PyDict_SetItemString(attrs, "message", PyString_FromString("")); // Add methods if (add_method_to_dict(GErrorParent, attrs, &GError_init_def) < 0) goto exception; if (add_method_to_dict(GErrorParent, attrs, &GError_str_def) < 0) goto exception; // Create exception if (!(typeObj = PyErr_NewException( const_cast(qualifiedName.c_str()), GErrorParent, attrs))) { goto exception; } Py_DECREF(attrs); scope.attr("GError") = boost::python::borrowed(typeObj); return typeObj; exception: PyErr_Print(); abort(); } void PyGfal2::GError2PyError(boost::python::list& pyerrors, size_t nerrors, GError** g_errors) { if (g_errors != NULL) { for (size_t i = 0; i < nerrors; ++i) { if (g_errors[i] != NULL) { PyObject* args = Py_BuildValue("si", g_errors[i]->message, g_errors[i]->code); PyObject *err = PyObject_CallObject(GErrorPyType, args); Py_DECREF(args); g_error_free(g_errors[i]); pyerrors.append(boost::python::handle<>(err)); } else { pyerrors.append(boost::python::object()); } } } } gfal2-bindings-v1.12.2/src/GErrorWrapper.h000066400000000000000000000032171453603530000202540ustar00rootroot00000000000000/* * Copyright (c) CERN 2013-2015 - * 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. */ #ifndef GERRORWRAPPER_EXCEPTION_H #define GERRORWRAPPER_EXCEPTION_H #include #include #include #include #include namespace PyGfal2 { extern PyObject *GErrorPyType; /** * Exception to be thrown by the wrapper code */ class GErrorWrapper : public std::exception { public: GErrorWrapper(const std::string &msg, int error); GErrorWrapper(const GError* gerr); virtual ~GErrorWrapper() throw(); const char * what() const throw(); int code() const; /** * Convenience function. * Throws a GErrorWrapper if err is set * Otherwise, it just returns */ static void throwOnError(GError**err); private: std::string _message; int _code; }; /** * Creates the _type_ GErrorException (inherits from Python's Exception) */ PyObject* createGErrorExceptionType(boost::python::scope&); /** * Translate a list of GError to a list of GErrorException */ void GError2PyError(boost::python::list& pyerrors, size_t nerrors, GError** g_errors); } #endif /* GERRORWRAPPER_EXCEPTION_H */ gfal2-bindings-v1.12.2/src/Gfal2Context.cpp000066400000000000000000001005071453603530000203460ustar00rootroot00000000000000/* * Copyright (c) CERN 2013-2015 * * Copyright (c) Members of the EMI Collaboration. 2010-2013 * See http://www.eu-emi.eu/partners for details on the copyright * holders. * * 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. */ #include #include #include #include #include #include "GErrorWrapper.h" #include "Gfal2Context.h" #include "pyGIL.h" using namespace PyGfal2; static const ssize_t MAX_BUFFER_SIZE = 4096; // extract typed array from python array, throw type error in case of bad conversion template static std::vector convert_python_list_to_typed_list( const boost::python::list & l) { std::vector res; for (int i = 0; i < boost::python::len(l); ++i) { res.push_back(boost::python::extract(l[i])); } return res; } int Gfal2Context::filecopy(const std::string &src, const std::string &dst) { ScopedGILRelease unlock; GError * tmp_err = NULL; int ret = gfalt_copy_file(cont->get(), NULL, src.c_str(), dst.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return ret; } int Gfal2Context::filecopy(const GfaltParams & p, const std::string & src, const std::string & dst) { ScopedGILRelease unlock; GError * tmp_err = NULL; int ret = gfalt_copy_file(cont->get(), p.params, src.c_str(), dst.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return ret; } boost::python::object Gfal2Context::filecopy(const boost::python::list& srcs, const boost::python::list& dsts) { GfaltParams params; return filecopy(params, srcs, dsts); } boost::python::object Gfal2Context::filecopy(const GfaltParams & p, const boost::python::list& srcs, const boost::python::list& dsts) { boost::python::list no_chksums; return filecopy(p, srcs, dsts, no_chksums); } boost::python::object Gfal2Context::filecopy(const GfaltParams & p, const boost::python::list& srcs, const boost::python::list& dsts, const boost::python::list& chksums) { GError * op_error = NULL; GError** file_errors = NULL; long nbfiles = boost::python::len(srcs); long nbchksum = boost::python::len(chksums); if (nbfiles != boost::python::len(dsts)) throw GErrorWrapper("Number of sources and destinations do not match", EINVAL); if (nbfiles != nbchksum && nbchksum != 0) throw GErrorWrapper("Number of pairs and checksums do not match", EINVAL); std::vector sources; std::vector destinations; std::vector checksums; const char* sources_ptr[nbfiles]; const char* destinations_ptr[nbfiles]; const char* checksums_ptr[nbfiles]; int ret; for (long i = 0; i < nbfiles; ++i) { sources.push_back(boost::python::extract(srcs[i])); destinations.push_back(boost::python::extract(dsts[i])); sources_ptr[i] = sources.back().c_str(); destinations_ptr[i] = destinations.back().c_str(); if (nbchksum) { checksums.push_back(boost::python::extract(chksums[i])); checksums_ptr[i] = checksums.back().c_str(); } } { ScopedGILRelease unlock; if (nbchksum == 0) { ret = gfalt_copy_bulk(cont->get(), p.params, nbfiles, sources_ptr, destinations_ptr, NULL, &op_error, &file_errors); } else { ret = gfalt_copy_bulk(cont->get(), p.params, nbfiles, sources_ptr, destinations_ptr, checksums_ptr, &op_error, &file_errors); } if (ret < 0 && op_error != NULL) GErrorWrapper::throwOnError(&op_error); } boost::python::list pyerrors; GError2PyError(pyerrors, nbfiles, file_errors); g_free(file_errors); return pyerrors; } Stat Gfal2Context::lstat(const std::string & path) { ScopedGILRelease unlock; GError* tmp_err = NULL; Stat st; const int ret = gfal2_lstat(cont->get(), path.c_str(), &st._st, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return st; } Stat Gfal2Context::stat_c(const std::string & path) { ScopedGILRelease unlock; GError* tmp_err = NULL; Stat st; const int ret = gfal2_stat(cont->get(), path.c_str(), &st._st, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return st; } int Gfal2Context::access(const std::string & path, int flag) { ScopedGILRelease unlock; GError* tmp_err = NULL; const int ret = gfal2_access(cont->get(), path.c_str(), flag, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return ret; } int Gfal2Context::chmod(const std::string & path, mode_t mode) { ScopedGILRelease unlock; GError* tmp_err = NULL; const int ret = gfal2_chmod(cont->get(), path.c_str(), mode, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return 0; } int Gfal2Context::unlink(const std::string & path) { ScopedGILRelease unlock; GError* tmp_err = NULL; const int ret = gfal2_unlink(cont->get(), path.c_str(), &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return 0; } boost::python::list Gfal2Context::unlink_list(const boost::python::list& pyfiles) { size_t nbfiles = boost::python::len(pyfiles); if (nbfiles == 0) throw GErrorWrapper("Empty list of files", EINVAL); std::vector files(nbfiles); std::vector errors(nbfiles, NULL); const char* files_ptr[nbfiles]; for (size_t i = 0; i < nbfiles; ++i) { files.push_back(boost::python::extract(pyfiles[i])); files_ptr[i] = files.back().c_str(); } { ScopedGILRelease unlock; gfal2_unlink_list(cont->get(), nbfiles, files_ptr, errors.data()); } boost::python::list pyerrors; GError2PyError(pyerrors, nbfiles, errors.data()); return pyerrors; } int Gfal2Context::mkdir(const std::string & path, mode_t mode) { ScopedGILRelease unlock; GError* tmp_err = NULL; const int ret = gfal2_mkdir(cont->get(), path.c_str(), mode, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return 0; } int Gfal2Context::mkdir_rec(const std::string & path, mode_t mode) { ScopedGILRelease unlock; GError* tmp_err = NULL; const int ret = gfal2_mkdir_rec(cont->get(), path.c_str(), mode, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return 0; } int Gfal2Context::rmdir(const std::string & path) { ScopedGILRelease unlock; GError* tmp_err = NULL; const int ret = gfal2_rmdir(cont->get(), path.c_str(), &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return 0; } boost::python::list Gfal2Context::listdir(const std::string & path) { GError* tmp_err = NULL; DIR* d = NULL; { ScopedGILRelease unlock; d = gfal2_opendir(cont->get(), path.c_str(), &tmp_err); } if (d == NULL) { GErrorWrapper::throwOnError(&tmp_err); } // Do the listing outside Python scope // Creating Python objects even via boost require acquiring the GIL std::list temporary; { ScopedGILRelease unlock; struct dirent *st; while ((st = gfal2_readdir(cont->get(), d, &tmp_err)) != NULL) { temporary.push_back(std::string(st->d_name)); } } GError* close_error = NULL; { ScopedGILRelease unlock; gfal2_closedir(cont->get(), d, &close_error); } GErrorWrapper::throwOnError(&tmp_err); GErrorWrapper::throwOnError(&close_error); // Convert to a Python list boost::python::list result; for (std::list::const_iterator i = temporary.begin(); i != temporary.end(); ++i) { result.append(*i); } return result; } int Gfal2Context::rename(const std::string & src, const std::string & dest) { ScopedGILRelease unlock; GError* tmp_err = NULL; int ret = gfal2_rename(cont->get(), src.c_str(), dest.c_str(), &tmp_err); if (ret != 0) GErrorWrapper::throwOnError(&tmp_err); return 0; } std::string Gfal2Context::readlink(const std::string & path) { ScopedGILRelease unlock; GError* tmp_err = NULL; char buffer[MAX_BUFFER_SIZE]; ssize_t ret = gfal2_readlink(cont->get(), path.c_str(), buffer, MAX_BUFFER_SIZE, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return buffer; } std::string Gfal2Context::checksum(const std::string & uri, const std::string & chk_type, off_t start_offset, size_t data_length) { ScopedGILRelease unlock; char buffer[MAX_BUFFER_SIZE]; GError* tmp_err = NULL; gfal2_checksum(cont->get(), uri.c_str(), chk_type.c_str(), start_offset, data_length, buffer, MAX_BUFFER_SIZE, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return buffer; } std::string Gfal2Context::checksum(const std::string & uri, const std::string & chk_type) { return checksum(uri, chk_type, 0, 0); } int Gfal2Context::symlink(const std::string & oldpath, const std::string & newpath) { ScopedGILRelease unlock; GError* tmp_err = NULL; int ret = gfal2_symlink(cont->get(), oldpath.c_str(), newpath.c_str(), &tmp_err); if (ret != 0) GErrorWrapper::throwOnError(&tmp_err); return 0; } std::string Gfal2Context::getxattr(const std::string & file, const std::string & key) { ScopedGILRelease unlock; GError* tmp_err = NULL; char buffer[MAX_BUFFER_SIZE]; const ssize_t ret = gfal2_getxattr(cont->get(), file.c_str(), key.c_str(), buffer, MAX_BUFFER_SIZE, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return std::string(buffer); } int Gfal2Context::setxattr(const std::string & file, const std::string & key, const std::string & value, int flag) { ScopedGILRelease unlock; GError* tmp_err = NULL; const ssize_t ret = gfal2_setxattr(cont->get(), file.c_str(), key.c_str(), value.c_str(), value.size() + 1, flag, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return 0; } boost::python::list Gfal2Context::listxattr(const std::string & file) { GError* tmp_err = NULL; char buffer[MAX_BUFFER_SIZE]; ssize_t ret; { ScopedGILRelease unlock; ret = gfal2_listxattr(cont->get(), file.c_str(), buffer, MAX_BUFFER_SIZE, &tmp_err); } if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); boost::python::list resu; ssize_t current = 0; while (current < ret) { std::string tmp(buffer + current); resu.append(tmp); current += tmp.size() + 1; } return resu; } boost::python::tuple Gfal2Context::bring_online(const std::string& path, time_t pintime, time_t timeout, bool async) { GError* tmp_err = NULL; char token[128] = { 0 }; int ret; { ScopedGILRelease unlock; ret = gfal2_bring_online(cont->get(), path.c_str(), pintime, timeout, token, sizeof(token), async, &tmp_err); } if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return boost::python::make_tuple(ret, std::string(token)); } boost::python::tuple Gfal2Context::bring_online(const std::string& path, const std::string& metadata, time_t pintime, time_t timeout, bool async) { GError* tmp_err = NULL; char token[128] = { 0 }; int ret; { ScopedGILRelease unlock; ret = gfal2_bring_online_v2(cont->get(), path.c_str(), metadata.c_str(), pintime, timeout, token, sizeof(token), async, &tmp_err); } if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return boost::python::make_tuple(ret, std::string(token)); } boost::python::list Gfal2Context::qos_check_classes(const std::string& url, const std::string& type) { GError* tmp_err = NULL; char buffer[MAX_BUFFER_SIZE]; ssize_t ret; { ScopedGILRelease unlock; ret = gfal2_qos_check_classes(cont->get(), url.c_str(), type.c_str(), buffer, MAX_BUFFER_SIZE, &tmp_err); } if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); std::string classes(buffer); std::istringstream iss(classes); std::string classToken; boost::python::list qos_classes; while (std::getline(iss, classToken, ',')) { qos_classes.append(classToken); } return qos_classes; } std::string Gfal2Context::check_file_qos(const std::string& fileUrl) { ScopedGILRelease unlock; GError* tmp_err = NULL; char buffer[MAX_BUFFER_SIZE]; ssize_t ret = gfal2_check_file_qos(cont->get(), fileUrl.c_str(), buffer, MAX_BUFFER_SIZE, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return std::string(buffer); } boost::python::list Gfal2Context::check_available_qos_transitions(const std::string& qosClassUrl) { GError* tmp_err = NULL; boost::python::list qos_transitions; char buffer[MAX_BUFFER_SIZE]; ssize_t ret; { ScopedGILRelease unlock; ret = gfal2_check_available_qos_transitions(cont->get(), qosClassUrl.c_str(), buffer, MAX_BUFFER_SIZE, &tmp_err); } if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); std::string transitions(buffer); std::istringstream iss(transitions); std::string transitionToken; while (std::getline(iss, transitionToken, ',')) { qos_transitions.append(transitionToken); } return qos_transitions; } std::string Gfal2Context::check_target_qos(const std::string& fileUrl) { ScopedGILRelease unlock; GError* tmp_err = NULL; char buffer[MAX_BUFFER_SIZE]; ssize_t ret = gfal2_check_target_qos(cont->get(), fileUrl.c_str(), buffer, MAX_BUFFER_SIZE, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return std::string(buffer); } int Gfal2Context::change_object_qos(const std::string& fileUrl, const std::string& newQosClass) { ScopedGILRelease unlock; GError* tmp_err = NULL; int ret = gfal2_change_object_qos(cont->get(), fileUrl.c_str(), newQosClass.c_str(), &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return ret; } std::string Gfal2Context::token_retrieve(const std::string& url, const std::string& issuer, unsigned validity, bool write_access) { boost::python::list no_activities; return token_retrieve(url, issuer, validity, write_access, no_activities); } std::string Gfal2Context::token_retrieve(const std::string& url, const std::string& issuer, unsigned validity, const boost::python::list& pyactivities) { size_t n_activities = boost::python::len(pyactivities); if (n_activities == 0) throw GErrorWrapper("Empty list of activities", EINVAL); return token_retrieve(url, issuer, validity, false, pyactivities); } std::string Gfal2Context::token_retrieve(const std::string& url, const std::string& issuer, unsigned validity, bool write_access, const boost::python::list& pyactivities) { // Increase size to account for final NULL element size_t n_activities = boost::python::len(pyactivities) + 1; std::vector activities(n_activities); const char* activities_ptr[n_activities]; char buffer[MAX_BUFFER_SIZE]; GError* tmp_err = NULL; for (size_t i = 0; i < n_activities - 1; i++) { activities.push_back(boost::python::extract(pyactivities[i])); activities_ptr[i] = activities.back().c_str(); } activities_ptr[n_activities - 1] = NULL; ScopedGILRelease unlock; ssize_t ret = gfal2_token_retrieve(cont->get(), url.c_str(), issuer.c_str(), write_access, validity, activities_ptr, buffer, MAX_BUFFER_SIZE, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return std::string(buffer); } int Gfal2Context::bring_online_poll(const std::string& path, const std::string& token) { ScopedGILRelease unlock; GError* tmp_err = NULL; int ret = gfal2_bring_online_poll(cont->get(), path.c_str(), token.c_str(), &tmp_err); if (ret < 0 && tmp_err->code == EAGAIN) { g_error_free(tmp_err); ret = 0; } if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return ret; } int Gfal2Context::archive_poll(const std::string& path) { ScopedGILRelease unlock; GError* tmp_err = NULL; int ret = gfal2_archive_poll(cont->get(), path.c_str(), &tmp_err); if (ret < 0 && tmp_err->code == EAGAIN) { g_error_free(tmp_err); ret = 0; } if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return ret; } int Gfal2Context::release(const std::string& path) { return release(path, ""); } int Gfal2Context::release(const std::string& path, const std::string& token) { ScopedGILRelease unlock; GError* tmp_err = NULL; const char* token_ptr = NULL; if (!token.empty()) { token_ptr = token.c_str(); } int ret = gfal2_release_file(cont->get(), path.c_str(), token_ptr, &tmp_err); if (ret < 0) GErrorWrapper::throwOnError(&tmp_err); return ret; } boost::python::tuple Gfal2Context::bring_online_list(const boost::python::list& pyfiles, time_t pintime, time_t timeout, bool async) { size_t nbfiles = boost::python::len(pyfiles); if (nbfiles == 0) throw GErrorWrapper("Empty list of files", EINVAL); std::vector files(nbfiles); std::vector errors(nbfiles, NULL); const char* files_ptr[nbfiles]; for (size_t i = 0; i < nbfiles; ++i) { files.push_back(boost::python::extract(pyfiles[i])); files_ptr[i] = files.back().c_str(); } char token[128] = { 0 }; { ScopedGILRelease unlock; gfal2_bring_online_list(cont->get(), nbfiles, files_ptr, pintime, timeout, token, sizeof(token), async, errors.data()); } boost::python::list pyerrors; GError2PyError(pyerrors, nbfiles, errors.data()); return boost::python::make_tuple(pyerrors, std::string(token)); } boost::python::tuple Gfal2Context::bring_online_list(const boost::python::list& pyfiles, const boost::python::list& pymetadata, time_t pintime, time_t timeout, bool async) { size_t nbfiles = boost::python::len(pyfiles); if (nbfiles == 0) throw GErrorWrapper("Empty list of files", EINVAL); size_t nbmetadata = boost::python::len(pymetadata); if (nbfiles != nbmetadata) throw GErrorWrapper("List of urls and list of metadata with different sizes", EINVAL); std::vector files(nbfiles); std::vector errors(nbfiles, NULL); const char* files_ptr[nbfiles]; std::vector metadata(nbfiles); const char* metadata_ptr[nbfiles]; for (size_t i = 0; i < nbfiles; ++i) { files.push_back(boost::python::extract(pyfiles[i])); metadata.push_back(boost::python::extract(pymetadata[i])); files_ptr[i] = files.back().c_str(); metadata_ptr[i] = metadata.back().c_str(); } char token[128] = { 0 }; { ScopedGILRelease unlock; gfal2_bring_online_list_v2(cont->get(), nbfiles, files_ptr, metadata_ptr, pintime, timeout, token, sizeof(token), async, errors.data()); } boost::python::list pyerrors; GError2PyError(pyerrors, nbfiles, errors.data()); return boost::python::make_tuple(pyerrors, std::string(token)); } boost::python::list Gfal2Context::bring_online_poll_list(const boost::python::list& pyfiles, const std::string& token) { size_t nbfiles = boost::python::len(pyfiles); if (nbfiles == 0) throw GErrorWrapper("Empty list of files", EINVAL); std::vector files(nbfiles); std::vector errors(nbfiles, NULL); const char* files_ptr[nbfiles]; for (size_t i = 0; i < nbfiles; ++i) { files.push_back(boost::python::extract(pyfiles[i])); files_ptr[i] = files.back().c_str(); } { ScopedGILRelease unlock; gfal2_bring_online_poll_list(cont->get(), nbfiles, files_ptr, token.c_str(), errors.data()); } boost::python::list pyerrors; GError2PyError(pyerrors, nbfiles, errors.data()); return pyerrors; } boost::python::list Gfal2Context::archive_poll_list(const boost::python::list& pyfiles) { size_t nbfiles = boost::python::len(pyfiles); if (nbfiles == 0) throw GErrorWrapper("Empty list of files", EINVAL); std::vector files(nbfiles); std::vector errors(nbfiles, NULL); const char* files_ptr[nbfiles]; for (size_t i = 0; i < nbfiles; ++i) { files.push_back(boost::python::extract(pyfiles[i])); files_ptr[i] = files.back().c_str(); } { ScopedGILRelease unlock; gfal2_archive_poll_list(cont->get(), nbfiles, files_ptr, errors.data()); } boost::python::list pyerrors; GError2PyError(pyerrors, nbfiles, errors.data()); return pyerrors; } boost::python::list Gfal2Context::release_list(const boost::python::list& pyfiles) { return release_list(pyfiles, ""); } boost::python::list Gfal2Context::release_list(const boost::python::list& pyfiles, const std::string& token) { size_t nbfiles = boost::python::len(pyfiles); if (nbfiles == 0) throw GErrorWrapper("Empty list of files", EINVAL); std::vector files(nbfiles); std::vector errors(nbfiles, NULL); const char* files_ptr[nbfiles]; for (size_t i = 0; i < nbfiles; ++i) { files.push_back(boost::python::extract(pyfiles[i])); files_ptr[i] = files.back().c_str(); } const char* token_ptr = NULL; if (!token.empty()) { token_ptr = token.c_str(); } { ScopedGILRelease unlock; gfal2_release_file_list(cont->get(), nbfiles, files_ptr, token_ptr, errors.data()); } boost::python::list pyerrors; GError2PyError(pyerrors, nbfiles, errors.data()); return pyerrors; } int Gfal2Context::abort_bring_online(const std::string &path, const std::string& token) { GError* error = NULL; const char* file_ptr = path.c_str(); int ret; ScopedGILRelease unlock; ret = gfal2_abort_files(cont->get(), 1, &file_ptr, token.c_str(), &error); if (ret < 0) GErrorWrapper::throwOnError(&error); return ret; } boost::python::list Gfal2Context::abort_bring_online_list( const boost::python::list& pyfiles, const std::string& token) { size_t nbfiles = boost::python::len(pyfiles); if (nbfiles == 0) throw GErrorWrapper("Empty list of files", EINVAL); std::vector files(nbfiles); std::vector errors(nbfiles, NULL); const char* files_ptr[nbfiles]; for (size_t i = 0; i < nbfiles; ++i) { files.push_back(boost::python::extract(pyfiles[i])); files_ptr[i] = files.back().c_str(); } { ScopedGILRelease unlock; gfal2_abort_files(cont->get(), nbfiles, files_ptr, token.c_str(), errors.data()); } boost::python::list pyerrors; GError2PyError(pyerrors, nbfiles, errors.data()); return pyerrors; } boost::shared_ptr Gfal2Context::open(const std::string & path, const std::string &flag) { return boost::shared_ptr(new File(*this, path, flag)); } boost::shared_ptr Gfal2Context::file(const std::string & path, const std::string &flag) { return open(path, flag); } boost::shared_ptr Gfal2Context::opendir(const std::string & path) { return boost::shared_ptr(new Directory(*this, path)); } boost::shared_ptr Gfal2Context::directory(const std::string & path) { return opendir(path); } bool Gfal2Context::remove_opt(const std::string & group_name, const std::string & key) { ScopedGILRelease unlock; GError * tmp_err = NULL; bool ret = gfal2_remove_opt(cont->get(), group_name.c_str(), key.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return ret; } int Gfal2Context::get_opt_integer(const std::string & nmspace, const std::string & key) { ScopedGILRelease unlock; GError * tmp_err = NULL; int ret = gfal2_get_opt_integer(cont->get(), nmspace.c_str(), key.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return ret; } std::string Gfal2Context::get_opt_string(const std::string & nmspace, const std::string & key) { ScopedGILRelease unlock; GError * tmp_err = NULL; char* p = gfal2_get_opt_string(cont->get(), nmspace.c_str(), key.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return std::string(p); } boost::python::list Gfal2Context::get_opt_string_list(const std::string & nmspace, const std::string & key) { GError * tmp_err = NULL; gsize size = 0; char** res; { ScopedGILRelease unlock; res = gfal2_get_opt_string_list(cont->get(), nmspace.c_str(), key.c_str(), &size, &tmp_err); } GErrorWrapper::throwOnError(&tmp_err); boost::python::list result; if (res) { for (size_t i = 0; i < size; i++) result.append(std::string(res[i])); g_strfreev(res); } return result; } bool Gfal2Context::get_opt_boolean(const std::string & nmspace, const std::string & key) { ScopedGILRelease unlock; GError * tmp_err = NULL; const bool ret = gfal2_get_opt_boolean(cont->get(), nmspace.c_str(), key.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return ret; } int Gfal2Context::set_opt_integer(const std::string & nmspace, const std::string & key, int value) { ScopedGILRelease unlock; GError * tmp_err = NULL; int ret = gfal2_set_opt_integer(cont->get(), nmspace.c_str(), key.c_str(), value, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return ret; } int Gfal2Context::set_opt_string(const std::string & nmspace, const std::string & key, const std::string & value) { ScopedGILRelease unlock; GError * tmp_err = NULL; int ret = gfal2_set_opt_string(cont->get(), nmspace.c_str(), key.c_str(), (char*) value.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return ret; } int Gfal2Context::set_opt_string_list(const std::string & nmspace, const std::string & key, const boost::python::list &py_value) { std::vector value = convert_python_list_to_typed_list( py_value); ScopedGILRelease unlock; GError * tmp_err = NULL; const int size_list = value.size(); char* tab_ptr[size_list + 1]; for (int i = 0; i < size_list; i++) { tab_ptr[i] = (char*) value[i].c_str(); } tab_ptr[size_list] = NULL; int ret = gfal2_set_opt_string_list(cont->get(), nmspace.c_str(), key.c_str(), tab_ptr, size_list, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return ret; } int Gfal2Context::set_opt_boolean(const std::string & nmspace, const std::string & key, bool val) { ScopedGILRelease unlock; GError * tmp_err = NULL; int ret = gfal2_set_opt_boolean(cont->get(), nmspace.c_str(), key.c_str(), val, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return ret; } int Gfal2Context::load_opts_from_file(const std::string & path) { ScopedGILRelease unlock; GError * tmp_err = NULL; int ret = gfal2_load_opts_from_file(cont->get(), path.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return ret; } boost::python::list Gfal2Context::get_plugin_names(void) { gchar** plugins; { ScopedGILRelease unlock; plugins = gfal2_get_plugin_names(cont->get()); } int nplugins = g_strv_length(plugins); boost::python::list pyplugins; for (int i = 0; i < nplugins; ++i) { pyplugins.append(std::string(plugins[i])); } g_strfreev(plugins); return pyplugins; } int Gfal2Context::set_user_agent(const std::string & agent, const std::string & version) { ScopedGILRelease unlock; GError * tmp_err = NULL; int ret = gfal2_set_user_agent(cont->get(), agent.c_str(), version.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return ret; } boost::python::tuple Gfal2Context::get_user_agent(void) { const char* agent, *version; { ScopedGILRelease unlock; gfal2_get_user_agent(cont->get(), &agent, &version); } return boost::python::make_tuple(agent, version); } int Gfal2Context::add_client_info(const std::string& key, const std::string& value) { ScopedGILRelease unlock; GError * tmp_err = NULL; int ret = gfal2_add_client_info(cont->get(), key.c_str(), value.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return ret; } int Gfal2Context::remove_client_info(const std::string& key) { ScopedGILRelease unlock; GError * tmp_err = NULL; int ret = gfal2_remove_client_info(cont->get(), key.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return ret; } int Gfal2Context::clear_client_info(void) { ScopedGILRelease unlock; GError * tmp_err = NULL; int ret = gfal2_clear_client_info(cont->get(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return ret; } boost::python::dict Gfal2Context::get_client_info(void) { GError* tmp_err = NULL; size_t nitems; { ScopedGILRelease unlock; nitems = gfal2_get_client_info_count(cont->get(), &tmp_err); } GErrorWrapper::throwOnError(&tmp_err); boost::python::dict dictionary; for (size_t i = 0; i < nitems; ++i) { const char *key, *value; gfal2_get_client_info_pair(cont->get(), i, &key, &value, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); dictionary[key] = value; } return dictionary; } int Gfal2Context::cred_set(const std::string& url_prefix, const Cred& c) { ScopedGILRelease unlock; GError* error = NULL; int res = gfal2_cred_set(cont->get(), url_prefix.c_str(), c.cred, &error); GErrorWrapper::throwOnError(&error); return res; } boost::python::tuple Gfal2Context::cred_get(const std::string& type, const std::string& url) { GError* error = NULL; const char* prefix_match = NULL; const char* value; { ScopedGILRelease unlock; value = gfal2_cred_get(cont->get(), type.c_str(), url.c_str(), &prefix_match, &error); } GErrorWrapper::throwOnError(&error); std::string svalue = (value) ? value : ""; std::string sprefix_match = (prefix_match) ? prefix_match : ""; return boost::python::make_tuple(svalue, sprefix_match); } int Gfal2Context::cred_del(const std::string& type, const std::string& url) { ScopedGILRelease unlock; GError* error = NULL; int res = gfal2_cred_del(cont->get(), type.c_str(), url.c_str(), &error); GErrorWrapper::throwOnError(&error); return res; } int Gfal2Context::cred_clean() { ScopedGILRelease unlock; GError* error = NULL; int res = gfal2_cred_clean(cont->get(), &error); GErrorWrapper::throwOnError(&error); return res; } void Gfal2Context::free() { cont->free(); } int Gfal2Context::cancel() { ScopedGILRelease unlock; return gfal2_cancel(cont->get()); } int PyGfal2::gfal_set_verbose_enum(GLogLevelFlags lvls) { ScopedGILRelease unlock; gfal2_log_set_level(lvls); return 0; } gfal2-bindings-v1.12.2/src/Gfal2Context.h000066400000000000000000000210571453603530000200150ustar00rootroot00000000000000/* * Copyright (c) CERN 2013-2015 * * Copyright (c) Members of the EMI Collaboration. 2010-2013 * See http://www.eu-emi.eu/partners for details on the copyright * holders. * * 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. */ #ifndef GFAL2CONTEXT_h #define GFAL2CONTEXT_h #include #include #include #include #include #include #include #include #include "Directory.h" #include "Dirent.h" #include "File.h" #include "GfaltParams.h" #include "Stat.h" #include "Cred.h" #include "pyGIL.h" namespace PyGfal2 { class GfalContextWrapper { private: gfal2_context_t context; public: GfalContextWrapper() { GError* tmp_err = NULL; context = gfal2_context_new(&tmp_err); if (context == NULL) { GErrorWrapper::throwOnError(&tmp_err); } } ~GfalContextWrapper() { if (context != NULL) { gfal2_context_free(context); } } gfal2_context_t get() { if (context == NULL) { throw GErrorWrapper("gfal2 context has been freed", EFAULT); } return context; } void free() { if (context == NULL) { throw GErrorWrapper("gfal2 context has been freed", EFAULT); } gfal2_context_free(context); context = NULL; } }; class Gfal2Context { private: boost::shared_ptr cont; public: Gfal2Context() { ScopedGILRelease unlock; cont = boost::shared_ptr(new GfalContextWrapper); } virtual ~Gfal2Context() { } static Gfal2Context creat_context(void) { return PyGfal2::Gfal2Context(); } boost::shared_ptr getContext() const { return cont ; } void free(); int cancel(); boost::shared_ptr open(const std::string & path, const std::string &flag); boost::shared_ptr file(const std::string & path, const std::string &flag); boost::shared_ptr opendir(const std::string & path); boost::shared_ptr directory(const std::string & path); Stat lstat(const std::string & path); Stat stat_c(const std::string & path); int access(const std::string &, int flag); int chmod(const std::string &, mode_t mode); int unlink(const std::string &); boost::python::list unlink_list(const boost::python::list& files); int mkdir(const std::string &, mode_t mode); int mkdir_rec(const std::string &, mode_t mode); int rmdir(const std::string &); boost::python::list listdir(const std::string &); int rename(const std::string & src, const std::string & dest); std::string readlink(const std::string & path); int symlink(const std::string & oldpath, const std::string & newpath); std::string checksum(const std::string & uri, const std::string & chk_type, off_t start_offset, size_t data_length); std::string checksum(const std::string & uri, const std::string & chk_type); // extended attributes std::string getxattr(const std::string & file, const std::string & key); int setxattr(const std::string & file, const std::string & key, const std::string & value, int flag); boost::python::list listxattr(const std::string & file ); // parameters bool remove_opt(const std::string & group_name, const std::string & key); int get_opt_integer(const std::string & nmspace, const std::string & key); std::string get_opt_string(const std::string & nmspace, const std::string & key); boost::python::list get_opt_string_list(const std::string & nmspace, const std::string & key); bool get_opt_boolean(const std::string & nmspace, const std::string & key); int set_opt_integer(const std::string & nmspace, const std::string & key, int value); int set_opt_string(const std::string & nmspace, const std::string & key, const std::string & value); int set_opt_string_list(const std::string & nmspace, const std::string & key, const boost::python::list & value); int set_opt_boolean(const std::string & nmspace, const std::string & key, bool val); int load_opts_from_file(const std::string & path); int set_user_agent(const std::string & agent, const std::string & version); boost::python::list get_plugin_names(void); // Client-side additional information boost::python::tuple get_user_agent(void); int add_client_info(const std::string& key, const std::string& value); int remove_client_info(const std::string& key); int clear_client_info(void); boost::python::dict get_client_info(void); // transfer int filecopy(const std::string & src, const std::string & dst); int filecopy(const GfaltParams & p, const std::string & src, const std::string & dst); boost::python::object filecopy(const boost::python::list& srcs, const boost::python::list& dsts); boost::python::object filecopy(const GfaltParams & p, const boost::python::list& srcs, const boost::python::list& dsts); boost::python::object filecopy(const GfaltParams & p, const boost::python::list& srcs, const boost::python::list& dsts, const boost::python::list& checksums); // bring online and related boost::python::tuple bring_online(const std::string& path, time_t pintime, time_t timeout, bool async); boost::python::tuple bring_online(const std::string& path, const std::string& metadata, time_t pintime, time_t timeout, bool async); int bring_online_poll(const std::string& path, const std::string& token); int archive_poll(const std::string& path); int release(const std::string& path); int release(const std::string& path, const std::string& token); boost::python::tuple bring_online_list(const boost::python::list& files, time_t pintime, time_t timeout, bool async); boost::python::tuple bring_online_list(const boost::python::list& files, const boost::python::list& metadata, time_t pintime, time_t timeout, bool async); boost::python::list bring_online_poll_list(const boost::python::list& files, const std::string& token); boost::python::list archive_poll_list(const boost::python::list& files); boost::python::list release_list(const boost::python::list& files); boost::python::list release_list(const boost::python::list& files, const std::string& token); int abort_bring_online(const std::string& path, const std::string& token); boost::python::list abort_bring_online_list(const boost::python::list& files, const std::string& token); // QoS boost::python::list qos_check_classes(const std::string& url, const std::string& type); std::string check_file_qos(const std::string& fileUrl); boost::python::list check_available_qos_transitions(const std::string& qosClassUrl); std::string check_target_qos(const std::string& fileUrl); int change_object_qos(const std::string& fileUrl, const std::string& newQosClass); // Token std::string token_retrieve(const std::string& url, const std::string& issuer, unsigned validity, bool write_access); std::string token_retrieve(const std::string& url, const std::string& issuer, unsigned validity, const boost::python::list& pyactivities); std::string token_retrieve(const std::string& url, const std::string& issuer, unsigned validity, bool write_access, const boost::python::list& pyactivities); // Cred object int cred_set(const std::string& url_prefix, const Cred& c); boost::python::tuple cred_get(const std::string& type, const std::string& url); int cred_del(const std::string& type, const std::string& url); int cred_clean(); }; int gfal_set_verbose_enum(GLogLevelFlags lvls); } // PyGfal2 namespace #endif /* GFAL2CONTEXT_h */ gfal2-bindings-v1.12.2/src/GfaltParams.cpp000066400000000000000000000247441453603530000202570ustar00rootroot00000000000000/* * Copyright (c) CERN 2013-2015 * * Copyright (c) Members of the EMI Collaboration. 2010-2013 * See http://www.eu-emi.eu/partners for details on the copyright * holders. * * 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. */ #include "GfaltParams.h" #include "pyGIL.h" using namespace PyGfal2; #if PY_VERSION_HEX < 0x02060000 #define PyErr_WarnEx(category, msg, level) PyErr_Warn(category, msg) #endif static void event_callback_wrapper(const gfalt_event_t e, gpointer user_data) { ScopedGILLocker lock; CallbackObjs* callbacks = static_cast(user_data); if (callbacks->event_callback) { boost::python::call(callbacks->event_callback.ptr(), GfaltEvent(e)); } } static void monitor_callback_wrapper(gfalt_transfer_status_t h, const char* src, const char* dst, gpointer user_data) { ScopedGILLocker lock; CallbackObjs* callbacks = static_cast(user_data); if (callbacks->monitor_callback) { size_t avg = gfalt_copy_get_average_baudrate(h, NULL); size_t inst = gfalt_copy_get_instant_baudrate(h, NULL); size_t trans = gfalt_copy_get_bytes_transferred(h, NULL); time_t elapsed = gfalt_copy_get_elapsed_time(h, NULL); boost::python::call(callbacks->monitor_callback.ptr(), src, dst, avg, inst, trans, elapsed); } } GfaltParams::GfaltParams() { GError * tmp_err = NULL; params = gfalt_params_handle_new(&tmp_err); GErrorWrapper::throwOnError(&tmp_err); } GfaltParams::GfaltParams(const GfaltParams & s) { GError * tmp_err = NULL; params = gfalt_params_handle_copy(s.params, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } GfaltParams GfaltParams::copy() { return GfaltParams(*this); } GfaltParams::~GfaltParams() { gfalt_params_handle_delete(params, NULL); } void GfaltParams::set_timeout(guint64 timeout) { GError * tmp_err = NULL; gfalt_set_timeout(params, timeout, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } guint64 GfaltParams::get_timeout() { GError * tmp_err = NULL; guint64 res = gfalt_get_timeout(params, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return res; } void GfaltParams::set_nbstream(guint nbstream) { GError * tmp_err = NULL; gfalt_set_nbstreams(params, nbstream, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } guint GfaltParams::get_nbstream() { GError * tmp_err = NULL; guint res = gfalt_get_nbstreams(params, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return res; } void GfaltParams::set_checksum_check(bool checksum_check) { PyErr_WarnEx(PyExc_DeprecationWarning, "checksum_check is deprecated. Use set_checksum instead.", 1); GError *tmp_err = NULL; char type[64], buffer[512]; gfalt_get_checksum(params, type, sizeof(type), buffer, sizeof(buffer), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); gfalt_set_checksum(params, checksum_check?GFALT_CHECKSUM_BOTH:GFALT_CHECKSUM_NONE, type, buffer, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } bool GfaltParams::get_checksum_check() { PyErr_WarnEx(PyExc_DeprecationWarning, "checksum_check is deprecated. Use get_checksum_mode instead.", 1); GError * tmp_err = NULL; bool res = gfalt_get_checksum_mode(params, &tmp_err) != GFALT_CHECKSUM_NONE; GErrorWrapper::throwOnError(&tmp_err); return res; } void GfaltParams::set_src_spacetoken(const std::string & token) { GError * tmp_err = NULL; gfalt_set_src_spacetoken(params, token.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } std::string GfaltParams::get_src_spacetoken() { GError * tmp_err = NULL; const gchar* res = gfalt_get_src_spacetoken(params, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return (res) ? res : ""; } void GfaltParams::set_dst_spacetoken(const std::string & token) { GError * tmp_err = NULL; gfalt_set_dst_spacetoken(params, token.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } std::string GfaltParams::get_dst_spacetoken() { GError * tmp_err = NULL; const gchar* res = gfalt_get_dst_spacetoken(params, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return (res) ? res : ""; } void GfaltParams::set_user_defined_checksum(const std::string & chk_type, const std::string & checksum) { PyErr_WarnEx(PyExc_DeprecationWarning, "set_user_defined_checksum is deprecated. Use set_checksum instead.", 1); GError * tmp_err = NULL; gfalt_checksum_mode_t current = gfalt_get_checksum_mode(params, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); gfalt_set_checksum(params, current, chk_type.c_str(), checksum.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } boost::python::tuple GfaltParams::get_user_defined_checksum() { PyErr_WarnEx(PyExc_DeprecationWarning, "get_user_defined_checksum is deprecated. Use get_checksum instead.", 1); char buff_chktype[GFAL_URL_MAX_LEN]; char buff_chk[GFAL_URL_MAX_LEN]; GError * tmp_err = NULL; gfalt_get_checksum(params, buff_chktype, GFAL_URL_MAX_LEN, buff_chk, GFAL_URL_MAX_LEN, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return boost::python::make_tuple(buff_chktype, buff_chk); } void GfaltParams::set_overwrite(bool overwrite) { GError * tmp_err = NULL; gfalt_set_replace_existing_file(params, overwrite, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } bool GfaltParams::get_overwrite(void) { GError * tmp_err = NULL; gboolean overwrite = gfalt_get_replace_existing_file(params, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return overwrite; } void GfaltParams::set_create_parent(bool create_parent) { GError * tmp_err = NULL; gfalt_set_create_parent_dir(params, create_parent, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } bool GfaltParams::get_create_parent(void) { GError * tmp_err = NULL; gboolean create = gfalt_get_create_parent_dir(params, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return create; } void GfaltParams::set_tcp_buffersize(uint64_t buffersize) { GError * tmp_err = NULL; gfalt_set_tcp_buffer_size(params, buffersize, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } uint64_t GfaltParams::get_tcp_buffersize(void) { GError * tmp_err = NULL; uint64_t buffersize = gfalt_get_tcp_buffer_size(params, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return buffersize; } void GfaltParams::set_strict_copy(bool strict_copy) { GError * tmp_err = NULL; gfalt_set_strict_copy_mode(params, strict_copy, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } bool GfaltParams::get_strict_copy(void) { GError * tmp_err = NULL; bool strict = gfalt_get_strict_copy_mode(params, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return strict; } void GfaltParams::set_proxy_delegation(bool proxy_delegation) { GError * tmp_err = NULL; gfalt_set_use_proxy_delegation(params, proxy_delegation, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } bool GfaltParams::get_proxy_delegation(void) { GError * tmp_err = NULL; bool proxy_delegation = gfalt_get_use_proxy_delegation(params, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return proxy_delegation; } void GfaltParams::set_scitag(guint scitag) { GError * tmp_err = NULL; gfalt_set_scitag(params, scitag, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } guint GfaltParams::get_scitag(void) { GError * tmp_err = NULL; guint scitag = gfalt_get_scitag(params, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return scitag; } void GfaltParams::set_evict(bool evict) { GError * tmp_err = NULL; gfalt_set_use_evict(params, evict, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } bool GfaltParams::get_evict(void) { GError * tmp_err = NULL; bool evict = gfalt_get_use_evict(params, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return evict; } void GfaltParams::set_local_transfers(bool local_transfers) { GError * tmp_err = NULL; gfalt_set_local_transfer_perm(params, local_transfers, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } bool GfaltParams::get_local_transfers(void) { GError * tmp_err = NULL; bool local_transfers = gfalt_get_local_transfer_perm(params, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return local_transfers; } void GfaltParams::set_checksum(gfalt_checksum_mode_t mode, const std::string &type, const std::string &value) { GError *tmp_err = NULL; gfalt_set_checksum(params, mode, type.c_str(), value.c_str(), &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } boost::python::tuple GfaltParams::get_checksum() { char buff_chktype[GFAL_URL_MAX_LEN]; char buff_chk[GFAL_URL_MAX_LEN]; GError * tmp_err = NULL; gfalt_checksum_mode_t mode = gfalt_get_checksum(params, buff_chktype, GFAL_URL_MAX_LEN, buff_chk, GFAL_URL_MAX_LEN, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); return boost::python::make_tuple(mode, buff_chktype, buff_chk); } // Callbacks void GfaltParams::set_event_callback(PyObject* callable) { callback_objs.event_callback = boost::python::object( boost::python::handle<>(boost::python::borrowed(callable))); GError *tmp_err = NULL; gfalt_add_event_callback(params, event_callback_wrapper, &callback_objs, NULL, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } PyObject* GfaltParams::get_event_callback(void) { return callback_objs.event_callback.ptr(); } void GfaltParams::set_monitor_callback(PyObject* callable) { callback_objs.monitor_callback = boost::python::object( boost::python::handle<>(boost::python::borrowed(callable))); GError *tmp_err = NULL; gfalt_add_monitor_callback(params, monitor_callback_wrapper, &callback_objs, NULL, &tmp_err); GErrorWrapper::throwOnError(&tmp_err); } PyObject* GfaltParams::get_monitor_callback(void) { return callback_objs.monitor_callback.ptr(); } gfal2-bindings-v1.12.2/src/GfaltParams.h000066400000000000000000000104431453603530000177130ustar00rootroot00000000000000/* * Copyright (c) CERN 2013-2015 * * Copyright (c) Members of the EMI Collaboration. 2010-2013 * See http://www.eu-emi.eu/partners for details on the copyright * holders. * * 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. */ #ifndef GFALT_PARAMS_H #define GFALT_PARAMS_H #include #include #include #include "GErrorWrapper.h" namespace PyGfal2 { // Convenience wrapper for gfal_event_t class GfaltEvent { public: int side; gint64 timestamp; std::string stage; std::string domain; std::string description; GfaltEvent(): side(0), timestamp(0) { } GfaltEvent(gfalt_event_t e): side(e->side), timestamp(e->timestamp), description(e->description) { stage = g_quark_to_string(e->stage); domain = g_quark_to_string(e->domain); } std::string __str__(void) const { std::ostringstream stream; stream << '[' << timestamp << "] "; switch (side) { case GFAL_EVENT_SOURCE: stream << "SOURCE "; break; case GFAL_EVENT_DESTINATION: stream << "DEST "; break; default: stream << "BOTH "; break; } stream << domain << '\t' << stage << '\t' << description; return stream.str(); } }; // Callback objects // Only one, since the user data is shared between event and monitoring callbacks struct CallbackObjs { boost::python::object event_callback; boost::python::object monitor_callback; }; // Wrapper for gfalt_params_t class GfaltParams { private: gfalt_params_t params; CallbackObjs callback_objs; public: GfaltParams(); GfaltParams(const GfaltParams & s); GfaltParams copy(); virtual ~GfaltParams(); void set_timeout(guint64 timeout); guint64 get_timeout(); void set_nbstream(guint nbstream); guint get_nbstream(); void set_checksum_check(bool checksum_check); bool get_checksum_check(); void set_src_spacetoken(const std::string & token); std::string get_src_spacetoken(); void set_dst_spacetoken(const std::string & token); std::string get_dst_spacetoken(); void set_user_defined_checksum(const std::string & chk_type, const std::string & checksum); boost::python::tuple get_user_defined_checksum(); void set_overwrite(bool overwrite); bool get_overwrite(void); void set_create_parent(bool create_parent); bool get_create_parent(void); void set_tcp_buffersize(uint64_t buffersize); uint64_t get_tcp_buffersize(void); void set_strict_copy(bool strict_copy); bool get_strict_copy(void); void set_proxy_delegation(bool proxy_delegation); bool get_proxy_delegation(void); void set_scitag(guint scitag); guint get_scitag(void); void set_evict(bool evict); bool get_evict(void); void set_local_transfers(bool local_transfers); bool get_local_transfers(void); void set_checksum(gfalt_checksum_mode_t mode, const std::string &type, const std::string &value); boost::python::tuple get_checksum(); // Callbacks void set_event_callback(PyObject* callable); PyObject* get_event_callback(void); void set_monitor_callback(PyObject* callable); PyObject* get_monitor_callback(void); friend class Gfal2Context; }; } #endif // GFALT_PARAMS_H gfal2-bindings-v1.12.2/src/LoggingHelper.cpp000066400000000000000000000057441453603530000206030ustar00rootroot00000000000000/* * Copyright @ CERN, 2014-2015 * * 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. */ #include #include "LoggingHelper.h" #include "pyGIL.h" static PyObject* get_logger(const char *name = "gfal2") { static char format[] = "s"; PyObject* logging = PyImport_ImportModule("logging"); PyObject* getLogger = NULL; if (logging != NULL) { getLogger = PyObject_GetAttrString(logging, "getLogger"); } else return NULL; if (getLogger != NULL) { return PyObject_CallFunction(getLogger, format, name); } else return NULL; } static const char *level_method_name(GLogLevelFlags level) { switch (level) { case G_LOG_LEVEL_ERROR: return "error"; case G_LOG_LEVEL_CRITICAL: return "critical"; case G_LOG_LEVEL_WARNING: return "warning"; case G_LOG_LEVEL_MESSAGE: case G_LOG_LEVEL_INFO: return "info"; case G_LOG_LEVEL_DEBUG: default: return "debug"; } } void PyGfal2::logging_helper(const gchar *log_domain, GLogLevelFlags level, const gchar *message, gpointer user_data) { ScopedGILLocker lock; PyObject* logger = get_logger(); if (!logger) { return; } char format[] = "s"; PyObject_CallMethod(logger, (char*)level_method_name(level), format, message); Py_XDECREF(logger); } PyGfal2::NullHandler::NullHandler(): level(50) { } void PyGfal2::NullHandler::createLock(void) {} void PyGfal2::NullHandler::acquire(void) {} void PyGfal2::NullHandler::release(void) {} void PyGfal2::NullHandler::setLevel(int) {} void PyGfal2::NullHandler::setFormatter(boost::python::object) {} void PyGfal2::NullHandler::addFilter(boost::python::object) {} void PyGfal2::NullHandler::removeFilter(boost::python::object) {} void PyGfal2::NullHandler::filter(boost::python::object) {} void PyGfal2::NullHandler::flush() {} void PyGfal2::NullHandler::close() {} void PyGfal2::NullHandler::handle(boost::python::object) {} void PyGfal2::NullHandler::handleError(boost::python::object) {} void PyGfal2::NullHandler::format(boost::python::object) {} void PyGfal2::NullHandler::emit(boost::python::object) { } void PyGfal2::logging_register_handler(const char *name, boost::python::object handler) { PyObject *cLogger = get_logger(name); if (!cLogger) { return; } boost::python::object logger(boost::python::handle<>(boost::python::borrowed(cLogger))); logger.attr("addHandler")(handler); } gfal2-bindings-v1.12.2/src/LoggingHelper.h000066400000000000000000000034551453603530000202450ustar00rootroot00000000000000/* * Copyright @ CERN, 2014-2015 * * 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. */ #ifndef LOGGINGHELPER_H #define LOGGINGHELPER_H #include namespace PyGfal2 { /** * Makes the use of the Python logging facilities easier */ void logging_helper(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data); /** Default handler for gfal2 * Avoids "no handlers could be found for logger gfal2" * I can't figure out how to inherit from logging.Handler, so I just added all methods here */ class NullHandler { public: int level; boost::python::list filters; NullHandler(); void createLock(void); void acquire(void); void release(void); void setLevel(int lvl); void setFormatter(boost::python::object form); void addFilter(boost::python::object filt); void removeFilter(boost::python::object filt); void filter(boost::python::object record); void flush(); void close(); void handle(boost::python::object record); void handleError(boost::python::object record); void format(boost::python::object record); void emit(boost::python::object record); }; /** Register a handler for the given logger name */ void logging_register_handler(const char *name, boost::python::object handler); }; #endif // LOGGINGHELPER_H gfal2-bindings-v1.12.2/src/Stat.h000066400000000000000000000043301453603530000164230ustar00rootroot00000000000000/* * Copyright (c) CERN 2013-2015 * * Copyright (c) Members of the EMI Collaboration. 2010-2013 * See http://www.eu-emi.eu/partners for details on the copyright * holders. * * 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. */ #ifndef GSTAT_H #define GSTAT_H #include #include #include namespace PyGfal2 { class Stat { public: struct stat _st; Stat(){ memset(&_st,0, sizeof(struct stat)); } Stat(const Stat & orig){ memcpy(&_st, &(orig._st), sizeof(struct stat)); } dev_t get_st_dev(){ return _st.st_dev; } ino_t get_st_ino(){ return _st.st_ino; } mode_t get_st_mode(){ return _st.st_mode; } nlink_t get_st_nlink() { return _st.st_nlink; } uid_t get_st_uid() { return _st.st_uid; } gid_t get_st_gid() { return _st.st_gid; } size_t get_st_size() { return _st.st_size; } time_t get_st_atime() { return _st.st_atime; } time_t get_st_mtime() { return _st.st_mtime; } time_t get_st_ctime() { return _st.st_ctime; } std::string __str__() { std::ostringstream res; res << "uid: " << get_st_uid() << '\n'; res << "gid: " << get_st_gid() << '\n'; res << "mode: " << std::oct << get_st_mode() << std::dec << '\n'; res << "size: " << get_st_size() << '\n'; res << "nlink: " << get_st_nlink() << '\n'; res << "ino: " << get_st_ino() << '\n'; res << "ctime: " << get_st_ctime() << '\n'; res << "atime: " << get_st_atime() << '\n'; res << "mtime: " << get_st_mtime() << '\n'; return res.str(); } }; } #endif /* GSTAT_H */ gfal2-bindings-v1.12.2/src/gfal2.cpp000066400000000000000000000643661453603530000170550ustar00rootroot00000000000000/* * Copyright (c) CERN 2013-2015 * * Copyright (c) Members of the EMI Collaboration. 2010-2013 * See http://www.eu-emi.eu/partners for details on the copyright * holders. * * 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. */ #include #include #include #include #include "Gfal2Context.h" #include "GfaltParams.h" #include "LoggingHelper.h" #include "pyGIL.h" void gerror_exception_translator(const PyGfal2::GErrorWrapper &x) { assert(PyGfal2::GErrorPyType != NULL); PyErr_SetObject(PyGfal2::GErrorPyType, Py_BuildValue("si", x.what(), x.code())); } std::string gfal_version_wrapper(void) { return gfal2_version(); } // Wrapper to register the ptr without generating warnings with older // boost versions template void register_shared_ptr(void) { const boost::python::type_info info = boost::python::type_id >(); const boost::python::converter::registration* reg = boost::python::converter::registry::query(info); if (reg == NULL || reg->m_to_python == NULL) { boost::python::register_ptr_to_python < boost::shared_ptr < T > > (); } } boost::shared_ptr gfal2_cred_new_wrapper(const std::string& type, const std::string& value) { fprintf(stderr, "Deprecated: Please use context.cred_new() instead!\n"); return boost::shared_ptr(new PyGfal2::Cred(type, value)); } int gfal2_cred_set_wrapper(PyGfal2::Gfal2Context* ctx, const std::string& url_prefix, const PyGfal2::Cred& cred) { fprintf(stderr, "Deprecated: Please use context.cred_set() instead!\n"); return ctx->cred_set(url_prefix, cred); } int gfal2_cred_clean_wrapper(PyGfal2::Gfal2Context* ctx) { fprintf(stderr, "Deprecated: Please use context.cred_clean() instead!\n"); return ctx->cred_clean(); } BOOST_PYTHON_MODULE (gfal2) { Py_Initialize(); #if PY_VERSION_HEX < 0x3070000 // initialize multi-threading, unused since Python 3.7 PyEval_InitThreads(); #endif boost::python::scope gfal2Scope = boost::python::scope(); // Setup the logging gfal2_log_set_handler(&PyGfal2::logging_helper, NULL); gfal2_log_set_level(G_LOG_LEVEL_INFO); // disable boost::python automatic docstring generation style // do not confuse users with C++ signatures and the like boost::python::docstring_options local_docstring_options(true, true, false); // Expose gfal2-python version #ifdef GFAL2_PYTHON_VERSION boost::python::scope().attr("__version__") = boost::python::str(GFAL2_PYTHON_VERSION); #endif // global functions boost::python::def("set_verbose", &PyGfal2::gfal_set_verbose_enum, "Define the log level of gfal2"); boost::python::def("creat_context", &PyGfal2::Gfal2Context::creat_context, "Create a gfal2 context"); boost::python::def("get_version", &gfal_version_wrapper, "Get the gfal2 version"); // Credential object wrappers - kept to provide backwards compatibility // (deprecated: new versions should use Gfal2Context methods) boost::python::def("cred_set", &gfal2_cred_set_wrapper, "Set credentials"); boost::python::def("cred_new", &gfal2_cred_new_wrapper, "Define credentials"); boost::python::def("cred_clean", &gfal2_cred_clean_wrapper, "Clean credentials"); boost::python::enum_("verbose_level") .value("normal", G_LOG_LEVEL_CRITICAL) .value("warning", G_LOG_LEVEL_WARNING) .value("verbose", G_LOG_LEVEL_INFO) .value("debug", G_LOG_LEVEL_DEBUG) .value("trace", G_LOG_LEVEL_DEBUG); boost::python::enum_("checksum_mode") .value("none", GFALT_CHECKSUM_NONE) .value("source", GFALT_CHECKSUM_SOURCE) .value("target", GFALT_CHECKSUM_TARGET) .value("both", GFALT_CHECKSUM_BOTH); // register exception PyGfal2::GErrorPyType = PyGfal2::createGErrorExceptionType(gfal2Scope); boost::python::scope context_scope = boost::python::class_("Gfal2Context", "Gfal2 Context") .def("free", &PyGfal2::Gfal2Context::free, "Release internal resources used by the context. The instance can *not* be used after this" ) .def("open", &PyGfal2::Gfal2Context::open, "Opens a file and returns a file descriptor" ) .def("file", &PyGfal2::Gfal2Context::file, "Synonym for open" ) .def("opendir", &PyGfal2::Gfal2Context::opendir, "Opens a directory and returns a directory descriptor" ) .def("directory", &PyGfal2::Gfal2Context::directory, "Synonym for opendir" ) .def("access", &PyGfal2::Gfal2Context::access, "Checks if the calling process/user can access the file with the given mode (see os.access)" ) .def("lstat", &PyGfal2::Gfal2Context::lstat, "Identical to stat, but following symlinks" ) .def("stat", &PyGfal2::Gfal2Context::stat_c, "Performs a stat call on a file" ) .def("chmod", &PyGfal2::Gfal2Context::chmod, "Changes the permissions of the file" ) .def("unlink", &PyGfal2::Gfal2Context::unlink, "Removes a file" ) .def("unlink", &PyGfal2::Gfal2Context::unlink_list, "Removes a set of files" ) .def("mkdir", &PyGfal2::Gfal2Context::mkdir, "Creates a directory" ) .def("mkdir_rec", &PyGfal2::Gfal2Context::mkdir_rec, "Creates a directory and its parents if needed" ) .def("rmdir", &PyGfal2::Gfal2Context::rmdir, "Removes a directory" ) .def("listdir", &PyGfal2::Gfal2Context::listdir, "Returns the content of a directory as a list of file names" ) .def("rename", &PyGfal2::Gfal2Context::rename, "Renames a file" ) .def("readlink", &PyGfal2::Gfal2Context::readlink, "Returns a string representing the path to which the symbolic link points." ) .def("symlink", &PyGfal2::Gfal2Context::symlink, "Creates a symbolic link" ) .def("checksum", static_cast(&PyGfal2::Gfal2Context::checksum), "Returns the checksum for the given part of a file. If both offset and length are 0, the whole file will be processed" ) .def("checksum", static_cast(&PyGfal2::Gfal2Context::checksum), "Shortcut for checksum(uri, chk_type, 0, 0)" ) .def("getxattr", &PyGfal2::Gfal2Context::getxattr, "Gets an extended attribute" ) .def("setxattr", &PyGfal2::Gfal2Context::setxattr, "Sets an extended attribute" ) .def("listxattr", &PyGfal2::Gfal2Context::listxattr, "List known/supported extended attributes" ) .def("remove_opt", &PyGfal2::Gfal2Context::remove_opt, "remove an option" ) .def("get_opt_integer", &PyGfal2::Gfal2Context::get_opt_integer, "Returns the integer value assigned to a configuration parameter" ) .def("get_opt_boolean", &PyGfal2::Gfal2Context::get_opt_boolean, "Returns the boolean value assigned to a configuration parameter" ) .def("get_opt_string", &PyGfal2::Gfal2Context::get_opt_string, "Returns the string value assigned to a configuration parameter" ) .def("get_opt_string_list", &PyGfal2::Gfal2Context::get_opt_string_list, "Returns the list of strings assigned to a configuration parameter" ) .def("set_opt_string_list", &PyGfal2::Gfal2Context::set_opt_string_list, "Sets a configuration parameter as a list of strings" ) .def("set_opt_string", &PyGfal2::Gfal2Context::set_opt_string, "Sets a configuration parameter as a string" ) .def("set_opt_boolean", &PyGfal2::Gfal2Context::set_opt_boolean, "Sets a configuration parameter as a boolean" ) .def("set_opt_integer", &PyGfal2::Gfal2Context::set_opt_integer, "Sets a configuration parameter as an integer" ) .def("load_opts_from_file", &PyGfal2::Gfal2Context::load_opts_from_file, "Loads a set of configuration parameters from a .ini formatted file" ) .def("set_user_agent", &PyGfal2::Gfal2Context::set_user_agent, "Sets the user agent identification, name and version" ) .def("get_user_agent", &PyGfal2::Gfal2Context::get_user_agent, "Gets the user agent identification, name and version" ) .def("add_client_info", &PyGfal2::Gfal2Context::add_client_info, "Sets a custom key/value pair to be sent to the server, if the protocol allows it" ) .def("remove_client_info", &PyGfal2::Gfal2Context::remove_client_info, "Removes a key/value pair set previously by add_client_info" ) .def("clear_client_info", &PyGfal2::Gfal2Context::clear_client_info, "Clears all key/value pairs set by add_client_info" ) .def("get_client_info", &PyGfal2::Gfal2Context::get_client_info, "Returns the key/value pairs as a dictionary" ) .def("filecopy", static_cast(&PyGfal2::Gfal2Context::filecopy), "Shortcut for filecopy(gfal2.transfer_params(), src, dst)" ) .def("filecopy", static_cast(&PyGfal2::Gfal2Context::filecopy), "Copies src into dst using the configured transfer parameters" ) .def("filecopy", static_cast(&PyGfal2::Gfal2Context::filecopy), "Shortcut for filecopy(gfal2.transfer_params(), sources, destinations)" ) .def("filecopy", static_cast(&PyGfal2::Gfal2Context::filecopy), "Shortcut for filecopy(params, sources, destinations, [])" ) .def("filecopy", static_cast(&PyGfal2::Gfal2Context::filecopy), "Performs a bulk copy from sources[i] to destinations[i] with checksum checksum[i]. All sources must use same protocol/storage, and same goes for destinations." ) .def("cancel", &PyGfal2::Gfal2Context::cancel, "Cancel running operations") .def("bring_online", static_cast(&PyGfal2::Gfal2Context::bring_online), "Performs a bring online operation (only for protocols that support this operation)" ) .def("bring_online", static_cast(&PyGfal2::Gfal2Context::bring_online), "Performs a bring online operation (only for protocols that support this operation)" ) .def("bring_online_poll", &PyGfal2::Gfal2Context::bring_online_poll, "Polls the status for asynchronous bring_online operations" ) .def("archive_poll", &PyGfal2::Gfal2Context::archive_poll, "Polls the status for asynchronous archive operations" ) .def("release", static_cast(&PyGfal2::Gfal2Context::release), "Shortcut for release(path, token = '')" ) .def("release", static_cast(&PyGfal2::Gfal2Context::release), "Releases a file pinned by a bring_online call" ) .def("bring_online", static_cast(&PyGfal2::Gfal2Context::bring_online_list), "Performs a bring online operation (only for protocols that support this operation)" ) .def("bring_online", static_cast(&PyGfal2::Gfal2Context::bring_online_list), "Performs a bring online operation (only for protocols that support this operation)" ) .def("bring_online_poll", &PyGfal2::Gfal2Context::bring_online_poll_list, "Performs a bulk bring online poll operation" ) .def("archive_poll", &PyGfal2::Gfal2Context::archive_poll_list, "Performs a bulk archive poll operation" ) .def("release", static_cast(&PyGfal2::Gfal2Context::release_list), "Shortcut for release (paths[], token = '')" ) .def("release", static_cast(&PyGfal2::Gfal2Context::release_list), "Releases a set of files pinned by a bring_online call" ) .def("abort_bring_online", &PyGfal2::Gfal2Context::abort_bring_online, "Aborts a bring online request") .def("abort_bring_online", &PyGfal2::Gfal2Context::abort_bring_online_list, "Aborts a bring online request") .def("get_plugin_names", &PyGfal2::Gfal2Context::get_plugin_names, "Returns the name list of loaded plugins") .def("qos_check_classes", &PyGfal2::Gfal2Context::qos_check_classes, "Check the QoS classes present in an interface") .def("check_file_qos", &PyGfal2::Gfal2Context::check_file_qos, "Check the QoS of a file in a CDMI enabled interface") .def("check_available_qos_transitions", &PyGfal2::Gfal2Context::check_available_qos_transitions, "Check the available transitions for a specific QoS") .def("check_target_qos", &PyGfal2::Gfal2Context::check_target_qos, "Check the target QoS of a specific file") .def("change_object_qos", &PyGfal2::Gfal2Context::change_object_qos, "Change the QoS of an object, either dir or file") .def("token_retrieve", static_cast (&PyGfal2::Gfal2Context::token_retrieve), "Retrieve SE-issued token for given resource (uses predefined activities based on read/write access flag)") .def("token_retrieve", static_cast (&PyGfal2::Gfal2Context::token_retrieve), "Retrieve SE-issued token for given resource (uses user-defined activities)") .def("cred_set", &PyGfal2::Gfal2Context::cred_set, "Set credentials of specified type for given URL") .def("cred_get", &PyGfal2::Gfal2Context::cred_get, "Get credential of specified type for given URL") .def("cred_del", &PyGfal2::Gfal2Context::cred_del, "Delete credential of specified type for given URL") .def("cred_clean", &PyGfal2::Gfal2Context::cred_clean, "Clean credential mapping"); // register stat struct boost::python::class_ ("Stat", "Please, note that not all fields make sense for all protocols") .add_property("st_dev", &PyGfal2::Stat::get_st_dev, "Device of containing file") .add_property("st_ino", &PyGfal2::Stat::get_st_ino, "Inode") .add_property("st_mode", &PyGfal2::Stat::get_st_mode, "Protection mode") .add_property("st_nlink", &PyGfal2::Stat::get_st_nlink, "Number of hard links") .add_property("st_atime", &PyGfal2::Stat::get_st_atime, "Access time") .add_property("st_mtime", &PyGfal2::Stat::get_st_mtime, "Modification time") .add_property("st_ctime", &PyGfal2::Stat::get_st_ctime, "Creation time") .add_property("st_gid", &PyGfal2::Stat::get_st_gid, "Group ID") .add_property("st_uid", &PyGfal2::Stat::get_st_uid, "User ID") .add_property("st_size", &PyGfal2::Stat::get_st_size, "Size") .def("__str__", &PyGfal2::Stat::__str__) .def("__repr__", &PyGfal2::Stat::__str__); // register dirent struct boost::python::class_ ("Dirent", "Please, note that not all fields make sense for all protocols") .add_property("d_ino", &PyGfal2::Dirent::get_d_ino, "Inode") .add_property("d_off", &PyGfal2::Dirent::get_d_off, "Offset to the next dirent") .add_property("d_reclen", &PyGfal2::Dirent::get_d_reclen, "Length of this record") .add_property("d_type", &PyGfal2::Dirent::get_d_type, "Type of file") .add_property("d_name", &PyGfal2::Dirent::get_d_name, "Entry name") .def("__nonzero__", &PyGfal2::Dirent::isValid); // register Gfal2 credential struct boost::python::class_ ("Credential", "Credential object holding type and value", boost::python::init()) .add_property("type", &PyGfal2::Cred::get_type, "Credential type") .add_property("value", &PyGfal2::Cred::get_value, "Credential value"); register_shared_ptr(); boost::python::scope().attr("cred_new") = boost::python::scope().attr("Credential"); // Transfer parameters boost::python::class_("TransferParameters", "filecopy parameters") .def("copy", &PyGfal2::GfaltParams::copy) .add_property("timeout", &PyGfal2::GfaltParams::get_timeout, &PyGfal2::GfaltParams::set_timeout, "Operation timeout" ) .add_property("checksum_check", &PyGfal2::GfaltParams::get_checksum_check, &PyGfal2::GfaltParams::set_checksum_check, "Perform checksum validation" ) .add_property("src_spacetoken", &PyGfal2::GfaltParams::get_src_spacetoken, &PyGfal2::GfaltParams::set_src_spacetoken, "Source spacetoken (for protocols that support it)" ) .add_property("dst_spacetoken", &PyGfal2::GfaltParams::get_dst_spacetoken, &PyGfal2::GfaltParams::set_dst_spacetoken, "Destination spacetoken (for protocols that support it)" ) .add_property("nbstreams", &PyGfal2::GfaltParams::get_nbstream, &PyGfal2::GfaltParams::set_nbstream, "Number of streams" ) .add_property("overwrite", &PyGfal2::GfaltParams::get_overwrite, &PyGfal2::GfaltParams::set_overwrite, "If the destination file exists, overwrite it" ) .add_property("create_parent", &PyGfal2::GfaltParams::get_create_parent, &PyGfal2::GfaltParams::set_create_parent, "If the destination parent directory does not exist, create it" ) .add_property("tcp_buffersize", &PyGfal2::GfaltParams::get_tcp_buffersize, &PyGfal2::GfaltParams::set_tcp_buffersize, "TCP Buffersize" ) .add_property("strict_copy", &PyGfal2::GfaltParams::get_strict_copy, &PyGfal2::GfaltParams::set_strict_copy, "If set to True, do only copy, and ignore checksum, parent creation, overwrite..." ) .add_property("proxy_delegation", &PyGfal2::GfaltParams::get_proxy_delegation, &PyGfal2::GfaltParams::set_proxy_delegation, "Enable or disable TPC with proxy delegation (default enabled)" ) .add_property("scitag", &PyGfal2::GfaltParams::get_scitag, &PyGfal2::GfaltParams::set_scitag, "SciTag transfer flow" ) .add_property("evict", &PyGfal2::GfaltParams::get_evict, &PyGfal2::GfaltParams::set_evict, "Enable or disable source file eviction from disk buffer when the transfer is finished" ) .add_property("local_transfers", &PyGfal2::GfaltParams::get_local_transfers, &PyGfal2::GfaltParams::set_local_transfers, "Permission flag to enable or disable transfers via local streaming (default enabled)" ) .add_property("event_callback", &PyGfal2::GfaltParams::get_event_callback, &PyGfal2::GfaltParams::set_event_callback, "Callback for event handling" ) .add_property("monitor_callback", &PyGfal2::GfaltParams::get_monitor_callback, &PyGfal2::GfaltParams::set_monitor_callback, "Callback for performance monitoring (i.e. throughput)" ) .def("set_user_defined_checksum", &PyGfal2::GfaltParams::set_user_defined_checksum, "Specify manually the checksum type and value (optional)") .def("get_user_defined_checksum", &PyGfal2::GfaltParams::get_user_defined_checksum, "Get the user specified checksum") .def("set_checksum", &PyGfal2::GfaltParams::set_checksum, "Specify the checksum mode, type and value") .def("get_checksum", &PyGfal2::GfaltParams::get_checksum, "Get the user specified checksum mode, type and value") ; boost::python::scope().attr("transfer_parameters") = boost::python::scope().attr("TransferParameters"); // Callback types boost::python::enum_("event_side") .value("event_source", GFAL_EVENT_SOURCE) .value("event_destination", GFAL_EVENT_DESTINATION) .value("event_none", GFAL_EVENT_NONE); boost::python::class_("GfaltEvent") .add_property("side", &PyGfal2::GfaltEvent::side) .add_property("timestamp", &PyGfal2::GfaltEvent::timestamp) .add_property("stage", &PyGfal2::GfaltEvent::stage) .add_property("domain", &PyGfal2::GfaltEvent::domain) .add_property("description", &PyGfal2::GfaltEvent::description) .def("__str__", &PyGfal2::GfaltEvent::__str__) .def("__repr__", &PyGfal2::GfaltEvent::__str__); boost::python::scope().attr("gfalt_event") = boost::python::scope().attr("GfaltEvent"); // register exception boost::python::register_exception_translator(&gerror_exception_translator); // Create the Python type object for our extension class and define __init__ function. boost::python::class_, boost::noncopyable> ("FileType", "File descriptor", boost::python::init()) .def("read", &PyGfal2::File::read) .def("pread", &PyGfal2::File::pread) .def("read_bytes", &PyGfal2::File::read_bytes) .def("pread_bytes", &PyGfal2::File::pread_bytes) .def("write", &PyGfal2::File::write) .def("pwrite", &PyGfal2::File::pwrite) .def("lseek", &PyGfal2::File::lseek); register_shared_ptr(); boost::python::class_, boost::noncopyable> ("DirectoryType", "Directory descriptor", boost::python::init()) .def("read", &PyGfal2::Directory::read, "Reads a directory entry from the directory") .def("readpp", &PyGfal2::Directory::readpp, "Reads a directory entry and its stat information"); register_shared_ptr(); // Null log handler boost::python::class_ nullHandler("NullHandler"); nullHandler.def("emit", &PyGfal2::NullHandler::emit) .def("createLock", &PyGfal2::NullHandler::createLock) .def("acquire", &PyGfal2::NullHandler::acquire) .def("release", &PyGfal2::NullHandler::release) .def("setLevel", &PyGfal2::NullHandler::setLevel) .def("setFormatter", &PyGfal2::NullHandler::setFormatter) .def("addFilter", &PyGfal2::NullHandler::addFilter) .def("removeFilter", &PyGfal2::NullHandler::removeFilter) .def("filter", &PyGfal2::NullHandler::filter) .def("flush", &PyGfal2::NullHandler::flush) .def("close", &PyGfal2::NullHandler::close) .def("handle", &PyGfal2::NullHandler::handle) .def("handleError", &PyGfal2::NullHandler::handleError) .def("format", &PyGfal2::NullHandler::format) .def("emit", &PyGfal2::NullHandler::emit) .add_property("level", &PyGfal2::NullHandler::level) .add_property("filters", &PyGfal2::NullHandler::filters); gfal2Scope.attr("NullHandler") = nullHandler; // Register the null handler for gfal2 by default PyGfal2::logging_register_handler("gfal2", boost::python::object(nullHandler)()); } gfal2-bindings-v1.12.2/src/pyGIL.h000066400000000000000000000024211453603530000164730ustar00rootroot00000000000000/* * Copyright @ CERN, 2014-2015 * * 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. */ #ifndef PYGIL_H #define PYGIL_H #include #include namespace PyGfal2 { /** * GIL unlocker, used on stack */ class ScopedGILRelease { public: inline ScopedGILRelease(){ m_thread_state = PyEval_SaveThread(); } inline ~ScopedGILRelease(){ PyEval_RestoreThread(m_thread_state); m_thread_state = NULL; } private: PyThreadState * m_thread_state; }; /** * GIL locker, used on stack */ class ScopedGILLocker { public: inline ScopedGILLocker(){ gil_state = PyGILState_Ensure(); } inline ~ScopedGILLocker(){ PyGILState_Release(gil_state); } private: PyGILState_STATE gil_state; }; } #endif // PYGIL_H gfal2-bindings-v1.12.2/test/000077500000000000000000000000001453603530000155275ustar00rootroot00000000000000gfal2-bindings-v1.12.2/test/CMakeLists.txt000066400000000000000000000002171453603530000202670ustar00rootroot00000000000000if(FUNCTIONAL_TESTS) add_subdirectory (functionals) endif(FUNCTIONAL_TESTS) if(UNIT_TESTS) add_subdirectory (unit) endif(UNIT_TESTS) gfal2-bindings-v1.12.2/test/bench/000077500000000000000000000000001453603530000166065ustar00rootroot00000000000000gfal2-bindings-v1.12.2/test/bench/test-gfal-threaded.py000066400000000000000000000016001453603530000226210ustar00rootroot00000000000000 import threading import time import gfal2 import gfal import posix import sys class ThreadClass(threading.Thread): def __init__(self, func): self.func = func threading.Thread.__init__(self) def run(self): self.func() def gfal2_read(url): f= gfal2.file(url,'r') a= f.read(500) print a def gfal2_lstat(url): f = gfal2.lstat(url) print f def gfal1_lstat(url): f = gfal.gfal_lstat(url) print f def gfal1_read(url): f = gfal.gfal_open(url, posix.O_RDONLY) a = gfal.gfal_read(f, 500) gfal.gfal_close(f) print a[1] if __name__ == "__main__": t = [] r = range(int(sys.argv[3])) init_time = time.time() for i in r: exe = lambda : (globals()[sys.argv[2]](sys.argv[1])) t.append(ThreadClass( exe )) for i in r: t[i].start() for i in r: t[i].join() finish_time = time.time() print "exec time : %d"%(finish_time-init_time) gfal2-bindings-v1.12.2/test/functionals/000077500000000000000000000000001453603530000200545ustar00rootroot00000000000000gfal2-bindings-v1.12.2/test/functionals/CMakeLists.txt000066400000000000000000000001151453603530000226110ustar00rootroot00000000000000 add_test(all_functional_tests ${CMAKE_CURRENT_SOURCE_DIR}/exec_tests.sh) gfal2-bindings-v1.12.2/test/functionals/exec_tests.sh000077500000000000000000000002671453603530000225660ustar00rootroot00000000000000#!/bin/bash mydir=$(dirname $0) source $mydir/setup_env_test.sh MODULE_DIR=$(readlink -f `pwd`/../../src/) export PYTHONPATH=$MODULE_DIR:${PYTHONPATH} $mydir/test-gfal2-all.py gfal2-bindings-v1.12.2/test/functionals/libtest.sh000066400000000000000000000000011453603530000220450ustar00rootroot00000000000000 gfal2-bindings-v1.12.2/test/functionals/python_test_lib.py000066400000000000000000000005021453603530000236310ustar00rootroot00000000000000#!/usr/bin/python import sys import os def get_val(x): r = os.getenv(x) if(r == None): raise AttributeError(" Test parameter not set in env var : "+ x) return r def normalize_url(url): res = [] for i in range(len(url)-1): if(url[i] != '/' or url[i+1] != '/'): res.append(url[i]) return ''.join(res) gfal2-bindings-v1.12.2/test/functionals/setup_env_test.sh000077500000000000000000000006501453603530000234630ustar00rootroot00000000000000#!/bin/bash ## # export MY_VO="dteam" export TEST_SRM_BASE="root://dpmhead-rc.cern.ch/dpm/cern.ch/home/${MY_VO}/gfal2-tests/" #export TEST_SRM_BASE="srm://dpmhead-rc.cern.ch:8446/manager/srmv2.2?SFN=/dpm/cern.ch/home/${MY_VO}/gfal2-tests/" export TEST_FILE_CONTENT="Hello world" # lstat export TEST_SRM_LSTAT_VALID=$TEST_SRM_BASE/teststat0011 # open/read/write export TEST_SRM_READ_VALID=$TEST_SRM_BASE/testread0011 gfal2-bindings-v1.12.2/test/functionals/test-gfal2-all.py000077500000000000000000000004761453603530000231560ustar00rootroot00000000000000#!/usr/bin/python from test_gfal2_lstat import * from test_gfal2_stat import * from test_gfal2_open import * from test_gfal2_mkrmdir import * from test_gfal2_listdir import * from test_gfal2_rename import * from test_gfal2_link import * from test_gfal2_xattr import * if __name__ == '__main__': unittest.main() gfal2-bindings-v1.12.2/test/functionals/test_gfal2_copy.py000066400000000000000000000022131453603530000235100ustar00rootroot00000000000000#!/usr/bin/python import sys import gfal2 import time import errno import sys import unittest from python_test_lib import * import logging import threading log_level_value = logging.ERROR - (3 * 10) gfal2.set_verbose(gfal2.verbose_level.debug) root_logger = logging.getLogger() root_logger.setLevel(log_level_value) handler = logging.StreamHandler(sys.stderr) handler.setLevel(log_level_value) handler.setFormatter(logging.Formatter('%(levelname)s %(message)s')) if sys.stderr.isatty(): logging.addLevelName(logging.DEBUG, "\033[1;2m%-8s\033[1;m" % logging.getLevelName(logging.DEBUG)) logging.addLevelName(logging.INFO, "\033[1;34m%-8s\033[1;m" % logging.getLevelName(logging.INFO)) logging.addLevelName(logging.ERROR, "\033[1;31m%-8s\033[1;m" % logging.getLevelName(logging.ERROR)) logging.addLevelName(logging.WARNING, "\033[1;33m%-8s\033[1;m" % logging.getLevelName(logging.WARNING)) root_logger.addHandler(handler) context = gfal2.creat_context() par=context.transfer_parameters() par.timeout=60 t=threading.Thread(target=context.filecopy,args=[par,sys.argv[1], sys.argv[2]]) t.start() context.cancel() gfal2-bindings-v1.12.2/test/functionals/test_gfal2_link.py000066400000000000000000000022361453603530000235000ustar00rootroot00000000000000#!/usr/bin/python import sys import gfal2 import errno import time import stat import unittest from python_test_lib import * class Testgfal2_link(unittest.TestCase): def setUp(self): self.context = gfal2.creat_context() def define_symlink_from_file(self, url): return ''.join([url, "_link_", str(time.time())]) def link_valid(self, url): link = self.define_symlink_from_file(url) self.context.symlink(url, link) st = self.context.lstat(link) self.assertTrue(stat.S_ISLNK(st.st_mode), "must be a link") res = self.context.readlink(link) self.assertTrue( normalize_url(res) == normalize_url(url), "must be the same url %s %s"%(res,url)) self.context.unlink(link) # delete the link st= self.context.lstat(url) # original must still exist try: st= self.context.lstat(link) self.assertTrue( False, "must not reach here, this url must not be a existing one") except gfal2.GError, e: self.assertTrue( e.code() == errno.ENOENT, "must not reach here, this url must not be a existing one") def test_lstat_srm(self): pass gfal2-bindings-v1.12.2/test/functionals/test_gfal2_listdir.py000066400000000000000000000017411453603530000242150ustar00rootroot00000000000000#!/usr/bin/python import sys import gfal2 import time import unittest from python_test_lib import * class Testgfal2_listdir(unittest.TestCase): def setUp(self): self.context = gfal2.creat_context() def get_valid_parent_dir(self, base_url): v= get_val(base_url); a = ''.join([v, "/testlistdir_random_", str(time.time()),'/']) return a def get_list_child_dir(self, parent_dir, n): res = [] for i in range(n): tmp = ''.join([parent_dir, "file_test_", str(i)]) self.context.mkdir(tmp,0755) res.append(tmp) return res; def test_listdir_srm(self): p = self.get_valid_parent_dir("TEST_SRM_BASE") self.context.mkdir(p,0755) res = self.context.listdir(p) self.assertTrue( res == [], "test if dir is empty") l = self.get_list_child_dir(p, 10) size_dir = len(self.context.listdir(p)) self.assertTrue( size_dir == 10, "must be a dir of %d elem but is %d"%(10, size_dir)) gfal2-bindings-v1.12.2/test/functionals/test_gfal2_lstat.py000077500000000000000000000015101453603530000236670ustar00rootroot00000000000000#!/usr/bin/python import sys import gfal2 import unittest import errno from python_test_lib import * class Testgfal2_lstat(unittest.TestCase): def setUp(self): self.context = gfal2.creat_context() def lstat_valid(self, url): v= get_val(url); a= self.context.lstat(v); self.assertTrue(a.st_uid != 0 and a.st_gid != 0); def lstat_enoent(self, url): v= get_val(url); noent= ''.join([v, "_enoent"]) # create non enxisting file try: a= self.context.lstat(noent); self.assertTrue(False, " is a valdi stat, must not be"); except gfal2.GError, e: self.assertTrue(e.code() == errno.ENOENT, " must be a non existing file"); def test_lstat_srm(self): self.lstat_valid("TEST_SRM_LSTAT_VALID"); self.lstat_enoent("TEST_SRM_LSTAT_VALID"); gfal2-bindings-v1.12.2/test/functionals/test_gfal2_mkrmdir.py000066400000000000000000000016661453603530000242160ustar00rootroot00000000000000#!/usr/bin/python import sys import gfal2 import time import errno import unittest from python_test_lib import * class Testgfal2_mkrmdir(unittest.TestCase): def setUp(self): self.context = gfal2.creat_context() def mkrmdir_valid(self, url): try: self.context.rmdir(url); # must never be read self.assertTrue(False) except: pass self.context.mkdir(url,0775) self.context.rmdir(url) try: self.context.rmdir(url) self.assertTrue(False, " reach a non possible success for rmdir") except gfal2.GError, e: self.assertTrue(e.code() == errno.ENOENT, " error is not a non existing dir") def get_valid_file(self, base_url): v= get_val(base_url); cmpl= str(time.time()) return ''.join([v, "/testmkdir_random", cmpl]) def test_mkrmdir_srm(self): f = self.get_valid_file("TEST_SRM_BASE"); self.mkrmdir_valid(f) gfal2-bindings-v1.12.2/test/functionals/test_gfal2_open.py000066400000000000000000000040721453603530000235040ustar00rootroot00000000000000#!/usr/bin/python import sys import gfal2 import time import os import unittest from python_test_lib import * class Testgfal2_file(unittest.TestCase): def setUp(self): self.context = gfal2.creat_context() def file_valid(self, url, flags): v= get_val(url); a= self.context.file(v,flags); return a; def open_valid(self, url, flags): # same than file but with open func v= get_val(url); a= self.context.open(v,flags); return a; def test_read_simple_srm(self): a= self.file_valid("TEST_SRM_READ_VALID",'r'); rs = a.read(500).strip(); var = get_val("TEST_FILE_CONTENT"); self.assertTrue(rs == var, "must be %s but is %s."%(var, rs)); def test_read_compare_local(self): v = "file:///tmp/myfileread_" + str(time.time()) f1 = self.context.file(v,"w") var = os.urandom(1000) f1.write(var) del f1 self.context.chmod(v, 0755) f2 = self.context.file(v,"r") var2 = f2.read(2000); self.assertTrue(var == var2, " read must be the same than write first %s second %s"%(var,var2)) del f2 self.context.unlink(v) def test_read_compare_local_with_open(self): v = "file:///tmp/myfileread_with_open_" + str(time.time()) f1 = self.context.open(v,"w") var = os.urandom(1000) f1.write(var) del f1 self.context.chmod(v, 0755) f2 = self.context.open(v,"r") var2 = f2.read(2000); self.assertTrue(var == var2, " read must be the same than write first %s second %s"%(var,var2)) del f2 self.context.unlink(v) def test_read_compare_srm(self): v = "".join([get_val("TEST_SRM_BASE"), "/test_read_content_" ,str(time.time())]) f1 = self.context.file(v,"w") var = os.urandom(1000) f1.write(var) del f1 self.context.chmod(v, 0755) f2 = self.context.file(v,"r") var2 = f2.read(2000); self.assertTrue(var == var2, " read must be the same than write first %s second %s"%(var,var2)) del f2 self.context.unlink(v) gfal2-bindings-v1.12.2/test/functionals/test_gfal2_rename.py000066400000000000000000000014361453603530000240130ustar00rootroot00000000000000#!/usr/bin/python import sys import gfal2 import time import errno import unittest from python_test_lib import * class Testgfal2_rename_unlink(unittest.TestCase): def setUp(self): self.context = gfal2.creat_context() def get_filename_valid(self, base_url): v= get_val(base_url); return ''.join([v,"/testfile_rename_", str(time.time())] ); def test_rename_simple_srm(self): filename = self.get_filename_valid("TEST_SRM_BASE") filename2 = ''.join([filename,"_2"]) f = self.context.file(filename, 'w'); f.write("simple test file for rename") del f # write a simple file self.context.lstat(filename); # test if exist #gfal2.rename(filename, filename2) #gfal2.lstat(filename2) self.context.unlink(filename) gfal2-bindings-v1.12.2/test/functionals/test_gfal2_stat.py000066400000000000000000000014561453603530000235210ustar00rootroot00000000000000#!/usr/bin/python import sys import gfal2 import errno import unittest from python_test_lib import * class Testgfal2_stat(unittest.TestCase): def setUp(self): self.context = gfal2.creat_context() def stat_valid(self, url): v= get_val(url); a= self.context.stat(v); self.assertTrue(a.st_uid != 0 and a.st_gid != 0); def stat_enoent(self, url): v= get_val(url); noent= ''.join([v, "_enoent"]) # create non enxisting file try: a= self.context.stat(noent); self.assertTrue(False, " is a valdi stat, must not be"); except gfal2.GError, e: self.assertTrue(e.code() == errno.ENOENT, " must be a non existing file"); def test_lstat_srm(self): self.stat_valid("TEST_SRM_LSTAT_VALID"); self.stat_enoent("TEST_SRM_LSTAT_VALID"); gfal2-bindings-v1.12.2/test/functionals/test_gfal2_unlink.py000066400000000000000000000017711453603530000240460ustar00rootroot00000000000000#!/usr/bin/python import sys import gfal2 import time import errno import sys import unittest from python_test_lib import * import logging log_level_value = logging.ERROR - (3 * 10) gfal2.set_verbose(gfal2.verbose_level.debug) root_logger = logging.getLogger() root_logger.setLevel(log_level_value) handler = logging.StreamHandler(sys.stderr) handler.setLevel(log_level_value) handler.setFormatter(logging.Formatter('%(levelname)s %(message)s')) if sys.stderr.isatty(): logging.addLevelName(logging.DEBUG, "\033[1;2m%-8s\033[1;m" % logging.getLevelName(logging.DEBUG)) logging.addLevelName(logging.INFO, "\033[1;34m%-8s\033[1;m" % logging.getLevelName(logging.INFO)) logging.addLevelName(logging.ERROR, "\033[1;31m%-8s\033[1;m" % logging.getLevelName(logging.ERROR)) logging.addLevelName(logging.WARNING, "\033[1;33m%-8s\033[1;m" % logging.getLevelName(logging.WARNING)) root_logger.addHandler(handler) context = gfal2.creat_context() context.unlink(sys.argv[1]) gfal2-bindings-v1.12.2/test/functionals/test_gfal2_xattr.py000066400000000000000000000015321453603530000237030ustar00rootroot00000000000000#!/usr/bin/python import sys import gfal2 import errno import unittest from python_test_lib import * class Testgfal2_xattr(unittest.TestCase): def setUp(self): self.context = gfal2.creat_context() def getxattr_valid(self, url, key): return self.context.getxattr(url, key) def getxattr_enoent(self, url, key): try: self.context.getxattr(url, key) self.assertTrue(False, " is a valdi stat, must not be"); except gfal2.GError, e: self.assertTrue(e.code() == errno.ENOENT, " must be a non existing file"); def test_replicas_srm(self): v= self.getxattr_valid(get_val("TEST_SRM_READ_VALID"), "user.replicas"); self.assertTrue(v.find("rfio:") != -1, " must be a valid turl") self.getxattr_enoent(''.join([get_val("TEST_SRM_READ_VALID"), "_testenoent"]), "user.replicas"); gfal2-bindings-v1.12.2/test/unit/000077500000000000000000000000001453603530000165065ustar00rootroot00000000000000gfal2-bindings-v1.12.2/test/unit/CMakeLists.txt000066400000000000000000000002171453603530000212460ustar00rootroot00000000000000 add_test(create_install_all ${CMAKE_CURRENT_SOURCE_DIR}/unit_test_container.sh "python ${CMAKE_CURRENT_SOURCE_DIR}/creat_instance_all.py") gfal2-bindings-v1.12.2/test/unit/creat_instance_all.py000066400000000000000000000051071453603530000226750ustar00rootroot00000000000000#!/usr/bin/env python import gfal2 import unittest class unit_test_instance(unittest.TestCase): def test_creat_and_delete_instance(self): gfal2.set_verbose(gfal2.verbose_level.debug) context = gfal2.creat_context() del context def test_creat_and_delete_params(self): gfal2.set_verbose(gfal2.verbose_level.debug) context = gfal2.creat_context() t = context.transfer_parameters() self.assertGreater(t.timeout, 0) t.timeout = 10 self.assertEqual(t.timeout, 10) self.assertEqual(t.checksum_check, False) t.checksum_check = True self.assertEqual(t.checksum_check, True) self.assertEqual(t.src_spacetoken, "") t.src_spacetoken = "TOKENDTEAM" self.assertEqual(t.src_spacetoken, "TOKENDTEAM") def test_multiple_cred(self): context = gfal2.creat_context() cred_x509 = context.cred_new("X509_CERT", "/tmp/proxy") cred_bearer = context.cred_new("BEARER", "mytoken") context.cred_set("https://example.host/path/", cred_x509) context.cred_set("https://example.host/path/file", cred_bearer) (value, prefix) = context.cred_get("BEARER", "https://example.host/path/file") self.assertEqual((value, prefix), ("mytoken", "https://example.host/path/file")) (value, prefix) = context.cred_get("X509_CERT", "https://example.host/path/file") self.assertEqual((value, prefix), ("/tmp/proxy", "https://example.host/path/")) def test_cred_delete(self): context = gfal2.creat_context() cred = context.cred_new("BEARER", "mytoken") cred2 = context.cred_new("BEARER", "mytoken2") cred3 = context.cred_new("BEARER", "mytoken3") context.cred_set("https://example.host/path", cred) context.cred_set("https://example.host/path/", cred2) context.cred_set("https://example.host/path/file", cred3) (value, prefix) = context.cred_get("BEARER", "https://example.host/path/file.tpc") self.assertEqual((value, prefix), ("mytoken2", "https://example.host/path/")) context.cred_del("BEARER", "https://example.host/path/") (value, prefix) = context.cred_get("BEARER", "https://example.host/path/file.tpc") self.assertEqual((value, prefix), ("mytoken", "https://example.host/path")) context.cred_del("BEARER", "https://example.host/path") (value, prefix) = context.cred_get("BEARER", "https://example.host/path/file.tpc") self.assertEqual((value, prefix), ("", "")) if __name__ == '__main__': unittest.main() gfal2-bindings-v1.12.2/test/unit/unit_test_container.sh000077500000000000000000000004241453603530000231250ustar00rootroot00000000000000#!/bin/bash ## setup environment variables for tests # # consider that "make test" is executed in a build directory echo "build path $1" MODULE_DIR=$(readlink -f `pwd`/../../src/) export PYTHONPATH=$MODULE_DIR:${PYTHONPATH} echo "export python path $PYTHONPATH" $2