• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Path under which libjpeg-turbo should be installed
2%define _prefix %{__prefix}
3
4# Path under which executables should be installed
5%define _bindir %{__bindir}
6
7# Path under which Java classes and man pages should be installed
8%define _datadir %{__datadir}
9
10# Path under which docs should be installed
11%define _docdir /usr/share/doc/%{name}-%{version}
12
13# Path under which headers should be installed
14%define _includedir %{__includedir}
15
16%if "%{?__isa_bits:1}" == "1"
17%define _bits %{__isa_bits}
18%else
19# RPM < 4.6
20%if "%{_lib}" == "lib64"
21%define _bits 64
22%else
23%define _bits 32
24%endif
25%endif
26
27%if "%{_bits}" == "64"
28%define _libdir %{_exec_prefix}/lib64
29%else
30%if "%{_prefix}" == "/opt/libjpeg-turbo"
31%define _libdir %{_exec_prefix}/lib32
32%endif
33%endif
34
35# Path under which man pages should be installed
36%define _mandir %{__mandir}
37
38Summary: A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs
39Name: @PKGNAME@
40Version: @VERSION@
41Vendor: The libjpeg-turbo Project
42URL: http://www.libjpeg-turbo.org
43Group: System Environment/Libraries
44#-->Source0: http://prdownloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-%{version}.tar.gz
45Release: @BUILD@
46License: BSD-style
47BuildRoot: %{_blddir}/%{name}-buildroot-%{version}-%{release}
48Prereq: /sbin/ldconfig
49%if "%{_bits}" == "64"
50Provides: %{name} = %{version}-%{release}, @PACKAGE_NAME@ = %{version}-%{release}, libturbojpeg.so()(64bit)
51%else
52Provides: %{name} = %{version}-%{release}, @PACKAGE_NAME@ = %{version}-%{release}, libturbojpeg.so
53%endif
54
55%description
56libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
57NEON, AltiVec) to accelerate baseline JPEG compression and decompression on
58x86, x86-64, ARM, and PowerPC systems.  On such systems, libjpeg-turbo is
59generally 2-6x as fast as libjpeg, all else being equal.  On other types of
60systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by
61virtue of its highly-optimized Huffman coding routines.  In many cases, the
62performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
63
64libjpeg-turbo implements both the traditional libjpeg API as well as the less
65powerful but more straightforward TurboJPEG API.  libjpeg-turbo also features
66colorspace extensions that allow it to compress from/decompress to 32-bit and
67big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java
68interface.
69
70libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated
71derivative of libjpeg v6b developed by Miyasaka Masaru.  The TigerVNC and
72VirtualGL projects made numerous enhancements to the codec in 2009, and in
73early 2010, libjpeg-turbo spun off into an independent project, with the goal
74of making high-speed JPEG compression/decompression technology available to a
75broader range of users and developers.
76
77#-->%prep
78#-->%setup -q -n libjpeg-turbo-%{version}
79
80#-->%build
81#-->./configure prefix=%{_prefix} bindir=%{_bindir} datadir=%{_datadir} \
82#-->	docdir=%{_docdir} includedir=%{_includedir} libdir=%{_libdir} \
83#-->	mandir=%{_mandir} JPEG_LIB_VERSION=@JPEG_LIB_VERSION@ \
84#-->	SO_MAJOR_VERSION=@SO_MAJOR_VERSION@ SO_MINOR_VERSION=@SO_MINOR_VERSION@ \
85#-->	--with-pic @RPM_CONFIG_ARGS@
86#-->export NUMCPUS=`grep -c '^processor' /proc/cpuinfo`
87#-->make -j$NUMCPUS --load-average=$NUMCPUS DESTDIR=$RPM_BUILD_ROOT
88
89%install
90
91rm -rf $RPM_BUILD_ROOT
92make install DESTDIR=$RPM_BUILD_ROOT docdir=%{_docdir} exampledir=%{_docdir}
93rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
94/sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
95
96#-->%if 0
97
98LJT_LIBDIR=%{__libdir}
99if [ ! "$LJT_LIBDIR" = "%{_libdir}" ]; then
100	echo ERROR: libjpeg-turbo must be configured with libdir=%{_libdir} when generating an in-tree RPM for this architecture.
101	exit 1
102fi
103
104#-->%endif
105
106LJT_DOCDIR=%{__docdir}
107if [ "%{_prefix}" = "/opt/libjpeg-turbo" -a "$LJT_DOCDIR" = "/opt/libjpeg-turbo/doc" ]; then
108	ln -fs %{_docdir} $RPM_BUILD_ROOT/$LJT_DOCDIR
109fi
110
111%post -p /sbin/ldconfig
112
113%postun -p /sbin/ldconfig
114
115%clean
116rm -rf $RPM_BUILD_ROOT
117
118%files
119%defattr(-,root,root)
120%dir %{_docdir}
121%doc %{_docdir}/*
122%dir %{_prefix}
123%if "%{_prefix}" == "/opt/libjpeg-turbo" && "%{_docdir}" != "%{_prefix}/doc"
124 %{_prefix}/doc
125%endif
126%dir %{_bindir}
127%{_bindir}/cjpeg
128%{_bindir}/djpeg
129%{_bindir}/jpegtran
130%{_bindir}/tjbench
131%{_bindir}/rdjpgcom
132%{_bindir}/wrjpgcom
133%dir %{_libdir}
134%{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@.@SO_AGE@.@SO_MINOR_VERSION@
135%{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@
136%{_libdir}/libjpeg.so
137%{_libdir}/libjpeg.a
138%{_libdir}/pkgconfig
139%{_libdir}/pkgconfig/libjpeg.pc
140%{_libdir}/libturbojpeg.so.0.1.0
141%{_libdir}/libturbojpeg.so.0
142%{_libdir}/libturbojpeg.so
143%{_libdir}/libturbojpeg.a
144%{_libdir}/pkgconfig/libturbojpeg.pc
145%dir %{_includedir}
146%{_includedir}/jconfig.h
147%{_includedir}/jerror.h
148%{_includedir}/jmorecfg.h
149%{_includedir}/jpeglib.h
150%{_includedir}/turbojpeg.h
151%dir %{_mandir}
152%dir %{_mandir}/man1
153%{_mandir}/man1/cjpeg.1*
154%{_mandir}/man1/djpeg.1*
155%{_mandir}/man1/jpegtran.1*
156%{_mandir}/man1/rdjpgcom.1*
157%{_mandir}/man1/wrjpgcom.1*
158%if "%{_prefix}" != "%{_datadir}"
159 %dir %{_datadir}
160%endif
161@JAVA_RPM_CONTENTS_1@
162@JAVA_RPM_CONTENTS_2@
163
164%changelog
165