From 99b3f9a9585f20a0634733f7145d6fbb8ce2e2a6 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Sun, 18 Aug 2024 00:39:53 +0800 Subject: [PATCH] cleanup spec --- gd.spec | 67 ++++++++++++++++++-------------------------- getlib.sh | 42 --------------------------- libgd-iostream.patch | 35 +++++++++++++++++++++++ 3 files changed, 62 insertions(+), 82 deletions(-) delete mode 100644 getlib.sh create mode 100644 libgd-iostream.patch diff --git a/gd.spec b/gd.spec index 28ae059..517061c 100644 --- a/gd.spec +++ b/gd.spec @@ -1,17 +1,26 @@ Name: gd Version: 2.3.3 -Release: 4 +Release: 5 Summary: A graphics library for quick creation of PNG or JPEG images -License: MIT -URL: http://libgd.github.io/ +License: GD +URL: https://libgd.github.io/ Source0: https://github.com/libgd/libgd/releases/download/gd-%{version}/libgd-%{version}.tar.xz -# Missing, temporary workaround, fixed upstream for next version -Source1: https://raw.githubusercontent.com/libgd/libgd/gd-%{version}/config/getlib.sh -Patch0: libgd-flip.patch - -BuildRequires: freetype-devel fontconfig-devel gettext-devel libjpeg-devel libpng-devel libtiff-devel libwebp-devel -BuildRequires: libX11-devel libXpm-devel zlib-devel pkgconfig libtool perl-interpreter perl-generators liberation-sans-fonts +# Needed by PHP see https://github.com/libgd/libgd/pull/766 +Patch0: libgd-flip.patch +# Missing header see https://github.com/libgd/libgd/pull/767 +Patch1: libgd-iostream.patch + +BuildRequires: gcc make +BuildRequires: autoconf automake libtool +BuildRequires: pkgconfig(fontconfig) +BuildRequires: pkgconfig(freetype2) >= 9.8.3 +BuildRequires: pkgconfig(libjpeg) +BuildRequires: pkgconfig(libpng) +BuildRequires: pkgconfig(libtiff-4) +BuildRequires: pkgconfig(libwebp) >= 0.2.0 +BuildRequires: pkgconfig(xpm) +BuildRequires: pkgconfig(zlib) %description The gd graphics library allows your code to quickly draw images complete with lines, arcs, text, @@ -21,9 +30,7 @@ although it can be used with any standalone application! %package devel Summary: The development libraries and header files for gd -Requires: %{name}%{?_isa} = %{version}-%{release} freetype-devel%{?_isa} fontconfig-devel%{?_isa} libjpeg-devel%{?_isa} -Requires: libpng-devel%{?_isa} libtiff-devel%{?_isa} libwebp-devel%{?_isa} libX11-devel%{?_isa} -Requires: libXpm-devel%{?_isa} zlib-devel%{?_isa} +Requires: %{name}%{?_isa} = %{version}-%{release} %package progs Requires: %{name}%{?_isa} = %{version}-%{release} @@ -40,19 +47,10 @@ graphics library for creating PNG and JPEG images. %prep %autosetup -n libgd-%{version} -p1 -install -m 0755 %{SOURCE1} config/ - -: $(perl config/getver.pl) - -: regenerate autotool stuff -if [ -f configure ]; then - libtoolize --copy --force - autoreconf -vif -else - ./bootstrap.sh -fi %build +autoreconf -fi + CFLAGS="$RPM_OPT_FLAGS -DDEFAULT_FONTPATH='\"\ /usr/share/fonts/bitstream-vera:\ /usr/share/fonts/dejavu:\ @@ -70,32 +68,20 @@ export CFLAGS="$CFLAGS -msse -mfpmath=sse" export CFLAGS="$CFLAGS -ffp-contract=off" %endif -%configure \ - --with-tiff=%{_prefix} \ - --disable-rpath +%configure --disable-static %make_build %install %make_install +%delete_la %check export TMPDIR=/tmp -make check - -grep %{version} $RPM_BUILD_ROOT%{_libdir}/pkgconfig/gdlib.pc - -%ldconfig_scriptlets - -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig +%make_build check %files -%defattr(-,root,root) -%{!?_licensedir:%global license %%doc} %license COPYING %{_libdir}/*.so.* -%exclude %{_bindir}/gdlib-config %files progs %{_bindir}/* @@ -104,10 +90,11 @@ grep %{version} $RPM_BUILD_ROOT%{_libdir}/pkgconfig/gdlib.pc %{_includedir}/* %{_libdir}/*.so %{_libdir}/pkgconfig/gdlib.pc -%exclude %{_libdir}/libgd.la -%exclude %{_libdir}/libgd.a %changelog +* Sat Aug 17 2024 Funda Wang - 2.3.3-5 +- cleanup spec + * Mon Jun 05 2023 laokz - 2.3.3-4 - fix build error for riscv64 diff --git a/getlib.sh b/getlib.sh deleted file mode 100644 index 5070e30..0000000 --- a/getlib.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -GETVER="${0%/*}/getver.sh" -GDLIB_MAJOR=$("${GETVER}" MAJOR) -GDLIB_MINOR=$("${GETVER}" MINOR) -GDLIB_REVISION=$("${GETVER}" RELEASE) - -# Dynamic library version information -# See http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info - -GDLIB_LT_CURRENT=3 -# This is the version where the soname (current above) changes. We use it -# to reset the revision base back to zero. It's a bit of a pain, but some -# systems restrict the revision range below to [0..255] (like OS X). -GDLIB_PREV_MAJOR=2 -GDLIB_PREV_MINOR=2 -# This isn't 100% correct, but it tends to be a close enough approximation -# for how we manage the codebase. It's rare to do a release that doesn't -# modify the library since this project is centered around the library. -GDLIB_LT_REVISION=$(( ((GDLIB_MAJOR - GDLIB_PREV_MAJOR) << 6) | ((GDLIB_MINOR - GDLIB_PREV_MINOR) << 3) | GDLIB_REVISION )) -GDLIB_LT_AGE=0 - -# The first three fields we feed into libtool and the OS target determines how -# they get used. The last two fields we feed into cmake. We use the same rules -# as Linux SONAME versioning in libtool, but cmake should handle it for us. -case $1 in -CURRENT) - printf '%s' "${GDLIB_LT_CURRENT}" - ;; -REVISION) - printf '%s' "${GDLIB_LT_REVISION}" - ;; -AGE) - printf '%s' "${GDLIB_LT_AGE}" - ;; -VERSION) - printf '%s' "$(( GDLIB_LT_CURRENT - GDLIB_LT_AGE )).${GDLIB_LT_AGE}.${GDLIB_LT_REVISION}" - ;; -SONAME) - printf '%s' "$(( GDLIB_LT_CURRENT - GDLIB_LT_AGE ))" - ;; -esac diff --git a/libgd-iostream.patch b/libgd-iostream.patch new file mode 100644 index 0000000..c80b3ec --- /dev/null +++ b/libgd-iostream.patch @@ -0,0 +1,35 @@ +From 01bcbdcae35b90de082012e639094c711a7aa2b3 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Mon, 13 Sep 2021 15:05:18 +0200 +Subject: [PATCH] install missing header, used by gdpp.h + +--- + src/CMakeLists.txt | 1 + + src/Makefile.am | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 3839bc78..c1eea100 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -194,6 +194,7 @@ install(FILES + gdfontt.h + gdfx.h + gdpp.h ++ gd_io_stream.h + DESTINATION include) + + CONFIGURE_FILE(../config/gdlib.pc.cmake gdlib.pc @ONLY) +diff --git a/src/Makefile.am b/src/Makefile.am +index dbe9243c..c8c779f1 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -52,7 +52,7 @@ EXTRA_DIST = \ + msinttypes/inttypes.h \ + msinttypes/stdint.h + +-include_HEADERS = gd.h gdfx.h gd_io.h gdcache.h gdfontg.h gdfontl.h gdfontmb.h gdfonts.h gdfontt.h gd_color_map.h gd_errors.h gdpp.h ++include_HEADERS = gd.h gdfx.h gd_io.h gdcache.h gdfontg.h gdfontl.h gdfontmb.h gdfonts.h gdfontt.h gd_color_map.h gd_errors.h gdpp.h gd_io_stream.h + + lib_LTLIBRARIES = libgd.la + -- Gitee