new upstream version 2.0.0 (#989991)

fixes FTBFS in F20 / rawhide (#992807)
epel9
Björn Esser 12 years ago
parent 7038662d95
commit 166824d1e6

4
.gitignore vendored

@ -1,2 +1,4 @@
*~ *~
/pngquant-1.8.3-src.tar.bz2 *.rpm
*.tar*
results_*/

@ -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)

@ -1,66 +1,97 @@
#just in case this will be a must in future. %global libname libimagequant
%global _hardened_build 1
Name: pngquant Name: pngquant
Version: 1.8.3 Version: 2.0.0
Release: 7%{?dist} Release: 1%{?dist}
Summary: PNG quantization tool for reducing image file size Summary: PNG quantization tool for reducing image file size
Group: Applications/Multimedia %{?el5:Group: Applications/Multimedia}
License: BSD with advertising License: BSD with advertising
URL: http://%{name}.org 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)} %{?el5:BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)}
BuildRequires: libpng-devel BuildRequires: libpng-devel
%description %description
%{name} converts 24/32-bit RGBA PNG images to 8-bit palette with %{name} converts 24/32-bit RGBA PNG images to 8-bit palette with alpha channel
alpha channel preserved. Such images are compatible with all modern web preserved. Such images are compatible with all modern web browsers and a
browsers and a compatibility setting is available to help transparency compatibility setting is available to help transparency degrade well in
degrade well in Internet Explorer 6. Quantized files are often 40-70 Internet Explorer 6. Quantized files are often 40-70 percent smaller than
percent smaller than their 24/32-bit version. %{name} uses the their 24/32-bit version. %{name} uses the median cut algorithm.
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 %prep
%setup -q %setup -q
%patch0 %patch0 -p1
%build %build
# since there is no autotools/configure-script in sources # export compiler-flags properly
echo '#!/bin/sh' > configure %configure ||:
chmod +x configure
#have the compiler-flags exported properly make %{?_smp_mflags} PREFIX=%{_prefix}
%configure
make %{?_smp_mflags}
%install %install
# have the compiler-flags exported properly, again %{?el5:rm -rf %{buildroot}}
# otherwise make_install will trigger rebuild without
# proper compiler-flags # make install will rebuild otherwise
%configure %configure ||:
%if 0%{?el5} make install DESTDIR=%{buildroot} PREFIX=%{_prefix}
rm -rf "%{buildroot}"
make install DESTDIR="%{buildroot}" PREFIX=%{_prefix} mkdir -p %{buildroot}%{_includedir}/imagequant \
%else %{buildroot}%{_libdir} \
%make_install PREFIX=%{_prefix} %{buildroot}%{_mandir}/man1
%endif
# install libimagequant
install -Dpm0644 %{name}.1 \ 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 %{buildroot}/%{_mandir}/man1/%{name}.1
%clean %clean
%{?el5:rm -rf "%{buildroot}"} %{?el5:rm -rf %{buildroot}}
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files %files
@ -68,8 +99,21 @@ install -Dpm0644 %{name}.1 \
%{_bindir}/%{name} %{_bindir}/%{name}
%{_mandir}/man1/%{name}.1* %{_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 %changelog
* Fri Aug 23 2013 Björn Esser <bjoern.esser@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@lists.fedoraproject.org> - 1.8.3-7 * Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

@ -1,37 +0,0 @@
--- Makefile 2013-02-26 01:03:50.000000000 +0100
+++ Makefile 2013-05-19 09:24:50.001314584 +0200
@@ -12,13 +12,20 @@
# Alternatively, build libpng in this directory:
CUSTOMLIBPNG ?= ../libpng
-CFLAGSOPT ?= -DNDEBUG -O3 -fstrict-aliasing -ffast-math -funroll-loops -fomit-frame-pointer -ffinite-math-only
+CFLAGSSYS := $(CFLAGS)
+LDFLAGSSYS := $(LDFLAGS)
-CFLAGS ?= -Wall -Wno-unknown-pragmas -I. -I$(CUSTOMLIBPNG) -I/usr/local/include/ -I/usr/include/ -I/usr/X11/include/ $(CFLAGSOPT)
-CFLAGS += -std=c99 $(CFLAGSADD)
+CFLAGSOPT ?= -DNDEBUG -O3 -fstrict-aliasing -ffast-math -funroll-loops
+CFLAGSOPT += -fomit-frame-pointer -ffinite-math-only
+CFLAGSOPT += -Wall -Wno-unknown-pragmas -I. -I$(CUSTOMLIBPNG) -I$(CUSTOMZLIB)
+CFLAGSOPT += -I/usr/local/include/ -I/usr/include/ -I/usr/X11/include/
+CFLAGSOPT += -std=c99
-LDFLAGS ?= -L$(CUSTOMLIBPNG) -L/usr/local/lib/ -L/usr/lib/ -L/usr/X11/lib/
-LDFLAGS += -lpng -lm $(LDFLAGSADD)
+LDFLAGSOPT ?= -L$(CUSTOMLIBPNG) -L/usr/local/lib/ -L/usr/lib/ -L/usr/X11/lib/
+LDFLAGSOPT += -lpng -lm
+
+CFLAGS = $(CFLAGSOPT) $(CFLAGSADD) $(CFLAGSSYS)
+LDFLAGS = $(LDFLAGSOPT) $(LDFLAGSADD) $(LDFLAGSSYS)
OBJS = pngquant.o rwpng.o pam.o mediancut.o blur.o mempool.o viter.o nearest.o
COCOA_OBJS = rwpng_cocoa.o
@@ -28,7 +35,7 @@
TARFILE = $(TARNAME)-src.tar.bz2
ifdef USE_COCOA
-CFLAGS += -DUSE_COCOA=1
+CFLAGSOPT += -DUSE_COCOA=1
OBJS += $(COCOA_OBJS)
FRAMEWORKS += -framework Cocoa
endif

@ -1 +1 @@
d1015f115bf396c9eed41a17ed8e898c pngquant-1.8.3-src.tar.bz2 5bb20c5c07e5db4ae9c5a16f5bb870b6 pngquant-2.0.0-src.tar.bz2

Loading…
Cancel
Save