[packages/libimagequant] - split from pngquant.spec, updated to 2.11.10
qboosh
qboosh at pld-linux.org
Mon May 28 05:57:49 CEST 2018
commit e0da65aacb1b8ff86f4dc8f33c602d0bbd2efde2
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Mon May 28 05:58:39 2018 +0200
- split from pngquant.spec, updated to 2.11.10
libimagequant-shared.patch | 21 ++++++++
libimagequant.spec | 117 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 138 insertions(+)
---
diff --git a/libimagequant.spec b/libimagequant.spec
new file mode 100644
index 0000000..4dd1ee9
--- /dev/null
+++ b/libimagequant.spec
@@ -0,0 +1,117 @@
+# TODO:
+# - finish java (create .jar, install)
+# - build C#, rust bindings
+#
+# Conditional build:
+%bcond_without static_libs # static library
+%bcond_without openmp # OpenMP support
+%bcond_with sse # SSE instructions
+%bcond_with java # Java bindings [TODO: finish]
+#
+%ifarch pentium3 pentium4 %{x8664} x32
+%define with_sse 1
+%endif
+Summary: Image Quantization library
+Summary(pl.UTF-8): Biblioteka do kwantyzacji obrazów
+Name: libimagequant
+Version: 2.11.10
+Release: 1
+# some original code was on MIT-like license
+License: GPL v3+ with MIT parts or commercial
+Group: Libraries
+#Source0Download: https://github.com/ImageOptim/libimagequant/releases
+Source0: https://github.com/ImageOptim/libimagequant/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 9fe3feaa38e78285e363d8e90dc4dd82
+Patch0: %{name}-shared.patch
+URL: https://pngquant.org/lib/
+%{?with_openmp:BuildRequires: gcc >= 6:4.2}
+%{?with_java:BuildRequires: jdk}
+%{?with_openmp:BuildRequires: libgomp-devel}
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Small, portable C library for high-quality conversion of RGBA images
+to 8-bit indexed-color (palette) images.
+
+%description -l pl.UTF-8
+Mała, przenośna biblioteka C do wysokiej jakości konwersji obrazów
+RGBA do obrazów 8-bitowych z indeksowanymi kolorami (paletą).
+
+%package devel
+Summary: Header files for libimagequant library
+Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libimagequant
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Header files for libimagequant library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki libimagequant.
+
+%package static
+Summary: Static libimagequant library
+Summary(pl.UTF-8): Statyczna biblioteka libimagequant
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
+
+%description static
+Static libimagequant library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka libimagequant.
+
+%prep
+%setup -q
+%patch0 -p1
+
+%build
+# not autoconf configure
+./configure \
+ CC="%{__cc}" \
+ CFLAGS="%{rpmcflags} %{rpmcppflags}" \
+ LDFLAGS="%{rpmldflags}" \
+ --prefix=%{_prefix} \
+ --libdir=%{_libdir} \
+ %{__enable_disable sse} \
+ %{?with_openmp:--with-openmp}
+
+%{__make} shared %{?with_static_libs:static}
+
+%if %{with java}
+%{__make} java \
+ CLASSPATH=.
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%if %{with static_libs}
+cp -p libimagequant.a $RPM_BUILD_ROOT%{_libdir}
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc CHANGELOG COPYRIGHT README.md
+%attr(755,root,root) %{_libdir}/libimagequant.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libimagequant.so
+%{_includedir}/libimagequant.h
+%{_pkgconfigdir}/imagequant.pc
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libimagequant.a
+%endif
diff --git a/libimagequant-shared.patch b/libimagequant-shared.patch
new file mode 100644
index 0000000..88918e8
--- /dev/null
+++ b/libimagequant-shared.patch
@@ -0,0 +1,21 @@
+--- libimagequant-2.11.10/Makefile.orig 2018-03-10 13:31:19.000000000 +0100
++++ libimagequant-2.11.10/Makefile 2018-05-27 22:00:19.433276005 +0200
+@@ -51,6 +51,7 @@
+ $(CC) -shared -Wl,-soname,$(SHAREDLIB).$(SOVER) -o $(SHAREDLIB).$(SOVER) $^ $(LDFLAGS)
+ ln -fs $(SHAREDLIB).$(SOVER) $(SHAREDLIB)
+ sed -i "s#^prefix=.*#prefix=$(PREFIX)#" $(PKGCONFIG)
++ sed -i "s#^libdir=.*#libdir=$(LIBDIR)#" $(PKGCONFIG)
+ sed -i "s#^Version:.*#Version: $(VERSION)#" $(PKGCONFIG)
+
+ libimagequant.dylib: $(SHAREDOBJS)
+@@ -59,8 +60,8 @@
+
+ $(OBJS): $(wildcard *.h) config.mk
+
+-$(JNILIB): $(JAVAHEADERS) $(STATICLIB) org/pngquant/PngQuant.c
+- $(CC) -g $(CFLAGS) $(LDFLAGS) $(JAVAINCLUDE) -shared -o $@ $(STATICLIB) org/pngquant/PngQuant.c
++$(JNILIB): $(JAVAHEADERS) $(SHAREDLIB) org/pngquant/PngQuant.c
++ $(CC) -g $(CFLAGS) $(LDFLAGS) $(JAVAINCLUDE) -shared -o $@ $(SHAREDLIB) org/pngquant/PngQuant.c
+
+ $(JNIDLL) $(JNIDLLIMP): $(JAVAHEADERS) $(OBJS) org/pngquant/PngQuant.c
+ $(CC) -fPIC -shared -I. $(JAVAINCLUDE) -o $(JNIDLL) $^ $(LDFLAGS) -Wl,--out-implib,$(JNIDLLIMP),--output-def,$(JNIDLLDEF)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libimagequant.git/commitdiff/e0da65aacb1b8ff86f4dc8f33c602d0bbd2efde2
More information about the pld-cvs-commit
mailing list