Hash :
952191da
Author :
Date :
2016-12-03T14:21:11
Build: Fix issues when building as a Git submodule - Replace CMAKE_SOURCE_DIR with CMAKE_CURRENT_SOURCE_DIR - Replace CMAKE_BINARY_DIR with CMAKE_CURRENT_BINARY_DIR - Don't use "libjpeg-turbo" in any of the package system filenames (because CMAKE_PROJECT_NAME will not be the same if building LJT as a submodule.) Closes #122
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
%define _prefix @CMAKE_INSTALL_PREFIX@
%define _bindir @BINDIR@
%define _datadir @DATADIR@
%define _docdir %{_defaultdocdir}/%{name}-%{version}
%define _includedir @INCLUDEDIR@
%define _libdir @LIBDIR@
%define _mandir @MANDIR@
%define _enable_static @ENABLE_STATIC@
%define _enable_shared @ENABLE_SHARED@
%define _with_turbojpeg @WITH_TURBOJPEG@
%define _with_java @WITH_JAVA@
Summary: A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs
Name: @PKGNAME@
Version: @VERSION@
Vendor: @PKGVENDOR@
URL: @PKGURL@
Group: System Environment/Libraries
#-->Source0: http://prdownloads.sourceforge.net/@CMAKE_PROJECT_NAME@/@CMAKE_PROJECT_NAME@-%{version}.tar.gz
Release: @BUILD@
License: BSD-style
BuildRoot: %{_blddir}/%{name}-buildroot-%{version}-%{release}
Prereq: /sbin/ldconfig
%ifarch x86_64
Provides: %{name} = %{version}-%{release}, @CMAKE_PROJECT_NAME@ = %{version}-%{release}, libturbojpeg.so()(64bit)
%else
Provides: %{name} = %{version}-%{release}, @CMAKE_PROJECT_NAME@ = %{version}-%{release}, libturbojpeg.so
%endif
%description
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
AVX2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression
on x86, x86-64, ARM, and PowerPC systems. On such systems, libjpeg-turbo is
generally 2-6x as fast as libjpeg, all else being equal. On other types of
systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by
virtue of its highly-optimized Huffman coding routines. In many cases, the
performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
libjpeg-turbo implements both the traditional libjpeg API as well as the less
powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
colorspace extensions that allow it to compress from/decompress to 32-bit and
big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java
interface.
libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated
derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and
VirtualGL projects made numerous enhancements to the codec in 2009, and in
early 2010, libjpeg-turbo spun off into an independent project, with the goal
of making high-speed JPEG compression/decompression technology available to a
broader range of users and developers.
#-->%prep
#-->%setup -q -n @CMAKE_PROJECT_NAME@-%{version}
#-->%build
#-->cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ \
#--> -DCMAKE_INSTALL_PREFIX=%{_prefix} \
#--> -DCMAKE_POSITION_INDEPENDENT_CODE=@CMAKE_POSITION_INDEPENDENT_CODE@ \
#--> -DBINDIR=%{_bindir} -DBUILD=%{release} -DDATADIR=%{_datadir} \
#--> -DDOCDIR=%{_docdir} \
#--> -DSO_MAJOR_VERSION=@SO_MAJOR_VERSION@ \
#--> -DSO_MINOR_VERSION=@SO_MINOR_VERSION@ \
#--> -DENABLE_SHARED=@ENABLE_SHARED@ -DENABLE_STATIC=@ENABLE_STATIC@ \
#--> -DINCLUDEDIR=%{_includedir} -DJPEG_LIB_VERSION=@JPEG_LIB_VERSION@ \
#--> -DLIBDIR=%{_libdir} -DMANDIR=%{_mandir} \
#--> -DREQUIRE_SIMD=@REQUIRE_SIMD@ \
#--> -DWITH_12BIT=@WITH_12BIT@ -DWITH_ARITH_DEC=@WITH_ARITH_DEC@ \
#--> -DWITH_ARITH_ENC=@WITH_ARITH_ENC@ -DWITH_JAVA=@WITH_JAVA@ \
#--> -DWITH_JPEG7=@WITH_JPEG7@ -DWITH_JPEG8=@WITH_JPEG8@ \
#--> -DWITH_MEM_SRCDST=@WITH_MEM_SRCDST@ -DWITH_SIMD=@WITH_SIMD@ \
#--> -DWITH_TURBOJPEG=@WITH_TURBOJPEG@ .
#-->make DESTDIR=$RPM_BUILD_ROOT
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
/sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
#-->%if 0
# This is only needed to support in-tree RPM generation via 'make rpm'. When
# building from a SRPM, we control where things are installed via CMake
# variables.
safedirmove ()
{
if [ "$1" = "$2" ]; then
return 0
fi
if [ "$1" = "" -o ! -d "$1" ]; then
echo safedirmove: source dir $1 is not valid
return 1
fi
if [ "$2" = "" -o -e "$2" ]; then
echo safedirmove: dest dir $2 is not valid
return 1
fi
if [ "$3" = "" -o -e "$3" ]; then
echo safedirmove: tmp dir $3 is not valid
return 1
fi
mkdir -p $3
mv $1/* $3/
rmdir $1
mkdir -p $2
mv $3/* $2/
rmdir $3
return 0
}
LJT_DOCDIR=@DOCDIR@
if [ ! "$LJT_DOCDIR" = "%{_docdir}" ]; then
safedirmove $RPM_BUILD_ROOT/$LJT_DOCDIR $RPM_BUILD_ROOT/%{_docdir} $RPM_BUILD_ROOT/__tmpdoc
fi
#-->%endif
LJT_DOCDIR=@DOCDIR@
if [ "%{_prefix}" = "@DEFAULT_CMAKE_INSTALL_PREFIX@" -a "$LJT_DOCDIR" = "@DEFAULT_CMAKE_INSTALL_PREFIX@/doc" ]; then
ln -fs %{_docdir} $RPM_BUILD_ROOT/$LJT_DOCDIR
fi
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%dir %{_docdir}
%doc %{_docdir}/*
%dir %{_prefix}
%if "%{_prefix}" == "@DEFAULT_CMAKE_INSTALL_PREFIX@" && "%{_docdir}" != "%{_prefix}/doc"
%{_prefix}/doc
%endif
%dir %{_bindir}
%{_bindir}/cjpeg
%{_bindir}/djpeg
%{_bindir}/jpegtran
%if "%{_with_turbojpeg}" == "1"
%{_bindir}/tjbench
%endif
%{_bindir}/rdjpgcom
%{_bindir}/wrjpgcom
%dir %{_libdir}
%if "%{_enable_shared}" == "1"
%{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@.@SO_AGE@.@SO_MINOR_VERSION@
%{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@
%{_libdir}/libjpeg.so
%endif
%if "%{_enable_static}" == "1"
%{_libdir}/libjpeg.a
%endif
%{_libdir}/pkgconfig
%{_libdir}/pkgconfig/libjpeg.pc
%if "%{_with_turbojpeg}" == "1"
%if "%{_enable_shared}" == "1" || "%{_with_java}" == "1"
%{_libdir}/libturbojpeg.so.@TURBOJPEG_SO_VERSION@
%{_libdir}/libturbojpeg.so.@TURBOJPEG_SO_MAJOR_VERSION@
%{_libdir}/libturbojpeg.so
%endif
%if "%{_enable_static}" == "1"
%{_libdir}/libturbojpeg.a
%endif
%{_libdir}/pkgconfig/libturbojpeg.pc
%endif
%dir %{_includedir}
%{_includedir}/jconfig.h
%{_includedir}/jerror.h
%{_includedir}/jmorecfg.h
%{_includedir}/jpeglib.h
%if "%{_with_turbojpeg}" == "1"
%{_includedir}/turbojpeg.h
%endif
%dir %{_mandir}
%dir %{_mandir}/man1
%{_mandir}/man1/cjpeg.1*
%{_mandir}/man1/djpeg.1*
%{_mandir}/man1/jpegtran.1*
%{_mandir}/man1/rdjpgcom.1*
%{_mandir}/man1/wrjpgcom.1*
%if "%{_prefix}" != "%{_datadir}"
%dir %{_datadir}
%endif
%if "%{_with_java}" == "1"
%dir %{_datadir}/classes
%{_datadir}/classes/turbojpeg.jar
%endif
%changelog