[packages/libharu] - updated to 2.4.3 (switched to cmake, soname changed) - added soname patch (set soname, upstream no
qboosh
qboosh at pld-linux.org
Wed Jan 18 18:44:35 CET 2023
commit 2f065dc661c8b80891299818b2032805b3dd0f59
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Jan 18 18:45:43 2023 +0100
- updated to 2.4.3 (switched to cmake, soname changed)
- added soname patch (set soname, upstream no longer does it after switch to cmake)
libharu-libdir.patch | 40 ++++++++++--------------------------
libharu-soname.patch | 11 ++++++++++
libharu.spec | 58 +++++++++++++++++++++++++++++++++-------------------
3 files changed, 59 insertions(+), 50 deletions(-)
---
diff --git a/libharu.spec b/libharu.spec
index 37de878..d34197c 100644
--- a/libharu.spec
+++ b/libharu.spec
@@ -1,19 +1,22 @@
+#
+# Conditional build:
+%bcond_without static_libs # static library
+
Summary: Library for generating PDF documents
Summary(pl.UTF-8): Biblioteka do generowania dokumentów PDF
Name: libharu
-Version: 2.3.0
-%define tagver RELEASE_%(echo %{version} | tr . _)
+Version: 2.4.3
Release: 1
License: MIT-like
Group: Libraries
-Source0: https://github.com/libharu/libharu/archive/%{tagver}/%{name}-%{version}.tar.gz
-# Source0-md5: 4f916aa49c3069b3a10850013c507460
+#Source0Download: https://github.com/libharu/libharu/releases
+Source0: https://github.com/libharu/libharu/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 7c0e7dc0dc400ad4d6602277bb532bc4
Patch0: %{name}-libdir.patch
+Patch1: %{name}-soname.patch
URL: http://libharu.org/
-BuildRequires: autoconf >= 2.60
-BuildRequires: automake
+BuildRequires: cmake >= 3.10
BuildRequires: libpng-devel
-BuildRequires: libtool
BuildRequires: zlib-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -70,27 +73,40 @@ Static Haru PDF library.
Statyczna biblioteka Haru PDF.
%prep
-%setup -q -n %{name}-%{tagver}
+%setup -q
%patch0 -p1
+%patch1 -p1
%build
-%{__libtoolize}
-%{__aclocal}
-%{__autoconf}
-%{__autoheader}
-%{__automake}
-# avoid detection of libpng14 and libpng12, use just libpng to get system default version
-%configure \
- ac_cv_lib_png14_png_init_io=no \
- ac_cv_lib_png12_png_init_io=no
+%if %{with static_libs}
+install -d build-static
+cd build-static
+%cmake .. \
+ -DBUILD_SHARED_LIBS=OFF
+
+%{__make}
+cd ..
+%endif
+
+install -d build
+cd build
+%cmake ..
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} install \
+%if %{with static_libs}
+%{__make} -C build-static install \
DESTDIR=$RPM_BUILD_ROOT
+%endif
+
+%{__make} -C build install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+# docs packaged as %doc + bindings sources
+%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/libharu
%clean
rm -rf $RPM_BUILD_ROOT
@@ -100,13 +116,13 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc README
-%attr(755,root,root) %{_libdir}/libhpdf-%{version}.so
+%doc CHANGES LICENSE README.md
+%attr(755,root,root) %{_libdir}/libhpdf.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libhpdf.so.2.4
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libhpdf.so
-%{_libdir}/libhpdf.la
%{_includedir}/hpdf*.h
%files static
diff --git a/libharu-libdir.patch b/libharu-libdir.patch
index ec5450d..c4e28f4 100644
--- a/libharu-libdir.patch
+++ b/libharu-libdir.patch
@@ -1,29 +1,11 @@
---- libharu-2.2.1/configure.in.orig 2010-11-22 10:59:56.000000000 +0100
-+++ libharu-2.2.1/configure.in 2011-11-20 07:14:34.760591648 +0100
-@@ -240,7 +240,6 @@
- fi
-
- AC_MSG_RESULT([$ZLIB_DIR])
-- LDFLAGS="$LDFLAGS -L$ZLIB_DIR/$LIBDIR"
- CFLAGS="$CFLAGS -I$ZLIB_DIR/include"
- LIBS="$LIBS -lz"
-
-@@ -291,13 +290,15 @@
- fi
-
- AC_MSG_RESULT([$LIBPNG_DIR])
-- LDFLAGS="$LDFLAGS -L$LIBPNG_DIR/$LIBDIR"
- CFLAGS="$CFLAGS -I$LIBPNG_DIR/include"
-- LIBS="$LIBS -lpng"
-
-- AC_CHECK_LIB([png], [png_init_io], [], [
-+ AC_CHECK_LIB([png14], [png_init_io], [LIBS="$LIBS -lpng14"], [
-+ AC_CHECK_LIB([png12], [png_init_io], [LIBS="$LIBS -lpng12"], [
-+ AC_CHECK_LIB([png], [png_init_io], [LIBS="$LIBS -lpng"], [
- AC_MSG_ERROR([png_init_io() is missing, check config.log for more details])
- ])
-+ ])
-+ ])
- fi
- dnl }}}
-
+--- libharu-2.4.3/cmake/modules/haru.cmake.orig 2022-10-14 12:04:02.000000000 +0200
++++ libharu-2.4.3/cmake/modules/haru.cmake 2023-01-18 17:11:00.438078254 +0100
+@@ -28,7 +28,7 @@ check_include_files(unistd.h LIBHPDF_HAV
+ # On windows systems the math library is not separated so do not specify
+ # it unless you are on a non-windows system.
+ if(NOT WIN32)
+- find_library(MATH_LIB NAMES m PATHS /usr/local/lib /usr/lib)
++ find_library(MATH_LIB NAMES m)
+ if(NOT MATH_LIB)
+ message(FATAL_ERROR "Cannot find required math library")
+ endif(NOT MATH_LIB)
diff --git a/libharu-soname.patch b/libharu-soname.patch
new file mode 100644
index 0000000..db58aa6
--- /dev/null
+++ b/libharu-soname.patch
@@ -0,0 +1,11 @@
+--- libharu-2.4.3/src/CMakeLists.txt.orig 2022-10-14 12:04:02.000000000 +0200
++++ libharu-2.4.3/src/CMakeLists.txt 2023-01-18 17:15:53.343158117 +0100
+@@ -73,6 +73,8 @@ set(
+ # create hpdf library
+ # =======================================================================
+ add_library(hpdf ${LIBHPDF_SRCS})
++set_target_properties(hpdf PROPERTIES VERSION ${HPDF_MAJOR_VERSION}.${HPDF_MINOR_VERSION}.${HPDF_BUGFIX_VERSION} SOVERSION ${HPDF_MAJOR_VERSION}.${HPDF_MINOR_VERSION})
++
+ if (PNG_FOUND)
+ include_directories (${PNG_INCLUDE_DIRS})
+ target_link_libraries (hpdf ${PNG_LIBRARIES})
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libharu.git/commitdiff/2f065dc661c8b80891299818b2032805b3dd0f59
More information about the pld-cvs-commit
mailing list