- fix version in gdlib.pc
- fix license handling
This commit is contained in:
parent
ff3f68b87a
commit
b2eefd98f3
26
gd.spec
26
gd.spec
@ -5,7 +5,7 @@
|
|||||||
Summary: A graphics library for quick creation of PNG or JPEG images
|
Summary: A graphics library for quick creation of PNG or JPEG images
|
||||||
Name: gd
|
Name: gd
|
||||||
Version: 2.1.1
|
Version: 2.1.1
|
||||||
Release: 1%{?prever}%{?short}%{?dist}
|
Release: 2%{?prever}%{?short}%{?dist}
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: http://libgd.bitbucket.org/
|
URL: http://libgd.bitbucket.org/
|
||||||
@ -16,6 +16,9 @@ Source0: libgd-%{version}-%{commit}.tgz
|
|||||||
%else
|
%else
|
||||||
Source0: https://bitbucket.org/libgd/gd-libgd/downloads/libgd-%{version}%{?prever:-%{prever}}.tar.xz
|
Source0: https://bitbucket.org/libgd/gd-libgd/downloads/libgd-%{version}%{?prever:-%{prever}}.tar.xz
|
||||||
%endif
|
%endif
|
||||||
|
# Missing in official archive, need for autoreconf
|
||||||
|
Source2: getver.pl
|
||||||
|
|
||||||
Patch1: gd-2.1.0-multilib.patch
|
Patch1: gd-2.1.0-multilib.patch
|
||||||
|
|
||||||
BuildRequires: freetype-devel
|
BuildRequires: freetype-devel
|
||||||
@ -30,6 +33,7 @@ BuildRequires: libXpm-devel
|
|||||||
BuildRequires: zlib-devel
|
BuildRequires: zlib-devel
|
||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
BuildRequires: libtool
|
BuildRequires: libtool
|
||||||
|
BuildRequires: perl
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -74,11 +78,10 @@ files for gd, a graphics library for creating PNG and JPEG graphics.
|
|||||||
%setup -q -n libgd-%{version}%{?prever:-%{prever}}
|
%setup -q -n libgd-%{version}%{?prever:-%{prever}}
|
||||||
%patch1 -p1 -b .mlib
|
%patch1 -p1 -b .mlib
|
||||||
|
|
||||||
# https://bitbucket.org/libgd/gd-libgd/issue/77
|
# Workaround for missing file
|
||||||
sed -e '/GD_VERSION_STRING/s/-alpha//' \
|
cp %{SOURCE2} config/getver.pl
|
||||||
-e '/GD_EXTRA_VERSION/s/alpha//' \
|
|
||||||
-i src/gd.h
|
: $(perl config/getver.pl)
|
||||||
grep VERSION src/gd.h
|
|
||||||
|
|
||||||
: regenerate autotool stuff
|
: regenerate autotool stuff
|
||||||
if [ -f configure ]; then
|
if [ -f configure ]; then
|
||||||
@ -112,8 +115,12 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/libgd.a
|
|||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
: Upstream test suite
|
||||||
make check
|
make check
|
||||||
|
|
||||||
|
: Check content of pkgconfig
|
||||||
|
grep %{version} $RPM_BUILD_ROOT%{_libdir}/pkgconfig/gdlib.pc
|
||||||
|
|
||||||
|
|
||||||
%post -p /sbin/ldconfig
|
%post -p /sbin/ldconfig
|
||||||
|
|
||||||
@ -121,7 +128,8 @@ make check
|
|||||||
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc COPYING
|
%{!?_licensedir:%global license %%doc}
|
||||||
|
%license COPYING
|
||||||
%{_libdir}/*.so.*
|
%{_libdir}/*.so.*
|
||||||
|
|
||||||
%files progs
|
%files progs
|
||||||
@ -137,6 +145,10 @@ make check
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Mar 23 2015 Remi Collet <remi@fedoraproject.org> - 2.1.1-2
|
||||||
|
- fix version in gdlib.pc
|
||||||
|
- fix license handling
|
||||||
|
|
||||||
* Wed Jan 14 2015 Jozef Mlich <jmlich@redhat.com> - 2.1.1-1
|
* Wed Jan 14 2015 Jozef Mlich <jmlich@redhat.com> - 2.1.1-1
|
||||||
- Update to 2.1.1 final
|
- Update to 2.1.1 final
|
||||||
Resolves: #1181972
|
Resolves: #1181972
|
||||||
|
42
getver.pl
Executable file
42
getver.pl
Executable file
@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
# Simple script to extract the version number parts from src/gd.h. If
|
||||||
|
# called with the middle word of the version macro, it prints the
|
||||||
|
# value of that macro. If called with no argument, it outputs a
|
||||||
|
# human-readable version string. This must be run in the project
|
||||||
|
# root. It is used by configure.ac and docs/naturaldocs/run_docs.sh.
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
my $key = shift;
|
||||||
|
my @version_parts = ();
|
||||||
|
|
||||||
|
open FH, "<src/gd.h" # old-style filehandle for max. portability
|
||||||
|
or die "Unable to open 'version.h' for reading.\n";
|
||||||
|
|
||||||
|
while(<FH>) {
|
||||||
|
next unless m{version605b5d1778};
|
||||||
|
next unless /^#define\s+GD_([A-Z0-9]+)_VERSION+\s+(\S+)/;
|
||||||
|
my ($lk, $lv) = ($1, $2);
|
||||||
|
if ($lk eq $key) {
|
||||||
|
chomp $lv;
|
||||||
|
$lv =~ s/"//g;
|
||||||
|
|
||||||
|
print $lv; # no newline
|
||||||
|
exit(0); # success!
|
||||||
|
}
|
||||||
|
|
||||||
|
push @version_parts, $lv if (!$key);
|
||||||
|
}
|
||||||
|
|
||||||
|
close(FH);
|
||||||
|
|
||||||
|
if (scalar @version_parts == 4) {
|
||||||
|
my $result = join(".", @version_parts[0..2]);
|
||||||
|
$result .= $version_parts[3];
|
||||||
|
$result =~ s/"//g;
|
||||||
|
print $result;
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
exit(1); # failure
|
Loading…
Reference in New Issue
Block a user