1Name: libjpeg-turbo 2Version: 2.1.1 3Release: 5 4Summary: MMX/SSE2/SIMD accelerated libjpeg-compatible JPEG codec library 5License: IJG 6URL: http://sourceforge.net/projects/libjpeg-turbo 7Source0: http://downloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-%{version}.tar.gz 8%ifarch loongarch64 9Patch0001: Add-loongarch64.patch 10%endif 11 12BuildRequires: gcc cmake libtool nasm 13 14Obsoletes: libjpeg < 6b-47 turbojpeg < %{version}-%{release} 15Provides: libjpeg = 6b-47 turbojpeg = %{version}-%{release} 16 17%description 18libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) 19to accelerate baseline JPEG compression and decompression on x86, x86-64, and ARM systems. 20 21%package devel 22Summary: Development files for the libjpeg-turbo library 23Requires: libjpeg-turbo = %{version}-%{release} 24Provides: libjpeg-turbo-static = 1.3.1 turbojpeg-devel = %{version}-%{release} 25Obsoletes: libjpeg-turbo-static < 1.3.1 turbojpeg-devel < %{version}-%{release} 26Provides: libjpeg-devel = 6b-47 libjpeg-devel%{?_isa} = %{version}-%{release} 27Obsoletes: libjpeg-devel < 6b-47 28 29 30%description devel 31Development files for the libjpeg-turbo library. 32 33%package utils 34Summary: Utilities for manipulating JPEG images 35Requires: libjpeg-turbo%{?_isa} = %{version}-%{release} 36 37%description utils 38The libjpeg-turbo-utils package contains simple client programs for accessing 39the libjpeg functions. It contains cjpeg, djpeg, jpegtran, rdjpgcom and 40wrjpgcom. Cjpeg compresses an image file into JPEG format. Djpeg decompresses a 41JPEG file into a regular image file. Jpegtran can perform various useful 42transformations on JPEG files. Rdjpgcom displays any text comments included in a 43JPEG file. Wrjpgcom inserts text comments into a JPEG file. 44 45%package -n turbojpeg 46Summary: TurboJPEG library 47 48%description -n turbojpeg 49The turbojpeg package contains the TurboJPEG shared library. 50 51%package -n turbojpeg-devel 52Summary: Headers for the TurboJPEG library 53Requires: turbojpeg%{?_isa} = %{version}-%{release} 54 55%description -n turbojpeg-devel 56This package contains header files necessary for developing programs which will 57manipulate JPEG files using the TurboJPEG library. 58 59%package_help 60 61%prep 62%autosetup -n %{name}-%{version} -p1 63 64%build 65%{cmake} -DCMAKE_INSTALL_LIBDIR=%{_libdir} -DCMAKE_SKIP_RPATH:BOOL=YES -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES -DENABLE_STATIC:BOOL=NO . 66 67%make_build V=1 68 69%install 70%make_install 71%delete_la 72 73chmod -x README.md 74 75%ifarch x86_64 76 %global wordsize "64" 77%else 78 %global wordsize "" 79%endif 80 81if test -n "$wordsize" 82then 83 pushd $RPM_BUILD_ROOT%{_includedir} 84 mv jconfig.h jconfig-$wordsize.h 85 cat > jconfig.h <<EOF 86#ifndef JCONFIG_H_MULTILIB 87#define JCONFIG_H_MULTILIB 88 89#include <bits/wordsize.h> 90 91#if __WORDSIZE == 32 92# include "jconfig-32.h" 93#elif __WORDSIZE == 64 94# include "jconfig-64.h" 95#else 96# error "unexpected value for __WORDSIZE macro" 97#endif 98 99#endif 100EOF 101fi 102 103%check 104LD_LIBRARY_PATH=%{buildroot}%{_libdir} make test %{?_smp_mflags} 105 106%ldconfig_scriptlets 107 108%files 109%defattr(-,root,root) 110%doc README.* 111%license LICENSE.md 112%{_libdir}/libjpeg.so.62* 113%exclude /usr/share/doc/libjpeg-turbo/* 114 115%files devel 116%doc coderules.txt jconfig.txt libjpeg.txt structure.txt example.txt 117%exclude %{_includedir}/turbojpeg.h 118%{_includedir}/*.h 119%{_libdir}/libjpeg.so 120%{_libdir}/pkgconfig/libjpeg.pc 121%{_libdir}/cmake/%{name}/%{name}*.cmake 122 123%files utils 124%doc usage.txt wizard.txt 125%{_bindir}/cjpeg 126%{_bindir}/djpeg 127%{_bindir}/jpegtran 128%{_bindir}/rdjpgcom 129%{_bindir}/wrjpgcom 130%{_bindir}/tjbench 131 132%files -n turbojpeg 133%license LICENSE.md 134%{_libdir}/libturbojpeg.so.0* 135 136%files -n turbojpeg-devel 137%doc tjexample.c 138%{_includedir}/turbojpeg.h 139%{_libdir}/libturbojpeg.so 140%{_libdir}/pkgconfig/libturbojpeg.pc 141 142%files help 143%doc ChangeLog.md 144%{_mandir}/man1/*.1* 145 146%changelog 147* Mon Apr 24 2023 guoqinglan <guoqinglan@kylinsec.com.cn> - 2.1.1-5 148- fix build error for sw_64 149 150* Thu Nov 17 2022 doupengda <doupengda@loongson.cn> - 2.1.1-4 151- add loongarch64 support 152 153* Wed Jul 13 2022 wangkerong <wangkerong@h-partners.com> - 2.1.1-3 154- utils provide by libjpeg-turbo-utils subpackage,the main package shouldn't provide it 155 156* Wed Mar 30 2022 liuyumeng <liuyumeng5@h-partners.com> - 2.1.1-2 157- enable tests 158 159* Sat Nov 27 2021 wangkerong <wangkerong@huawei.com> - 2.1.1-1 160- update to 2.1.1 161- splite utils turbojpeg turbojpeg-devel subpackages 162 163* Wed Jan 27 2021 hanhui <hanhui15@huawei.com> - 2.0.6-1 164- Type: enhancement 165- ID: NA 166- SUG: NA 167- DESC: update to 2.0.6 168 169* Wed Jul 22 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.0.5-1 170- Type:enhancement 171- Id:NA 172- SUG:NA 173- DESC:upgrade to 2.0.5 174 175* Tue Jan 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.0.0-4 176- Type:bugfix 177- Id:NA 178- SUG:NA 179- DESC:remove the libjpeg-devel with arch in obsoletes 180 181* Fri Nov 1 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.0.0-3 182- Type:bugfix 183- Id:NA 184- SUG:NA 185- DESC:add the libjpeg-devel and jconfig.h 186 187* Sat Sep 21 2019 Lijin Yang <yanglijin@huawei.com> - 2.0.0-2 188- Package init 189