+# 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
+#
+# Conditional build:
+%bcond_with crop # "apply" crop pseudo-patch
+#
Summary: Library for handling different jpeg files
Summary(de): Library zum Verarbeiten verschiedener jpeg-Dateien
Summary(es): Biblioteca para manipulación de diferentes archivos jpegs
Summary(uk): â¦Â̦ÏÔÅËÁ ÄÌÑ ÏÂÒÏÂËÉ Ò¦ÚÎÏÍÁΦÔÎÉÈ jpeg-ÆÁÊ̦×
Name: libjpeg
Version: 6b
-Release: 20
+Release: 26
License: distributable
Group: Libraries
Source0: ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v%{version}.tar.gz
-Source1: %{name}-non-english-man-pages.tar.bz2
+# 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
URL: http://www.ijg.org/
Patch0: %{name}-DESTDIR.patch
Patch1: %{name}-arm.patch
Patch2: %{name}-include.patch
Patch3: %{name}-c++.patch
+Patch4: %{name}-libtool.patch
BuildRequires: libtool
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Summary(tr): libjpeg için geliþtirme kitaplýklarý ve baþlýk dosyalarý
Summary(uk): èÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÁ ÄÌÑ ÒÏÚÒÏÂËÉ ÐÒÏÇÒÁÍ, ÝÏ ×ÉËÏÒÉÓÔÏ×ÕÀÔØ libjpeg
Group: Development/Libraries
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description devel
The libjpeg-devel package includes the header files and static
programmes manipulant des images jpg, et comprend la documentation.
%description devel -l pl
-Ten pakiet pozwoli Ci na programowanie z wykorzystniem formatu jpeg.
+Ten pakiet pozwoli Ci na programowanie z wykorzystaniem formatu jpeg.
Zawiera tak¿e dokumentacjê.
%description devel -l pt_BR
Summary(fr): Clients simples pour manipuler de telles images
Summary(pl): Kilka prostych programów do manipulowania na plikach jpeg
Group: Development/Libraries
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description progs
Simple clients for manipulating jpeg images. Libjpeg client programs
Summary(ru): óÔÁÔÉÞÅÓËÁÑ ÂÉÂÌÉÏÔÅËÁ ÄÌÑ ÐÒÏÇÒÁÍÍÉÒÏ×ÁÎÉÑ Ó libjpeg
Summary(uk): óÔÁÔÉÞÎÁ ¦Â̦ÏÔÅËÁ ÄÌÑ ÐÒÏÇÒÁÍÕ×ÁÎÎÑ Ú libjpeg
Group: Development/Libraries
-Requires: %{name}-devel = %{version}
+Requires: %{name}-devel = %{version}-%{release}
%description static
Static libraries for developing programs using libjpeg.
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
+
+%if %{with crop}
+gzip -dc %{SOURCE2} | tar xf -
+%endif
-%build
cp -f %{_datadir}/libtool/config.sub .
+
+%build
%configure \
--enable-shared \
--enable-static
-%{__make}
+%{__make} \
+ libdir=%{_libdir}
+
LD_PRELOAD=$PWD/.libs/%{name}.so make test
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir},%{_bindir},%{_mandir}/man1}
-%{__make} DESTDIR=$RPM_BUILD_ROOT \
- install install-headers install-lib
+
+%{__make} install install-headers install-lib \
+ libdir=%{_libdir} \
+ DESTDIR=$RPM_BUILD_ROOT
install jversion.h $RPM_BUILD_ROOT%{_includedir}
bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
-gzip -9nf {libjpeg,structure}.doc
-
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files devel
%defattr(644,root,root,755)
-%doc {libjpeg,structure}.doc.gz
+%doc {libjpeg,structure}.doc
%attr(755,root,root) %{_libdir}/lib*.so
-%attr(755,root,root) %{_libdir}/lib*.la
+%{_libdir}/lib*.la
%{_includedir}/*.h
%files progs