Commit f1d409b3 authored by Ghislain MARY's avatar Ghislain MARY

Improve RPM packaging for hiredis.

parent 9bc7c9e4
############################################################################
# hiredis.cmake
# Copyright (C) 2015 Belledonne Communications, Grenoble France
# Copyright (C) 2015-2018 Belledonne Communications, Grenoble France
#
############################################################################
#
......@@ -22,12 +22,13 @@
lcb_git_repository("https://github.com/redis/hiredis.git")
lcb_external_source_paths("externals/hiredis")
lcb_patch_command("COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/hiredis/CMakeLists.txt" "<SOURCE_DIR>")
lcb_patch_command("COMMAND" "${CMAKE_COMMAND}" "-E" "make_directory" "<SOURCE_DIR>/build/")
lcb_patch_command("COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/hiredis/build/CMakeLists.txt" "<SOURCE_DIR>/build/")
lcb_package_source(YES)
lcb_spec_file("hiredis.spec")
lcb_dependencies(bctoolbox)
lcb_spec_file("hiredis.spec")
lcb_patch_command("COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/hiredis/CMakeLists.txt" "<SOURCE_DIR>")
lcb_patch_command("COMMAND" "${CMAKE_COMMAND}" "-E" "make_directory" "<SOURCE_DIR>/build/")
lcb_patch_command("COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/hiredis/build/CMakeLists.txt" "<SOURCE_DIR>/build/")
lcb_patch_command("COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/hiredis/build/hiredis.spec.cmake" "<SOURCE_DIR>/build/")
......@@ -46,7 +46,8 @@ endif()
message("-- Package file name is ${CPACK_PACKAGE_FILE_NAME}" )
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hiredis.spec.cmake ${CMAKE_CURRENT_SOURCE_DIR}/../hiredis.spec)
bc_generate_rpm_specfile("hiredis.spec.cmake" "${PROJECT_SOURCE_DIR}/hiredis.spec")
include(CPack)
# -*- rpm-spec -*-
%define _prefix @CMAKE_INSTALL_PREFIX@
%define pkg_name %{?_with_bc:bc-hiredis}%{!?_with_bc:hiredis}
%{?_with_bc: %define _prefix /opt/belledonne-communications}
# re-define some directories for older RPMBuild versions which don't. This messes up the doc/ dir
# taken from https://fedoraproject.org/wiki/Packaging:RPMMacros?rd=Packaging/RPMMacros
%define _datarootdir %{_prefix}/share
......@@ -13,7 +13,7 @@
%define build_number_ext -%{build_number}
%endif
Name: %{pkg_name}
Name: @CPACK_PACKAGE_NAME@
Version: @PROJECT_VERSION@
Release: %{build_number}%{?dist}
Summary: Minimalistic C client library for Redis
......@@ -44,7 +44,7 @@ developing applications that use %{name}.
%setup -q -n %{name}-%{version}%{?build_number_ext}
%build
%{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix}
%{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@
make %{?_smp_mflags}
%install
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment