1 # Path under which libjpeg-turbo should be installed
2 %define _prefix %{__prefix}
4 # Path under which executables should be installed
5 %define _bindir %{__bindir}
7 # Path under which Java classes and man pages should be installed
8 %define _datadir %{__datadir}
10 # Path under which docs should be installed
11 %define _docdir /usr/share/doc/%{name}-%{version}
13 # Path under which headers should be installed
14 %define _includedir %{__includedir}
16 # _libdir is set to %{_prefix}/%{_lib} by default
20 %if "%{_prefix}" == "/opt/libjpeg-turbo"
25 # Path under which man pages should be installed
26 %define _mandir %{__mandir}
28 Summary: A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs
31 Vendor: The libjpeg-turbo Project
32 URL: http://www.libjpeg-turbo.org
33 Group: System Environment/Libraries
34 #-->Source0: http://prdownloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-%{version}.tar.gz
37 BuildRoot: %{_blddir}/%{name}-buildroot-%{version}-%{release}
38 Prereq: /sbin/ldconfig
40 Provides: %{name} = %{version}-%{release}, @PACKAGE_NAME@ = %{version}-%{release}, libturbojpeg.so()(64bit)
42 Provides: %{name} = %{version}-%{release}, @PACKAGE_NAME@ = %{version}-%{release}, libturbojpeg.so
46 libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
47 NEON) to accelerate baseline JPEG compression and decompression on x86, x86-64,
48 and ARM systems. On such systems, libjpeg-turbo is generally 2-4x as fast as
49 libjpeg, all else being equal. On other types of systems, libjpeg-turbo can
50 still outperform libjpeg by a significant amount, by virtue of its
51 highly-optimized Huffman coding routines. In many cases, the performance of
52 libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
54 libjpeg-turbo implements both the traditional libjpeg API as well as the less
55 powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
56 colorspace extensions that allow it to compress from/decompress to 32-bit and
57 big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java
60 libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated
61 derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and
62 VirtualGL projects made numerous enhancements to the codec in 2009, and in
63 early 2010, libjpeg-turbo spun off into an independent project, with the goal
64 of making high-speed JPEG compression/decompression technology available to a
65 broader range of users and developers.
68 #-->%setup -q -n libjpeg-turbo-%{version}
71 #-->./configure prefix=%{_prefix} bindir=%{_bindir} datadir=%{_datadir} \
72 #--> docdir=%{_docdir} includedir=%{_includedir} libdir=%{_libdir} \
73 #--> mandir=%{_mandir} JPEG_LIB_VERSION=@JPEG_LIB_VERSION@ \
74 #--> SO_MAJOR_VERSION=@SO_MAJOR_VERSION@ SO_MINOR_VERSION=@SO_MINOR_VERSION@ \
75 #--> --with-pic @RPM_CONFIG_ARGS@
76 #-->make DESTDIR=$RPM_BUILD_ROOT
80 rm -rf $RPM_BUILD_ROOT
81 make install DESTDIR=$RPM_BUILD_ROOT docdir=%{_docdir} exampledir=%{_docdir}
82 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
83 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
87 LJT_LIBDIR=%{__libdir}
88 if [ ! "$LJT_LIBDIR" = "%{_libdir}" ]; then
89 echo ERROR: libjpeg-turbo must be configured with libdir=%{_prefix}/%{_lib} when generating an in-tree RPM for this architecture.
95 LJT_DOCDIR=%{__docdir}
96 if [ "%{_prefix}" = "/opt/libjpeg-turbo" -a "$LJT_DOCDIR" = "/opt/libjpeg-turbo/doc" ]; then
97 ln -fs %{_docdir} $RPM_BUILD_ROOT/$LJT_DOCDIR
100 %post -p /sbin/ldconfig
102 %postun -p /sbin/ldconfig
105 rm -rf $RPM_BUILD_ROOT
108 %defattr(-,root,root)
112 %if "%{_prefix}" == "/opt/libjpeg-turbo" && "%{_docdir}" != "%{_prefix}/doc"
123 %{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@.@SO_AGE@.@SO_MINOR_VERSION@
124 %{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@
125 %{_libdir}/libjpeg.so
127 %{_libdir}/libturbojpeg.so.0.0.0
128 %{_libdir}/libturbojpeg.so.0
129 %{_libdir}/libturbojpeg.so
130 %{_libdir}/libturbojpeg.a
132 %{_includedir}/jconfig.h
133 %{_includedir}/jerror.h
134 %{_includedir}/jmorecfg.h
135 %{_includedir}/jpeglib.h
136 %{_includedir}/turbojpeg.h
139 %{_mandir}/man1/cjpeg.1*
140 %{_mandir}/man1/djpeg.1*
141 %{_mandir}/man1/jpegtran.1*
142 %{_mandir}/man1/rdjpgcom.1*
143 %{_mandir}/man1/wrjpgcom.1*
144 %if "%{_prefix}" != "%{_datadir}"
147 @JAVA_RPM_CONTENTS_1@
148 @JAVA_RPM_CONTENTS_2@