From 01af2ede993fedbcb4f6513d60439921da3add5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Sun, 16 Apr 2017 05:24:47 +0100 Subject: [PATCH] Update pngquant to 2.9.1 Update Makefile to better handle build the shared libraries --- pngquant-2.9.2-Makefile.patch | 60 +++++++++++++++++++++++++++++++++++ pngquant.spec | 20 +++++++----- sources | 4 +-- 3 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 pngquant-2.9.2-Makefile.patch diff --git a/pngquant-2.9.2-Makefile.patch b/pngquant-2.9.2-Makefile.patch new file mode 100644 index 0000000..f88777d --- /dev/null +++ b/pngquant-2.9.2-Makefile.patch @@ -0,0 +1,60 @@ +--- ./Makefile.orig 2017-04-16 04:03:50.371539956 +0100 ++++ ./Makefile 2017-04-16 04:57:42.147558976 +0100 +@@ -24,38 +24,35 @@ TESTBIN = test/test + + all: $(BIN) + ++ifeq ($(SHARED),1) ++ LIB=$(SHAREDLIB) ++else ++ LIB=$(STATICLIB) ++endif ++ + staticlib: $(STATICLIB) + ++sharedlib: $(SHAREDLIB) ++ + $(STATICLIB): config.mk $(LIBDISTFILES) + $(MAKE) -C lib static + +-sharedlib: lib/libimagequant.h ++$(SHAREDLIB): config.mk $(LIBDISTFILES) + $(MAKE) -C lib shared + +-$(SHAREDLIB): config.mk sharedlib +- + $(OBJS): $(wildcard *.h) config.mk + + rwpng_cocoa.o: rwpng_cocoa.m + $(CC) -Wno-enum-conversion -c $(CFLAGS) -o $@ $< &> /dev/null || clang -Wno-enum-conversion -c -O3 -o $@ $< + +-$(BIN): $(OBJS) $(STATICLIB) ++$(BIN): $(OBJS) $(LIB) + $(CC) $^ $(CFLAGS) $(LDFLAGS) -o $@ + +-$(TESTBIN): test/test.o $(STATICLIB) ++$(TESTBIN): test/test.o $(LIB) + $(CC) $^ $(CFLAGS) $(LDFLAGS) -o $@ + + test: $(BIN) $(TESTBIN) +- ./test/test.sh ./test $(BIN) $(TESTBIN) +- +-bin.shared: $(OBJS) $(SHAREDLIB) +- $(CC) $^ $(CFLAGS) $(LDFLAGS) -o $(BIN) +- +-testbin.shared: test/test.o $(SHAREDLIB) +- $(CC) $^ $(CFLAGS) $(LDFLAGS) -o $(TESTBIN) +- +-test.shared: bin.shared testbin.shared +- ./test/test.sh ./test $(BIN) $(TESTBIN) ++ LD_LIBRARY_PATH="lib" ./test/test.sh ./test $(BIN) $(TESTBIN) + + dist: $(TARFILE) + +@@ -94,5 +91,5 @@ endif + lib/libimagequant.h: + git submodule init && git submodule update || true + +-.PHONY: all clean dist distclean dll install uninstall test staticlib ++.PHONY: all clean dist distclean dll install uninstall test staticlib sharedlib + .DELETE_ON_ERROR: diff --git a/pngquant.spec b/pngquant.spec index 3e203f6..01e26ee 100644 --- a/pngquant.spec +++ b/pngquant.spec @@ -4,8 +4,8 @@ %global libname libimagequant Name: pngquant -Version: 2.8.1 -Release: 2%{?dist} +Version: 2.9.1 +Release: 1%{?dist} Summary: PNG quantization tool for reducing image file size License: GPLv3+ @@ -13,6 +13,7 @@ License: GPLv3+ URL: http://%{name}.org Source0: https://github.com/pornel/%{name}/archive/%{version}/%{name}-%{version}.tar.gz Source1: https://github.com/ImageOptim/libimagequant/archive/%{version}/%{libname}-%{version}.tar.gz +Patch1: pngquant-2.9.2-Makefile.patch BuildRequires: libpng-devel >= 1.2.46-1 BuildRequires: zlib-devel >= 1.2.3-1 @@ -56,16 +57,17 @@ There is also some brief API-documentation. %setup -q -a1 rmdir lib/ mv %{libname}-%{version} lib -rm lib/configure +#rm lib/configure +%patch1 -p1 %build %configure --with-openmp -%make_build bin.shared +%make_build SHARED=1 %install -%make_install +%make_install SHARED=1 mkdir -p %{buildroot}%{_includedir}/imagequant \ %{buildroot}%{_libdir} @@ -79,9 +81,7 @@ install -pm 0644 lib/*.h \ %{buildroot}%{_includedir}/imagequant %check -# needed by ld / testsuite to find libimagequant -export LD_LIBRARY_PATH="$(pwd)/lib:$LD_LIBRARY_PATH" -make test.shared +make test SHARED=1 %post -n %{libname} -p /sbin/ldconfig @@ -105,6 +105,10 @@ make test.shared %changelog +* Sun Apr 16 2017 Sérgio Basto - 2.9.1-1 +- Update pngquant to 2.9.1 +- Update Makefile to better handle build the shared libraries + * Sat Feb 11 2017 Fedora Release Engineering - 2.8.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/sources b/sources index 70c6dcd..9fac440 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -1845f2ccc011f5455361eb8f4dbd449e pngquant-2.8.1.tar.gz -47095a6d6bbe5dd63e555f07183bd561 libimagequant-2.8.1.tar.gz +SHA512 (pngquant-2.9.1.tar.gz) = 1708b627892f37e99ecc46bc9a43b0ef58ab7f5074dda68ed5f37c0ebb515270903ddac2ea1f6e67aa15adb14382c9c4c74ffd9d579648bef90f40d8bdbaabe2 +SHA512 (libimagequant-2.9.1.tar.gz) = d852a992062204f1f365804c6908a107c78c20eca5a28ca9b6074b7f49d166cce0112017059e529c3730def04e9e2707272b542b98fc2d96dd985d76bc2f7d34