[pngquant/el5: 2/2] new upstream version 2.0.0 (#989991) fixes FTBFS in F20 / rawhide (#992807)

Björn Esser besser82 at fedoraproject.org
Mon Sep 2 10:47:56 UTC 2013


commit 166824d1e6937237f1a867f9b40def09fa333f44
Author: Björn Esser <bjoern.esser at gmail.com>
Date:   Thu Aug 29 10:12:33 2013 +0200

    new upstream version 2.0.0 (#989991)
    fixes FTBFS in F20 / rawhide (#992807)

 .gitignore                          |    4 +-
 pngquant-2.0.0_fix-Makefile.patch   |  101 ++++++++++++++++++++++++++++++
 pngquant.spec                       |  116 ++++++++++++++++++++++++-----------
 pngquant_respect_system_flags.patch |   37 -----------
 sources                             |    2 +-
 5 files changed, 185 insertions(+), 75 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 0792d75..4a406bf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
 *~
-/pngquant-1.8.3-src.tar.bz2
+*.rpm
+*.tar*
+results_*/
diff --git a/pngquant-2.0.0_fix-Makefile.patch b/pngquant-2.0.0_fix-Makefile.patch
new file mode 100644
index 0000000..511c85e
--- /dev/null
+++ b/pngquant-2.0.0_fix-Makefile.patch
@@ -0,0 +1,101 @@
+Index: pngquant-2.0.0/Makefile
+===================================================================
+--- pngquant-2.0.0.orig/Makefile
++++ pngquant-2.0.0/Makefile
+@@ -13,13 +13,18 @@ BINPREFIX = $(PREFIX)/bin
+ CUSTOMLIBPNG ?= ../libpng
+ CUSTOMZLIB ?= ../zlib
+ 
+-CFLAGSOPT ?= -DNDEBUG -O3 -fstrict-aliasing -ffast-math -funroll-loops -fomit-frame-pointer -ffinite-math-only
++CFLAGS = $(CFLAGSOPT) $(shell echo $$CFLAGS)
+ 
+-CFLAGS ?= -Wall -Wno-unknown-pragmas -I. -I$(CUSTOMLIBPNG) -I$(CUSTOMZLIB) -I/usr/local/include/ -I/usr/include/ -I/usr/X11/include/ $(CFLAGSOPT)
+-CFLAGS += -std=c99 $(CFLAGSADD)
+-
+-LDFLAGS ?= -L$(CUSTOMLIBPNG) -L$(CUSTOMZLIB) -L/usr/local/lib/ -L/usr/lib/ -L/usr/X11/lib/
+-LDFLAGS += -lpng -lz -lm lib/libimagequant.a -lm $(LDFLAGSADD)
++CFLAGSOPT ?= -DNDEBUG -O3 -fstrict-aliasing -ffast-math -funroll-loops
++CFLAGSOPT += -fomit-frame-pointer -ffinite-math-only -Wall -Wno-unknown-pragmas
++CFLAGSOPT += -I. -I$(CUSTOMLIBPNG) -I$(CUSTOMZLIB) -I/usr/local/include/
++CFLAGSOPT += -I/usr/include/ -I/usr/X11/include/ -std=c99 $(CFLAGSADD)
++
++LDFLAGS ?= $(shell echo $$LDFLAGS)
++
++LDFLAGSOPT ?= -L$(CUSTOMLIBPNG) -L$(CUSTOMZLIB) -L/usr/local/lib/ -L/usr/lib/
++LDFLAGSOPT += -L/usr/X11/lib/ -L$(shell pwd)/lib -limagequant -lpng -lz -lm
++LDFLAGSOPT += $(LDFLAGSADD)
+ 
+ OBJS = pngquant.o rwpng.o
+ COCOA_OBJS = rwpng_cocoa.o
+@@ -30,7 +35,7 @@ TARNAME = pngquant-$(VERSION)
+ TARFILE = $(TARNAME)-src.tar.bz2
+ 
+ ifdef USE_COCOA
+-CFLAGS += -DUSE_COCOA=1
++CFLAGSOPT += -DUSE_COCOA=1
+ OBJS += $(COCOA_OBJS)
+ FRAMEWORKS += -framework Cocoa
+ endif
+@@ -40,13 +45,13 @@ BUILD_CONFIGURATION="$(CC) $(CFLAGS) $(L
+ all: $(BIN)
+ 
+ lib/libimagequant.a::
+-	$(MAKE) -C lib -$(MAKEFLAGS) static
++	$(MAKE) -C lib $(MAKEFLAGS) shared
+ 
+ openmp::
+ 	$(MAKE) CFLAGSADD=-fopenmp OPENMPFLAGS="-Bstatic -lgomp" -j8 -$(MAKEFLAGS)
+ 
+ $(BIN): $(OBJS) lib/libimagequant.a
+-	$(CC) $(OBJS) $(LDFLAGS) $(OPENMPFLAGS) $(FRAMEWORKS) -o $@
++	$(CC) $(OBJS) $(LDFLAGS) $(LDFLAGSOPT) $(OPENMPFLAGS) $(FRAMEWORKS) -o $@
+ 
+ rwpng_cocoa.o: rwpng_cocoa.m
+ 	clang -c $(CFLAGS) -o $@ $<
+Index: pngquant-2.0.0/lib/Makefile
+===================================================================
+--- pngquant-2.0.0.orig/lib/Makefile
++++ pngquant-2.0.0/lib/Makefile
+@@ -5,14 +5,13 @@ VERSION=2.0.0
+ CC := $(patsubst cc,gcc,$(CC))
+ 
+ STATICLIB=libimagequant.a
++SHAREDLIB=libimagequant.so
++SOVER=0
+ DLL=libimagequant.dll
+ DLLIMP=libimagequant_dll.a
+ DLLDEF=libimagequant_dll.def
+ 
+-CFLAGSOPT ?= -DNDEBUG -O3 -fstrict-aliasing -ffast-math -funroll-loops -fomit-frame-pointer -ffinite-math-only
+-
+-CFLAGS ?= -Wall -Wno-unknown-pragmas -I. $(CFLAGSOPT)
+-CFLAGS += -std=c99 $(CFLAGSADD)
++CFLAGS += -fPIC
+ 
+ OBJS = pam.o mediancut.o blur.o mempool.o viter.o nearest.o libimagequant.o
+ 
+@@ -22,10 +21,12 @@ DISTFILES = $(OBJS:.o=.c) *.h MANUAL.md
+ TARNAME = libimagequant-$(VERSION)
+ TARFILE = $(TARNAME)-src.tar.bz2
+ 
+-all: static
++all: shared
+ 
+ static: $(STATICLIB)
+ 
++shared: $(SHAREDLIB)
++
+ dll:
+ 	$(MAKE) CFLAGSADD="-DLIQ_EXPORT='__declspec(dllexport)'" $(DLL)
+ 
+@@ -38,6 +39,10 @@ $(DLL) $(DLLIMP): $(OBJS)
+ $(STATICLIB): $(OBJS)
+ 	$(AR) $(ARFLAGS) $@ $^
+ 
++$(SHAREDLIB): $(OBJS)
++	$(CC) -shared -Wl,-soname,$(SHAREDLIB).$(SOVER) $(LDFLAGS) $(OBJS) -o $(SHAREDLIB).$(SOVER)
++	ln -fs $(SHAREDLIB).$(SOVER) $(SHAREDLIB)
++
+ $(OBJS): pam.h build_configuration
+ 
+ dist: $(TARFILE)
diff --git a/pngquant.spec b/pngquant.spec
index 2507a1e..bd2bf25 100644
--- a/pngquant.spec
+++ b/pngquant.spec
@@ -1,66 +1,97 @@
-#just in case this will be a must in future.
-%global _hardened_build 1
+%global libname libimagequant
 
 Name:		pngquant
-Version:	1.8.3
-Release:	7%{?dist}
+Version:	2.0.0
+Release:	1%{?dist}
 Summary:	PNG quantization tool for reducing image file size
-Group:		Applications/Multimedia
+%{?el5:Group:	Applications/Multimedia}
+
 License:	BSD with advertising
 URL:		http://%{name}.org
-Source0:	http://%{name}.org/%{name}-%{version}-src.tar.bz2
+Source0:	%{url}/%{name}-%{version}-src.tar.bz2
+
+Patch0:		%{name}-2.0.0_fix-Makefile.patch
 
-# this will be in the next version
-Patch0:		pngquant_respect_system_flags.patch
 
 %{?el5:BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)}
 BuildRequires:	libpng-devel
 
 
 %description
-%{name} converts 24/32-bit RGBA PNG images to 8-bit palette with
-alpha channel preserved. Such images are compatible with all modern web
-browsers and a compatibility setting is available to help transparency
-degrade well in Internet Explorer 6. Quantized files are often 40-70
-percent smaller than their 24/32-bit version. %{name} uses the
-median cut algorithm.
+%{name} converts 24/32-bit RGBA PNG images to 8-bit palette with alpha channel
+preserved.  Such images are compatible with all modern web browsers and a
+compatibility setting is available to help transparency degrade well in
+Internet Explorer 6.  Quantized files are often 40-70 percent smaller than
+their 24/32-bit version. %{name} uses the median cut algorithm.
+
+
+%package -n %{libname}
+Summary:	Small, portable C lib for HQ conversion of RGBA to 8-bit indexed-color
+%{?el5:Group:	System Environment/Libraries}
+
+%description -n %{libname}
+%{libname} converts 24/32-bit RGBA PNG images to 8-bit palette with alpha
+channel preserved.  Such images are compatible with all modern web browsers and
+a compatibility setting is available to help transparency degrade well in
+Internet Explorer 6.  Quantized files are often 40-70 percent smaller than
+their 24/32-bit version. %{libname} uses the median cut algorithm.
+
+
+%package -n %{libname}-devel
+Summary:	Development files for %{libname}
+%{?el5:Group:	Development/Libraries}
+
+Requires:	%{libname} = %{version}-%{release}
+
+%description -n %{libname}-devel
+This package contains files for development with %{libname}.
+There is also some brief API-documentation.
 
 
 %prep
 %setup -q
-%patch0
+%patch0 -p1
 
 
 %build
-# since there is no autotools/configure-script in sources
-echo '#!/bin/sh' > configure
-chmod +x configure
+# export compiler-flags properly
+%configure ||:
 
-#have the compiler-flags exported properly
-%configure
-
-make %{?_smp_mflags}
+make %{?_smp_mflags} PREFIX=%{_prefix}
 
 
 %install
-# have the compiler-flags exported properly, again
-# otherwise make_install will trigger rebuild without
-# proper compiler-flags
-%configure
-
-%if 0%{?el5}
-  rm -rf "%{buildroot}"
-  make install DESTDIR="%{buildroot}" PREFIX=%{_prefix}
-%else
-  %make_install PREFIX=%{_prefix}
-%endif
-
-install	-Dpm0644 %{name}.1 \
+%{?el5:rm -rf %{buildroot}}
+
+# make install will rebuild otherwise
+%configure ||:
+
+make install DESTDIR=%{buildroot} PREFIX=%{_prefix}
+
+mkdir -p %{buildroot}%{_includedir}/imagequant \
+	%{buildroot}%{_libdir} \
+	%{buildroot}%{_mandir}/man1
+
+# install libimagequant
+install -pm 0755 lib/%{libname}.so.0 \
+	%{buildroot}%{_libdir}
+ln -fs %{_libdir}/%{libname}.so.0 \
+	%{buildroot}%{_libdir}/%{libname}.so
+install -pm 0644 lib/*.h \
+	%{buildroot}%{_includedir}/imagequant
+
+# install man-page for %%{name}
+install	-pm 0644 %{name}.1 \
 	%{buildroot}/%{_mandir}/man1/%{name}.1
 
 
 %clean
-%{?el5:rm -rf "%{buildroot}"}
+%{?el5:rm -rf %{buildroot}}
+
+
+%post -n %{libname} -p /sbin/ldconfig
+
+%postun -n %{libname} -p /sbin/ldconfig
 
 
 %files
@@ -68,8 +99,21 @@ install	-Dpm0644 %{name}.1 \
 %{_bindir}/%{name}
 %{_mandir}/man1/%{name}.1*
 
+%files -n %{libname}
+%doc lib/COPYRIGHT
+%{_libdir}/%{libname}.so.*
+
+%files -n %{libname}-devel
+%doc lib/MANUAL.md
+%{_includedir}/imagequant
+%{_libdir}/%{libname}.so
+
 
 %changelog
+* Fri Aug 23 2013 Björn Esser <bjoern.esser at gmail.com> - 2.0.0-1
+- new upstream version 2.0.0 (#989991)
+- fixes FTBFS in F20 / rawhide (#992807)
+
 * Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.8.3-7
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 
diff --git a/sources b/sources
index 666bf97..acb4e9d 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-d1015f115bf396c9eed41a17ed8e898c  pngquant-1.8.3-src.tar.bz2
+5bb20c5c07e5db4ae9c5a16f5bb870b6  pngquant-2.0.0-src.tar.bz2


More information about the scm-commits mailing list