-# TODO
-# - ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/delegates/ljpeg-6b.tar.gz
-# NOTE: it changes ABI! either make it work without ABI breakage, or build
-# second libjpeg (with lossless support) with different name/soname
+%bcond_without tests
#
-# Conditional build:
-%bcond_with arith # arithmetic coding support (changes error codes in ABI, patent problems somewhere)
-%bcond_with crop # "apply" crop pseudo-patch (changes error codes in ABI, conflicts with arith patch)
-#
-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: 27
-License: distributable
+%define libjpeg_ver 6b
+Summary: A MMX/SSE2 accelerated library for manipulating JPEG image files
+Name: libjpeg-turbo
+Version: 1.0.90
+Release: 1
+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
-Source2: http://sylvana.net/jpegcrop/croppatch.tar.gz
-# Source2-md5: 45d76e4226232439308e2129b64c4ea1
-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
-URL: http://www.ijg.org/
+Source0: http://downloads.sourceforge.net/project/libjpeg-turbo/%{version}%20(1.1beta1)/%{name}-%{version}.tar.gz
+# Source0-md5: 9dafc998ef7662b6cf78337afde4a8bf
+URL: http://libjpeg-turbo.virtualgl.org/
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: libstdc++-devel
+BuildRequires: libtool
BuildRequires: libtool
+BuildRequires: nasm
+Provides: libjpeg = %{libjpeg_ver}
+Obsoletes: libjpeg
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.
-
-%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 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.
%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
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
+Provides: libjpeg-devel = %{libjpeg_ver}
+Obsoletes: libjpeg-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
%description devel -l pl.UTF-8
Ten pakiet zawiera pliki potrzebne do programowania z wykorzystaniem
-biblioteki libjpeg. Zawiera także dokumentację.
+biblioteki libjpeg-turbo. Zawiera także dokumentację.
%description devel -l pt_BR.UTF-8
Este pacote é tudo que você precisa para desenvolver programas que
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
+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
+Conflicts: libjpeg-turbo6-progs
%description progs
Simple clients for manipulating JPEG images. Libjpeg client programs
tekstowe dołączone do pliku JPEG, a wrjpgcom wstawia takie komentarze.
%prep
-%setup -q -n jpeg-%{version}
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%{?with_arith:%patch5 -p1}
-
-%if %{with crop}
-mkdir croppatch
-gzip -dc %{SOURCE2} | tar xf - -C croppatch
-# evil: jerror.h change breaks error codes in ABI
-cp croppatch/{jerror.h,jpegtran.c,transupp.c,transupp.h} .
-%endif
-
-cp -f %{_datadir}/libtool/config.sub .
+%setup -q
%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__automake}
+
%configure \
--enable-shared \
- --enable-static
+ --enable-static \
+ --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}
+rm $RPM_BUILD_ROOT%{_includedir}/turbojpeg.h
+rm $RPM_BUILD_ROOT%{_libdir}/libturbojpeg.*
%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
%files devel
%defattr(644,root,root,755)
-%doc {libjpeg,structure}.doc
%attr(755,root,root) %{_libdir}/libjpeg.so
%{_libdir}/libjpeg.la
%{_includedir}/jconfig.h
%{_includedir}/jerror.h
%{_includedir}/jmorecfg.h
%{_includedir}/jpeglib.h
-%{_includedir}/jversion.h
%files static
%defattr(644,root,root,755)
%{_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*