Skip to content

Commit

Permalink
Update specs; add patch
Browse files Browse the repository at this point in the history
  • Loading branch information
iarspider committed Feb 1, 2022
1 parent 5175678 commit 64b9920
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 6 deletions.
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})
22 changes: 19 additions & 3 deletions scitokens-cpp.spec
@@ -1,16 +1,32 @@
### RPM external scitokens-cpp 0.6.3
Source: https://github.com/scitokens/scitokens-cpp/releases/download/v%{realversion}/%{n}-%{realversion}.tar.gz

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

%define soext so
%ifarch darwin
%define soext dylib
%endif

%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_BUILD_TYPE=Release \
-DCURL_INCLUDE_DIR="${CURL_ROOT}/include" \
-DCURL_LIBRARY="${CURL_ROOT}/lib/libcurl.%{soext}" \
-DUUID_INCLUDE_DIR="${LIBUUID_ROOT}/include" \
-DUUID_LIBRARY="${LIBUUID_ROOT}/lib64/libuuid.%{soext}" \
-DSQLITE3_INCLUDE_DIR="${SQLITE_ROOT}/include" \
-DSQLITE3_LIBRARY="${SQLITE_ROOT}/lib/libsqlite3.%{soext}"

%install
cd ../build
make %{makeprocesses}
Expand Down
5 changes: 2 additions & 3 deletions xrootd.spec
Expand Up @@ -40,9 +40,8 @@ cmake .. \
-DCMAKE_CXX_FLAGS="-I${LIBUUID_ROOT}/include" \
-DUUID_INCLUDE_DIR="${LIBUUID_ROOT}/include" \
-DUUID_LIBRARY="${LIBUUID_ROOT}/lib64/libuuid.%{soext}" \
-DSciTokensCpp_INCLUDE_DIR="${SCITOKENSCPP_ROOT}/include" \
-DSciTokensCpp_LIBRARY="${SCITOKENSCPP_ROOT}/lib" \
-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

0 comments on commit 64b9920

Please sign in to comment.