Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XRootD: Update to version 5.4.1 and build with scitokens-cpp #7652

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 34 additions & 0 deletions scitokens-cpp.patch
@@ -0,0 +1,34 @@
--- CMakeLists.txt.orig 2021-09-14 22:52:06.000000000 +0200
+++ CMakeLists.txt 2022-02-01 11:46:11.698151800 +0100
@@ -25,27 +25,23 @@
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")


-if( APPLE )
-
find_package( OpenSSL REQUIRED )
find_package( Sqlite3 REQUIRED )
+
+if( APPLE )
+
set(LIBCRYPTO_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
set(LIBCRYPTO_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
set(CMAKE_MACOSX_RPATH ON)

elseif( UNIX )

-include (FindPkgConfig)
-pkg_check_modules(LIBCRYPTO REQUIRED libcrypto)
-pkg_check_modules(OPENSSL REQUIRED openssl)
-pkg_check_modules(SQLITE REQUIRED sqlite3)
-
# pkg_check_modules fails to return an absolute path on RHEL7. Set the
# link directories accordingly.
link_directories(${OPENSSL_LIBRARY_DIRS} ${LIBCRYPTO_LIBRARY_DIRS})
endif()

-include_directories( "${PROJECT_SOURCE_DIR}" ${JWT_CPP_INCLUDES} ${CURL_INCLUDES} ${OPENSSL_INCLUDE_DIRS} ${LIBCRYPTO_INCLUDE_DIRS} ${SQLITE_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} )
+include_directories( "${PROJECT_SOURCE_DIR}" ${JWT_CPP_INCLUDES} ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS} ${LIBCRYPTO_INCLUDE_DIRS} ${SQLITE_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} )

add_library(SciTokens SHARED src/scitokens.cpp src/scitokens_internal.cpp src/scitokens_cache.cpp)
target_link_libraries(SciTokens ${OPENSSL_LIBRARIES} ${LIBCRYPTO_LIBRARIES} ${CURL_LIBRARIES} ${SQLITE_LIBRARIES} ${UUID_LIBRARIES})
23 changes: 23 additions & 0 deletions scitokens-cpp.spec
@@ -0,0 +1,23 @@
### RPM external scitokens-cpp 0.7.0
Source: https://github.com/scitokens/%{n}/archive/refs/tags/v%{realversion}.tar.gz

BuildRequires: cmake gmake
Requires: libuuid curl sqlite
Patch0: scitokens-cpp

%prep
%setup -n %{n}-%{realversion}

%patch0 -p0

%build
rm -rf ../build; mkdir ../build; cd ../build
cmake ../%{n}-%{realversion} \
-DCMAKE_INSTALL_PREFIX=%{i} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${CURL_ROOT};${LIBUUID_ROOT};${SQLITE_ROOT}"

%install
cd ../build
make %{makeprocesses}
make install
11 changes: 11 additions & 0 deletions scram-tools.file/tools/scitokens-cpp/scitokens-cpp.xml
@@ -0,0 +1,11 @@
<tool name="scitokens-cpp" version="@TOOL_VERSION@">
<lib name="SciTokens"/>
<client>
<environment name="LIBSCITOKENS_BASE" default="@TOOL_ROOT@"/>
<environment name="LIBDIR" default="$LIBSCITOKENS_BASE/lib64"/>
<environment name="INCLUDE" default="$LIBSCITOKENS_BASE/include"/>
</client>
<use name="sqlite"/>
<use name="libuuid"/>
<use name="curl"/>
</tool>
1 change: 1 addition & 0 deletions scram-tools.file/tools/xrootd/xrootd.xml
Expand Up @@ -10,4 +10,5 @@
<runtime name="PATH" value="$XROOTD_BASE/bin" type="path"/>
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>
<use name="root_cxxdefaults"/>
<use name="scitokens-cpp"/>
</tool>
10 changes: 6 additions & 4 deletions xrootd.spec
@@ -1,16 +1,17 @@
### RPM external xrootd 5.3.1
### RPM external xrootd 5.4.1
## INITENV +PATH LD_LIBRARY_PATH %i/lib64
## INITENV +PATH PYTHON3PATH %{i}/${PYTHON3_LIB_SITE_PACKAGES}

%define tag v%{realversion}
%define branch stable-5.3.x
%define branch master
%define github_user xrootd
Source: git+https://github.com/%github_user/xrootd.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz

BuildRequires: cmake autotools
BuildRequires: cmake gmake autotools
Requires: zlib
Requires: python3
Requires: libxml2
Requires: scitokens-cpp

%define soext so
%ifarch darwin
Expand Down Expand Up @@ -39,7 +40,8 @@ cmake .. \
-DCMAKE_CXX_FLAGS="-I${LIBUUID_ROOT}/include" \
-DUUID_INCLUDE_DIR="${LIBUUID_ROOT}/include" \
-DUUID_LIBRARY="${LIBUUID_ROOT}/lib64/libuuid.%{soext}" \
-DCMAKE_PREFIX_PATH="${PYTHON3_ROOT};${LIBXML2_ROOT};${LIBUUID_ROOT}"
-DSCITOKENS_CPP_DIR="${SCITOKENS_CPP_ROOT}" \
-DCMAKE_PREFIX_PATH="${PYTHON3_ROOT};${LIBXML2_ROOT};${LIBUUID_ROOT};${SCITOKENS_CPP_ROOT}"

make %makeprocesses VERBOSE=1
make install
Expand Down