Navigation Menu

Skip to content

Commit

Permalink
[kf5-calendarcore] Add pkgconfig packaging.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcaliste committed May 14, 2019
1 parent 3bd137a commit 6251c7a
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
52 changes: 52 additions & 0 deletions rpm/0004-Add-pkgconfig-packaging.patch
@@ -0,0 +1,52 @@
From 01359f9717c3d1df71165fa90faa766df6fa27f8 Mon Sep 17 00:00:00 2001
From: Damien Caliste <dcaliste@free.fr>
Date: Tue, 14 May 2019 13:30:00 +0200
Subject: [PATCH] Add pkgconfig packaging.

---
CMakeLists.txt | 11 +++++++++++
KF5CalendarCore.pc.in | 12 ++++++++++++
2 files changed, 23 insertions(+)
create mode 100644 KF5CalendarCore.pc.in

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 727c611dc..8874f17e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -92,4 +92,15 @@ install(FILES

install(FILES kcalcore.renamecategories kcalcore.categories DESTINATION ${KDE_INSTALL_CONFDIR})

+# generate pkg-config file
+set(DEST_DIR "${CMAKE_INSTALL_PREFIX}")
+set(VERSION "${KF5_VERSION}")
+set(COMMA_SEAPARATED_LIST "KF5CalendarCore")
+
+foreach(LIB ${COMMA_SEAPARATED_LIST})
+ set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}")
+endforeach()
+
+CONFIGURE_FILE("KF5CalendarCore.pc.in" "KF5CalendarCore.pc" @ONLY)
+
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/KF5CalendarCore.pc.in b/KF5CalendarCore.pc.in
new file mode 100644
index 000000000..c8e2f65b9
--- /dev/null
+++ b/KF5CalendarCore.pc.in
@@ -0,0 +1,12 @@
+prefix=@DEST_DIR@
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include/KF5/KCalCore
+
+Name: kf5-calendarcore
+Description: A library for handling vCAL objects
+Version: @VERSION@
+
+Requires: Qt5Core Qt5Gui
+Libs: -L${libdir} @PRIVATE_LIBS@
+Cflags: -I${includedir}
--
2.17.1

7 changes: 7 additions & 0 deletions rpm/kf5-calendarcore.spec
Expand Up @@ -18,6 +18,7 @@ BuildRequires: extra-cmake-modules >= 5.44.0
Patch1: 0001-Use-UTC-times-when-calculating-the-transition-dates-.patch
Patch2: 0002-Create-second-type-duration-for-0-delay-durations-in.patch
Patch3: 0003-Adjust-for-lower-Qt-versions.patch
Patch4: 0004-Add-pkgconfig-packaging.patch

%description
KDE Framework calendar core library
Expand All @@ -37,15 +38,20 @@ applications using %{name}
%patch1 -d upstream -p1
%patch2 -d upstream -p1
%patch3 -d upstream -p1
%patch4 -d upstream -p1

%build
if [ ! -d upstream/build ] ; then mkdir upstream/build ; fi ; cd upstream/build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make %{?_smp_mflags}

%define pkg_config_dir %{buildroot}/usr/lib/pkgconfig/

%install
cd upstream/build
make install DESTDIR=%{buildroot}
mkdir -p %{pkg_config_dir}
install KF5CalendarCore.pc %{pkg_config_dir}

%post -p /sbin/ldconfig

Expand All @@ -62,3 +68,4 @@ make install DESTDIR=%{buildroot}
%{_datadir}/qt5
%{_libdir}/cmake/KF5CalendarCore
%{_libdir}/libKF5CalendarCore.so
%{_libdir}/pkgconfig

0 comments on commit 6251c7a

Please sign in to comment.