Sisyphus repository
Last update: 30 january 2023 | SRPMs: 18151 | Visits: 26597840
en ru br
ALT Linux repos

Group :: System/Libraries
RPM: libjpeg-turbo

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

%def_enable profiling

Name: libjpeg-turbo
Version: 2.1.2
Release: alt1.2
Epoch: 2

Summary: A SIMD-accelerated library for manipulating JPEG image format files
License: BSD-3-Clause
Group: System/Libraries


Source: %name-%version-%release.tar
Source3: exifautotran
Source4: jpeginfo.c

Patch0: libjpeg-turbo-alt-rdjpgcom-i18n.patch
Patch1: libjpeg-turbo-alt-versioning.patch
Patch2: libjpeg-turbo-fedora-noinst.patch
Patch2000: %name-e2k-simd.patch

%def_enable static

BuildRequires: cmake ctest

%ifarch %ix86 x86_64
BuildRequires: nasm

%package -n libjpeg
Summary: A library for manipulating JPEG image format files
Group: System/Libraries

%package -n libjpeg-devel
Summary: Development tools for programs which will use the libjpeg library
Group: Development/C
Requires: libjpeg = %epoch:%version-%release
%ifnarch %ix86
Provides: libjpeg-mmx-devel

%package -n libjpeg-devel-static
Summary: Static libjpeg library
Group: Development/C
Requires: libjpeg-devel = %epoch:%version-%release
%ifnarch %ix86
Provides: libjpeg-mmx-devel-static

%package -n libjpeg-utils
Summary: Programs for manipulating JPEG format image files
Group: Graphics
Requires: libjpeg = %epoch:%version-%release

%package -n libturbojpeg
Summary: A turbojpeg library
Group: System/Libraries
Requires: libjpeg = %epoch:%version-%release

%package -n libturbojpeg-devel
Summary: Development files for the turbojpeg library
Group: Development/C
Requires: libturbojpeg = %epoch:%version-%release

libjpeg-turbo is a derivative of libjpeg which uses SIMD instructions
(MMX, SSE2, etc.) to accelerate baseline JPEG compression and
decompression on x86 and x86-64 systems.  On such systems, libjpeg-turbo
is generally 2-4x as fast as the unmodified version of libjpeg, all else
being equal.

%description -n libjpeg
This package contains a shared library of functions for loading,
manipulating and saving JPEG format image files.

%description -n libjpeg-devel
This package includes development files necessary for developing
programs which will manipulate JPEG files using the jpeg library.

%description -n libjpeg-devel-static
This package includes static library necessary for developing statically
linked programs which will manipulate JPEG files using the jpeg library.

%description -n libjpeg-utils
This package contains simple client programs for accessing the
libjpeg functions.  Libjpeg client programs include cjpeg, djpeg,
jpegtran, rdjpgcom and wrjpgcom.  Cjpeg compresses an image file
into JPEG format.  Djpeg decompresses a JPEG file into a regular
image file.  Jpegtran can perform various useful transformations
on JPEG files.  Rdjpgcom displays any text comments included in
a JPEG file.  Wrjpgcom inserts text comments into a JPEG file.

%description -n libturbojpeg
This package contains a turbojpeg shared library.

%description -n libturbojpeg-devel
This package contains development files for the turbojpeg library.

%setup -n %name-%version-%release
%patch0 -p1
%patch1 -p1
%patch2 -p2
%ifarch %e2k
%patch2000 -p1

install -pm644 %_sourcedir/{jpegexiforient,jpeginfo}.c .
install -pm755 %_sourcedir/exifautotran .

# restrict list of global symbols exported by the library.

echo -e '{\nglobal:' > libjpeg.sym
sed -En '/^EXTERN/ s,^.+\)\s+([^(]+).+$,\1;,p' jpeglib.h jpegint.h \
| egrep -v '^(jinit_|jzero_far)' >> libjpeg.sym
# extra symbols required by packages
cat >> libjpeg.sym <<'EOF'
local: *;

%{?optflags_lto:%global optflags_lto %optflags_lto -ffat-lto-objects}
# using PGO makes the code about 10% faster
# up to 50% on e2k for progressive JPEG decoding
%if_enabled profiling
%add_optflags -fprofile-generate
%cmake -G'Unix Makefiles'
# it's better not to do it in parallel
( cd %_cmake__builddir ; make -k test ; make clean )
%remove_optflags -fprofile-generate
%ifarch %e2k
%add_optflags -fprofile-use=%_builddir/%name-%version-%release/%_cmake__builddir/eprof.sum
eprof -d %_cmake__builddir -s %_cmake__builddir/eprof.sum
%add_optflags -fprofile-use

%cmake -G'Unix Makefiles'
make jpegexiforient
bzip2 -9fk libjpeg.txt structure.txt usage.txt

LD_LIBRARY_PATH=%buildroot%_libdir %cmake_build -t test -- -k
LD_LIBRARY_PATH=%buildroot%_libdir ./jpeginfo %_cmake__builddir/*.jpg >/dev/null

%__cc %optflags -D_GNU_SOURCE -I%buildroot%_includedir jpeginfo.c -L%buildroot%_libdir -ljpeg -o jpeginfo
install -pm755 exifautotran jpegexiforient jpeginfo %buildroot%_bindir/
# do not package unwanted libturbojpeg files
find %buildroot -name 'libturbojpeg.*a' -delete

%define docdir %_docdir/%name
rm -rf %buildroot%docdir
mkdir -p %buildroot%docdir
install -pm644 README* change.log \
coderules.txt libjpeg.txt.bz2 structure.txt.bz2 usage.txt.bz2 wizard.txt \

%files -n libjpeg
%dir %docdir

%files -n libjpeg-utils

%files -n libjpeg-devel
%dir %docdir

%if_enabled static
%files -n libjpeg-devel-static
%endif #static

%files -n libturbojpeg

%files -n libturbojpeg-devel


Full changelog you can see here

design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin