From 75b47a6298a2634b94b7c58a150890e61e008189 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 15 Nov 2021 00:37:27 +0300 Subject: [PATCH] Generate pkg-config file --- debian/vitastor-client-dev.install | 1 + rpm/vitastor-el7.spec | 1 + rpm/vitastor-el8.spec | 1 + src/CMakeLists.txt | 2 ++ src/vitastor.pc.in | 12 ++++++++++++ 5 files changed, 17 insertions(+) create mode 100644 src/vitastor.pc.in diff --git a/debian/vitastor-client-dev.install b/debian/vitastor-client-dev.install index e43b95cb9..0b2ea583f 100644 --- a/debian/vitastor-client-dev.install +++ b/debian/vitastor-client-dev.install @@ -1 +1,2 @@ usr/include +usr/lib/*/pkgconfig diff --git a/rpm/vitastor-el7.spec b/rpm/vitastor-el7.spec index 1ddd90c12..37671ab15 100644 --- a/rpm/vitastor-el7.spec +++ b/rpm/vitastor-el7.spec @@ -141,6 +141,7 @@ cp -r mon %buildroot/usr/lib/vitastor %files -n vitastor-client-devel %_includedir/vitastor_c.h +%_libdir/pkgconfig %files -n vitastor-fio diff --git a/rpm/vitastor-el8.spec b/rpm/vitastor-el8.spec index 5ed6d8e6c..9faabc90c 100644 --- a/rpm/vitastor-el8.spec +++ b/rpm/vitastor-el8.spec @@ -138,6 +138,7 @@ cp -r mon %buildroot/usr/lib/vitastor %files -n vitastor-client-devel %_includedir/vitastor_c.h +%_libdir/pkgconfig %files -n vitastor-fio diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 11737ada4..aeb3b3c02 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -158,6 +158,7 @@ add_executable(vitastor-cli target_link_libraries(vitastor-cli vitastor_client ) +configure_file(vitastor.pc.in vitastor.pc @ONLY) # vitastor-dump-journal add_executable(vitastor-dump-journal @@ -248,6 +249,7 @@ install( LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/vitastor.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) if (${WITH_FIO}) install(TARGETS fio_vitastor fio_vitastor_blk fio_vitastor_sec LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif (${WITH_FIO}) diff --git a/src/vitastor.pc.in b/src/vitastor.pc.in new file mode 100644 index 000000000..a98b146cd --- /dev/null +++ b/src/vitastor.pc.in @@ -0,0 +1,12 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ + + +Name: Vitastor +Description: Vitastor client library +Version: 0.6.8 +Libs: -L${libdir} -lvitastor_client +Cflags: -I${includedir} +