blob: 23793cf5063ef6bdad5e77f1211b4470bf5573a7 [file] [log] [blame]
DRC764e1e22013-04-19 04:25:14 +00001# 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
DRC3064cf72014-03-21 11:00:00 +000011%define _docdir /usr/share/doc/%{name}-%{version}
DRC764e1e22013-04-19 04:25:14 +000012
13# Path under which headers should be installed
14%define _includedir %{__includedir}
15
16# _libdir is set to %{_prefix}/%{_lib} by default
DRC079b4342010-02-15 11:32:23 +000017%ifarch x86_64
DRC764e1e22013-04-19 04:25:14 +000018%define _lib lib64
DRC079b4342010-02-15 11:32:23 +000019%else
DRC764e1e22013-04-19 04:25:14 +000020%if "%{_prefix}" == "/opt/libjpeg-turbo"
21%define _lib lib32
22%endif
DRC079b4342010-02-15 11:32:23 +000023%endif
24
DRC764e1e22013-04-19 04:25:14 +000025# Path under which man pages should be installed
26%define _mandir %{__mandir}
27
DRCf832eae2012-02-08 09:56:04 +000028Summary: A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs
DRC764e1e22013-04-19 04:25:14 +000029Name: @PKGNAME@
DRC1f80a102010-10-18 00:15:31 +000030Version: @VERSION@
DRC079b4342010-02-15 11:32:23 +000031Vendor: The libjpeg-turbo Project
DRCfad469f2011-04-30 04:43:23 +000032URL: http://www.libjpeg-turbo.org
DRC079b4342010-02-15 11:32:23 +000033Group: System Environment/Libraries
34#-->Source0: http://prdownloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-%{version}.tar.gz
DRC1f80a102010-10-18 00:15:31 +000035Release: @BUILD@
DRCb5624ee2011-05-24 14:12:07 +000036License: BSD-style
DRC079b4342010-02-15 11:32:23 +000037BuildRoot: %{_blddir}/%{name}-buildroot-%{version}-%{release}
38Prereq: /sbin/ldconfig
DRC9ba64bb2012-03-29 21:29:36 +000039%ifarch x86_64
DRC04e0a022013-05-01 06:03:53 +000040Provides: %{name} = %{version}-%{release}, @PACKAGE_NAME@ = %{version}-%{release}, libturbojpeg.so()(64bit)
DRC9ba64bb2012-03-29 21:29:36 +000041%else
DRC04e0a022013-05-01 06:03:53 +000042Provides: %{name} = %{version}-%{release}, @PACKAGE_NAME@ = %{version}-%{release}, libturbojpeg.so
DRC9ba64bb2012-03-29 21:29:36 +000043%endif
DRC079b4342010-02-15 11:32:23 +000044
45%description
DRC0f7ff712013-01-23 01:32:25 +000046libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
47NEON) to accelerate baseline JPEG compression and decompression on x86, x86-64,
48and ARM systems. On such systems, libjpeg-turbo is generally 2-4x as fast as
49libjpeg, all else being equal. On other types of systems, libjpeg-turbo can
50still outperform libjpeg by a significant amount, by virtue of its
51highly-optimized Huffman coding routines. In many cases, the performance of
52libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
DRC079b4342010-02-15 11:32:23 +000053
DRC0f7ff712013-01-23 01:32:25 +000054libjpeg-turbo implements both the traditional libjpeg API as well as the less
55powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
56colorspace extensions that allow it to compress from/decompress to 32-bit and
57big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java
58interface.
DRC0d2d9652011-02-18 22:29:45 +000059
DRC0f7ff712013-01-23 01:32:25 +000060libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated
61derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and
62VirtualGL projects made numerous enhancements to the codec in 2009, and in
63early 2010, libjpeg-turbo spun off into an independent project, with the goal
64of making high-speed JPEG compression/decompression technology available to a
65broader range of users and developers.
DRC079b4342010-02-15 11:32:23 +000066
67#-->%prep
DRC764e1e22013-04-19 04:25:14 +000068#-->%setup -q -n libjpeg-turbo-%{version}
DRC079b4342010-02-15 11:32:23 +000069
70#-->%build
DRC764e1e22013-04-19 04:25:14 +000071#-->./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
DRC079b4342010-02-15 11:32:23 +000077
78%install
79
80rm -rf $RPM_BUILD_ROOT
DRC764e1e22013-04-19 04:25:14 +000081make install DESTDIR=$RPM_BUILD_ROOT docdir=%{_docdir} exampledir=%{_docdir}
82rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
83/sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
84
85#-->%if 0
86
87LJT_LIBDIR=%{__libdir}
88if [ ! "$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.
90 exit 1
91fi
92
93#-->%endif
94
DRC7175e512013-04-23 22:29:00 +000095LJT_DOCDIR=%{__docdir}
96if [ "%{_prefix}" = "/opt/libjpeg-turbo" -a "$LJT_DOCDIR" = "/opt/libjpeg-turbo/doc" ]; then
97 ln -fs %{_docdir} $RPM_BUILD_ROOT/$LJT_DOCDIR
98fi
DRC079b4342010-02-15 11:32:23 +000099
100%post -p /sbin/ldconfig
101
102%postun -p /sbin/ldconfig
103
104%clean
105rm -rf $RPM_BUILD_ROOT
106
107%files
108%defattr(-,root,root)
DRC764e1e22013-04-19 04:25:14 +0000109%dir %{_docdir}
110%doc %{_docdir}/*
111%dir %{_prefix}
112%if "%{_prefix}" == "/opt/libjpeg-turbo" && "%{_docdir}" != "%{_prefix}/doc"
113 %{_prefix}/doc
DRCf12c7db2010-05-18 19:04:47 +0000114%endif
DRC764e1e22013-04-19 04:25:14 +0000115%dir %{_bindir}
116%{_bindir}/cjpeg
117%{_bindir}/djpeg
118%{_bindir}/jpegtran
119%{_bindir}/tjbench
120%{_bindir}/rdjpgcom
121%{_bindir}/wrjpgcom
122%dir %{_libdir}
123%{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@.@SO_AGE@.@SO_MINOR_VERSION@
124%{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@
125%{_libdir}/libjpeg.so
126%{_libdir}/libjpeg.a
DRC9495a942013-05-01 05:48:22 +0000127%{_libdir}/libturbojpeg.so.0.1.0
DRC764e1e22013-04-19 04:25:14 +0000128%{_libdir}/libturbojpeg.so.0
129%{_libdir}/libturbojpeg.so
130%{_libdir}/libturbojpeg.a
131%dir %{_includedir}
132%{_includedir}/jconfig.h
133%{_includedir}/jerror.h
134%{_includedir}/jmorecfg.h
135%{_includedir}/jpeglib.h
136%{_includedir}/turbojpeg.h
137%dir %{_mandir}
138%dir %{_mandir}/man1
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*
DRC7175e512013-04-23 22:29:00 +0000144%if "%{_prefix}" != "%{_datadir}"
145 %dir %{_datadir}
146%endif
DRCf2602ce2011-04-01 00:20:33 +0000147@JAVA_RPM_CONTENTS_1@
148@JAVA_RPM_CONTENTS_2@
DRC079b4342010-02-15 11:32:23 +0000149
150%changelog