summaryrefslogtreecommitdiff
path: root/libjpeg-turbo.spec
blob: 2b3105a929a091ab08e3da1fe4115e3b6f310a44 (plain)
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
193
194
195
196
197
198
199
200
Name:           libjpeg-turbo
Version:        3.0.3
Release:        1
Summary:        MMX/SSE2/SIMD accelerated libjpeg-compatible JPEG codec library
License:        IJG
URL:            https://libjpeg-turbo.org/
Source0:        https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/%{version}/%{name}-%{version}.tar.gz
Patch0001:      Add-loongarch64.patch

BuildRequires:  gcc cmake libtool nasm

Obsoletes:      libjpeg < 6b-47 turbojpeg < %{version}-%{release}  
Provides:       libjpeg = 6b-47 turbojpeg = %{version}-%{release}  

%description
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec)
to accelerate baseline JPEG compression and decompression on x86, x86-64, and ARM systems.

%package        devel
Summary:        Development files for the libjpeg-turbo library
Requires:       libjpeg-turbo = %{version}-%{release}
Provides:       libjpeg-turbo-static = 1.3.1 turbojpeg-devel = %{version}-%{release}
Obsoletes:      libjpeg-turbo-static < 1.3.1 turbojpeg-devel < %{version}-%{release}
Provides:       libjpeg-devel = 6b-47 libjpeg-devel%{?_isa} = %{version}-%{release}
Obsoletes:      libjpeg-devel < 6b-47


%description devel
Development files for the libjpeg-turbo library.

%package utils
Summary:        Utilities for manipulating JPEG images
Requires:       libjpeg-turbo%{?_isa} = %{version}-%{release}
 
%description utils
The libjpeg-turbo-utils package contains simple client programs for accessing
the libjpeg functions. It contains cjpeg, djpeg, jpegtran, rdjpgcom and
wrjpgcom. Cjpeg compresses an image file into JPEG format. Djpeg decompresses a
JPEG file into a regular image file. Jpegtran can perform various useful
transformations on JPEG files. Rdjpgcom displays any text comments included in a
JPEG file. Wrjpgcom inserts text comments into a JPEG file.

%package -n turbojpeg
Summary:        TurboJPEG library
 
%description -n turbojpeg
The turbojpeg package contains the TurboJPEG shared library.

%package -n turbojpeg-devel
Summary:        Headers for the TurboJPEG library
Requires:       turbojpeg%{?_isa} = %{version}-%{release}
 
%description -n turbojpeg-devel
This package contains header files necessary for developing programs which will
manipulate JPEG files using the TurboJPEG library.

%package_help

%prep
%autosetup -n %{name}-%{version} -p1

%build
%{cmake} -DCMAKE_INSTALL_LIBDIR=%{_libdir} -DCMAKE_SKIP_RPATH:BOOL=YES -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES -DENABLE_STATIC:BOOL=NO . \
%ifarch riscv64
    -DFLOATTEST=fp-contract \
%endif
    %{nil}

%cmake_build

%install
%cmake_install

chmod -x README.md

%ifarch x86_64
  %global wordsize "64"
%else
  %global wordsize ""
%endif

if test -n "$wordsize"
then
  pushd $RPM_BUILD_ROOT%{_includedir}
    mv jconfig.h jconfig-$wordsize.h
    cat > jconfig.h <<EOF
#ifndef JCONFIG_H_MULTILIB
#define JCONFIG_H_MULTILIB

#include <bits/wordsize.h>

#if __WORDSIZE == 32
# include "jconfig-32.h"
#elif __WORDSIZE == 64
# include "jconfig-64.h"
#else
# error "unexpected value for __WORDSIZE macro"
#endif

#endif
EOF
fi
    
%check
%ctest

%files
%doc README.*
%license LICENSE.md
%{_libdir}/libjpeg.so.62*

%files devel
%doc coderules.txt jconfig.txt libjpeg.txt structure.txt
%exclude %{_includedir}/turbojpeg.h
%{_includedir}/*.h
%{_libdir}/libjpeg.so
%{_libdir}/pkgconfig/libjpeg.pc
%{_libdir}/cmake/%{name}/%{name}*.cmake

%files utils
%doc usage.txt wizard.txt
%{_bindir}/cjpeg
%{_bindir}/djpeg
%{_bindir}/jpegtran
%{_bindir}/rdjpgcom
%{_bindir}/wrjpgcom
%{_bindir}/tjbench

%files -n turbojpeg
%license LICENSE.md
%{_libdir}/libturbojpeg.so.0*

%files -n turbojpeg-devel
%doc tjexample.c
%{_includedir}/turbojpeg.h
%{_libdir}/libturbojpeg.so
%{_libdir}/pkgconfig/libturbojpeg.pc

%files help
%doc ChangeLog.md
%{_mandir}/man1/*.1*

%changelog
* Mon Aug 12 2024 Funda Wang <fundawang@yeah.net> - 3.0.3-1
- update to 3.0.3

* Tue Apr 16 2024 Wenlong Zhang <zhangwenlong@loongson.cn> - 3.0.1-2
- add loongarch64 support for libjpeg-turbo

* Mon Jan 8 2024 zhangpan <zhangpan103@h-partners.com> - 3.0.1-1
- update to 3.0.1

* Fri Jul 21 2023 zhangpan <zhangpan103@h-partners.com> - 3.0.0-1
- update to 3.0.0

* Mon Jul 10 2023 Jingwiw  <wangjingwei@iscas.ac.cn> - 2.1.1-6
- add riscv64 support

* Mon Apr 24 2023 guoqinglan <guoqinglan@kylinsec.com.cn> - 2.1.1-5
- fix build error for sw_64

* Thu Nov 17 2022 doupengda <doupengda@loongson.cn> - 2.1.1-4
- add loongarch64 support

* Wed Jul 13 2022 wangkerong <wangkerong@h-partners.com> - 2.1.1-3
- utils provide by libjpeg-turbo-utils subpackage,the main package shouldn't provide it

* Wed Mar 30 2022 liuyumeng <liuyumeng5@h-partners.com> - 2.1.1-2
- enable tests

* Sat Nov 27 2021 wangkerong <wangkerong@huawei.com> - 2.1.1-1
- update to 2.1.1
- splite utils turbojpeg turbojpeg-devel subpackages

* Wed Jan 27 2021 hanhui <hanhui15@huawei.com> - 2.0.6-1
- Type: enhancement
- ID:   NA
- SUG:  NA
- DESC: update to 2.0.6

* Wed Jul 22 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.0.5-1
- Type:enhancement
- Id:NA
- SUG:NA
- DESC:upgrade to 2.0.5

* Tue Jan 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.0.0-4
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:remove the libjpeg-devel with arch in obsoletes

* Fri Nov 1 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.0.0-3
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:add the libjpeg-devel and jconfig.h

* Sat Sep 21 2019 Lijin Yang <yanglijin@huawei.com> - 2.0.0-2
- Package init