Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37038842
en ru br
Репозитории ALT

Группа :: Система/Библиотеки
Пакет: libjpeg-turbo

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   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
Url: http://sourceforge.net/projects/%name/

# http://download.sourceforge.net/%name/%name-%version.tar.gz

Source: %name-%version-%release.tar
Source2: http://jpegclub.org/jpegexiforient.c
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
%endif

%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
%endif

%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
%endif

%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

%description
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.

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

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'
jinit_c_master_control;
jinit_color_converter;
jinit_master_decompress;
jinit_downsampler;
jpeg_std_message_table;
local: *;
};
EOF

%build
%{?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'
%cmake_build
# 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
%else
%add_optflags -fprofile-use
%endif
%endif

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

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

%install
%cmake_install
%__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 \
%buildroot%docdir/

%files -n libjpeg
%_libdir/libjpeg.so.*
%dir %docdir
%docdir/[CLR]*

%files -n libjpeg-utils
%_bindir/*
%_mandir/man?/*

%files -n libjpeg-devel
%_libdir/libjpeg.so
%_includedir/j*
%dir %docdir
%docdir/[^CLR]*
%_pkgconfigdir/libjpeg.pc
%_libdir/cmake/libjpeg-turbo

%if_enabled static
%files -n libjpeg-devel-static
%_libdir/libjpeg.a
%endif #static

%files -n libturbojpeg
%_libdir/libturbojpeg.so.*

%files -n libturbojpeg-devel
%_libdir/libturbojpeg.so
%_includedir/turbojpeg.h
%_pkgconfigdir/libturbojpeg.pc

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin