#
-# Conditional build:
-%bcond_with arith # arithmetic coding support (changes error codes in ABI, patent problems somewhere)
-%bcond_with crop # lossless cropping support (changes error codes in ABI)
+# Conditional build
+%bcond_without tests # don't perform "make test"
+%bcond_without java # Java binding
#
-Summary: Library for handling different JPEG files
-Summary(de.UTF-8): Library zum Verarbeiten verschiedener JPEG-Dateien
-Summary(es.UTF-8): Biblioteca para manipulación de diferentes archivos JPEGs
-Summary(fr.UTF-8): Bibliothèque pour gérer différents fichiers JPEG
-Summary(pl.UTF-8): Biblioteka do manipulacji plikami w formacie JPEG
-Summary(pt_BR.UTF-8): Biblioteca para manipulação de diferentes arquivos JPEGs
-Summary(ru.UTF-8): Библиотека для обработки различных JPEG-файлов
-Summary(tr.UTF-8): JPEG resimlerini işleme kitaplığı
-Summary(uk.UTF-8): Бібліотека для обробки різноманітних JPEG-файлів
-Name: libjpeg
-Version: 6b
-Release: 28
-License: distributable
+%define libjpeg_ver 8c
+%define libjpeg_ver_lt 9-1
+Summary: A MMX/SSE2 accelerated library for manipulating JPEG image files
+Summary(pl.UTF-8): Biblioteka do obróbki plików obrazów JPEG z akceleracją MMX/SSE2
+Name: libjpeg-turbo
+Version: 1.2.1
+Release: 2
+License: wxWidgets
Group: Libraries
-Source0: ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v%{version}.tar.gz
-# Source0-md5: dbd5f3b47ed13132f04c685d608a7547
-Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
-# Source1-md5: d6342c015a489de275ada637a77dc2b0
-Patch0: %{name}-DESTDIR.patch
-Patch1: %{name}-arm.patch
-Patch2: %{name}-include.patch
-Patch3: %{name}-c++.patch
-Patch4: %{name}-libtool.patch
-# from http://sylvana.net/jpeg-ari/jpeg-ari-28mar98.tar.gz
-Patch5: %{name}-arith.patch
-# from http://sylvana.net/jpegcrop/croppatch.tar.gz
-Patch6: %{name}-crop.patch
-URL: http://www.ijg.org/
+Source0: http://downloads.sourceforge.net/libjpeg-turbo/%{name}-%{version}.tar.gz
+# Source0-md5: f61e60ff01381ece4d2fe65eeb52669e
+Patch0: %{name}-turbojpeg.patch
+URL: http://libjpeg-turbo.virtualgl.org/
+BuildRequires: autoconf >= 2.56
+BuildRequires: automake
+%{?with_java:BuildRequires: jdk}
+BuildRequires: libstdc++-devel
BuildRequires: libtool
+# x86* SIMD code uses NASM; arm uses gas, no SIMD code for other archs
+%ifarch %{ix86} %{x8664}
+BuildRequires: nasm
+%endif
+Provides: libjpeg = %{libjpeg_ver}
+Obsoletes: libjpeg < %{libjpeg_ver_lt}
+Obsoletes: libjpegsimd
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-The libjpeg package contains a library of functions for manipulating
-JPEG images.
-
-%description -l de.UTF-8
-Dieses Paket ist eine Library mit Funktionen zur Manipulation von
-JPEG-Bildern.
-
-%description -l es.UTF-8
-Este paquete contiene una biblioteca de funciones que manipulan
-imágenes JPEG.
-
-%description -l fr.UTF-8
-Bibliothèque de fonctions qui manipulent des images JPEG.
+libjpeg-turbo is a version of libjpeg which uses MMX, SSE, and SSE2
+SIMD instructions to accelerate baseline JPEG
+compression/decompression by about 2-4x on x86 and x86-64 platforms.
+It is based on libjpeg/SIMD but has numerous enhancements.
%description -l pl.UTF-8
-Ten pakiet zawiera bibliotekę funkcji do manipulacji plikami JPEG.
-
-%description -l pt_BR.UTF-8
-Este pacote contém uma biblioteca de funções que manipulam imagens
-JPEG.
-
-%description -l ru.UTF-8
-Библиотека функций для обработки JPEG-изображений и простые клиенты
-для такой обработки.
-
-%description -l tr.UTF-8
-Bu paket, JPEG şekillerini işlemek için kitaplıklar ve basit
-istemciler içerir.
-
-%description -l uk.UTF-8
-Бібліотека функцій для обробки JPEG-зображень та прості клієнти для
-такої обробки.
+libjpeg-turbo to wersja biblioteki libjpeg wykorzystująca instrukcje
+SIMD MMX, SSE i SSE2 w celu przyspieszenia kompresji/dekompresji JPEG
+o około 2-4 razy na platformach x86 i x86-64. Jest oparta na
+libjpeg/SIMD, ale ma wiele rozszerzeń.
%package devel
-Summary: Headers for developing programs using libjpeg
-Summary(de.UTF-8): Header zum Entwickeln von Programmen mit libjpeg
-Summary(es.UTF-8): Archivos de inclusión para desarrollar programas usando libjpeg
-Summary(pl.UTF-8): Pliki nagłówkowe libjpeg
-Summary(pt_BR.UTF-8): Arquivos de inclusão para desenvolver programas usando libjpeg
-Summary(ru.UTF-8): Хедеры для разработки программ, использующих libjpeg
-Summary(tr.UTF-8): libjpeg için geliştirme kitaplıkları ve başlık dosyaları
-Summary(uk.UTF-8): Хедери для розробки програм, що використовують libjpeg
+Summary: Headers for developing programs using libjpeg-turbo
+Summary(pl.UTF-8): Pliki nagłówkowe do tworzenia programów przy użyciu libjpeg-turbo
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
+Provides: libjpeg-devel = %{libjpeg_ver}
+Obsoletes: libjpeg-devel < %{libjpeg_ver_lt}
+Obsoletes: libjpegsimd-devel
+Conflicts: libjpeg6-devel
%description devel
-The libjpeg-devel package includes the header files necessary for
-developing programs which will manipulate JPEG files using the libjpeg
-library.
+The libjpeg-turbo-devel package includes the header files necessary
+for developing programs which will manipulate JPEG files using the
+libjpeg-turbo library.
%description devel -l de.UTF-8
Dieses Paket bietet alles, was Sie brauchen, um Programme zur
-Manipulation von JPEG-Grafiken, einschließlich Dokumentation, zu
-entwickeln.
+Manipulation von JPEG-Grafiken, zu entwickeln.
%description devel -l es.UTF-8
Este paquete es todo lo que necesitas para desarrollar programas que
-manipulen imágenes JPEG, incluso documentación.
+manipulen imágenes JPEG.
%description devel -l fr.UTF-8
Ce package est tout ce dont vous avez besoin pour développer des
-programmes manipulant des images JPEG, et comprend la documentation.
+programmes manipulant des images JPEG.
%description devel -l pl.UTF-8
Ten pakiet zawiera pliki potrzebne do programowania z wykorzystaniem
-biblioteki libjpeg. Zawiera także dokumentację.
+biblioteki libjpeg-turbo.
%description devel -l pt_BR.UTF-8
Este pacote é tudo que você precisa para desenvolver programas que
-manipulam imagens JPEG, incluindo documentação.
+manipulam imagens JPEG.
%description devel -l ru.UTF-8
В этом пакете содержится все необходимое для разработки программ,
JPEG-зображеннями, включаючи документацію.
%package static
-Summary: Static library for developing programs using libjpeg
-Summary(pl.UTF-8): Biblioteka statyczna libjpeg
-Summary(pt_BR.UTF-8): Bibliotecas estáticas para desenvolvimento com libjpeg
-Summary(ru.UTF-8): Статическая библиотека для программирования с libjpeg
-Summary(uk.UTF-8): Статична бібліотека для програмування з libjpeg
+Summary: Static library for developing programs using libjpeg-turbo
+Summary(pl.UTF-8): Biblioteka statyczna libjpeg-turbo
+Summary(pt_BR.UTF-8): Bibliotecas estáticas para desenvolvimento com libjpeg-turbo
+Summary(ru.UTF-8): Статическая библиотека для программирования с libjpeg-turbo
+Summary(uk.UTF-8): Статична бібліотека для програмування з libjpeg-turbo
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
+Provides: libjpeg-static = %{libjpeg_ver}
+Obsoletes: libjpeg-static < %{libjpeg_ver_lt}
+Obsoletes: libjpegsimd-static
+Conflicts: libjpeg-turbo6-static
%description static
-Static library for developing programs using libjpeg.
+Static library for developing programs using libjpeg-turbo.
%description static -l pl.UTF-8
-Statyczna biblioteka libjpeg.
+Statyczna biblioteka libjpeg-turbo.
%description static -l pt_BR.UTF-8
-Bibliotecas estáticas para desenvolvimento com libjpeg.
+Bibliotecas estáticas para desenvolvimento com libjpeg-turbo.
%description static -l ru.UTF-8
Этот пакет содержит статические библиотеки, необходимые для написания
-программ, использующих libjpeg.
+программ, использующих libjpeg-turbo.
%description static -l uk.UTF-8
Цей пакет містить статичні бібліотеки, необхідні для написання
-програм, що використовують libjpeg.
+програм, що використовують libjpeg-turbo.
%package progs
Summary: Simple clients for manipulating JPEG images
Summary(pl.UTF-8): Kilka prostych programów do manipulowania na plikach JPEG
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
+Provides: libjpeg-progs = %{libjpeg_ver}
+Obsoletes: libjpeg-progs < %{libjpeg_ver_lt}
+Obsoletes: libjpegsimd-progs
+Conflicts: libjpeg-turbo6-progs
%description progs
Simple clients for manipulating JPEG images. Libjpeg client programs
przekształcenia na plikach JPEG. rdjpgcom wyświetla komentarze
tekstowe dołączone do pliku JPEG, a wrjpgcom wstawia takie komentarze.
+%package -n java-turbojpeg
+Summary: Java wrapper for the TurboJPEG/OSS library
+Summary(pl.UTF-8): Interfejs Javy do biblioteki TurboJPEG/OSS
+Group: Development/Languages/Java
+Requires: %{name} = %{version}-%{release}
+Requires: jpackage-utils
+
+%description -n java-turbojpeg
+Java wrapper for the TurboJPEG/OSS library.
+
+%description -n java-turbojpeg -l pl.UTF-8
+Interfejs Javy do biblioteki TurboJPEG/OSS.
+
%prep
-%setup -q -n jpeg-%{version}
+%setup -q
%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%{?with_arith:%patch5 -p1}
-%{?with_crop:%patch6 -p1}
%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__automake}
+
%configure \
+ %{?with_java:JNI_CFLAGS="-I%{_jvmdir}/java/include -I%{_jvmdir}/java/include/linux"} \
--enable-shared \
- --enable-static
+ --enable-static \
+ %{?with_java:--with-java} \
+ --with-jpeg8
-%{__make} \
- libdir=%{_libdir}
+%{__make}
-LD_PRELOAD=$PWD/.libs/%{name}.so \
-%{__make} test
+%{?with_tests:%{__make} test}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir},%{_bindir},%{_mandir}/man1}
-%{__make} install install-headers install-lib \
- libdir=%{_libdir} \
+%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-install jversion.h $RPM_BUILD_ROOT%{_includedir}
-
-# remove HAVE_STD{DEF,LIB}_H
-# (not necessary but may generate warnings confusing autoconf)
-(cd $RPM_BUILD_ROOT%{_includedir}
-grep -v 'HAVE_STD..._H' jconfig.h > jconfig.h.new
-mv -f jconfig.h.new jconfig.h
-)
-
-bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
+%if %{with java}
+install -d $RPM_BUILD_ROOT%{_javadir}
+%{__mv} $RPM_BUILD_ROOT%{_prefix}/classes/turbojpeg.jar $RPM_BUILD_ROOT%{_javadir}
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc README change.log %{?with_arith:README.arithmetic}
+%doc README change.log
%attr(755,root,root) %{_libdir}/libjpeg.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libjpeg.so.62
+%attr(755,root,root) %ghost %{_libdir}/libjpeg.so.8
+%attr(755,root,root) %{_libdir}/libturbojpeg.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libturbojpeg.so.0
%files devel
%defattr(644,root,root,755)
-%doc {libjpeg,structure}.doc
%attr(755,root,root) %{_libdir}/libjpeg.so
+%attr(755,root,root) %{_libdir}/libturbojpeg.so
%{_libdir}/libjpeg.la
+%{_libdir}/libturbojpeg.la
%{_includedir}/jconfig.h
%{_includedir}/jerror.h
%{_includedir}/jmorecfg.h
%{_includedir}/jpeglib.h
-%{_includedir}/jversion.h
+%{_includedir}/turbojpeg.h
%files static
%defattr(644,root,root,755)
%{_libdir}/libjpeg.a
+%{_libdir}/libturbojpeg.a
%files progs
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/djpeg
%attr(755,root,root) %{_bindir}/jpegtran
%attr(755,root,root) %{_bindir}/rdjpgcom
+%attr(755,root,root) %{_bindir}/tjbench
%attr(755,root,root) %{_bindir}/wrjpgcom
%{_mandir}/man1/cjpeg.1*
%{_mandir}/man1/djpeg.1*
%{_mandir}/man1/jpegtran.1*
%{_mandir}/man1/rdjpgcom.1*
%{_mandir}/man1/wrjpgcom.1*
-%lang(fi) %{_mandir}/fi/man1/cjpeg.1*
-%lang(pl) %{_mandir}/pl/man1/cjpeg.1*
-%lang(pl) %{_mandir}/pl/man1/djpeg.1*
+
+%if %{with java}
+%files -n java-turbojpeg
+%defattr(644,root,root,755)
+%doc java/doc/*
+%{_javadir}/turbojpeg.jar
+%endif