diff --git a/scitokens-cpp.patch b/scitokens-cpp.patch
new file mode 100644
index 00000000000..1e7779e7b2b
--- /dev/null
+++ b/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})
diff --git a/scitokens-cpp.spec b/scitokens-cpp.spec
new file mode 100644
index 00000000000..1b7fba27211
--- /dev/null
+++ b/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
diff --git a/scram-tools.file/tools/scitokens-cpp/scitokens-cpp.xml b/scram-tools.file/tools/scitokens-cpp/scitokens-cpp.xml
new file mode 100644
index 00000000000..33391e39de8
--- /dev/null
+++ b/scram-tools.file/tools/scitokens-cpp/scitokens-cpp.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/scram-tools.file/tools/xrootd/xrootd.xml b/scram-tools.file/tools/xrootd/xrootd.xml
index e54184aef2a..b096aefd6cb 100644
--- a/scram-tools.file/tools/xrootd/xrootd.xml
+++ b/scram-tools.file/tools/xrootd/xrootd.xml
@@ -10,4 +10,5 @@
+
diff --git a/xrootd.spec b/xrootd.spec
index 9b1ec1aa581..61e60b80d72 100644
--- a/xrootd.spec
+++ b/xrootd.spec
@@ -1,4 +1,4 @@
-### RPM external xrootd 5.3.1
+### RPM external xrootd 5.4.0
## INITENV +PATH LD_LIBRARY_PATH %i/lib64
## INITENV +PATH PYTHON3PATH %{i}/${PYTHON3_LIB_SITE_PACKAGES}
@@ -7,10 +7,11 @@
%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
@@ -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