1 # MAYBE TODO: default codecs (aom, libde265, x265, jpeg) as plugins, package plugins in subpackages?
4 %bcond_with golang # Go examples
5 %bcond_without static_libs # static library
6 %bcond_with tests # testing
8 %bcond_without aom # aom AVIF decoder/encoder
9 %bcond_with dav1d # dav1d AVIF decoder
10 %bcond_with svtav1 # SVT-AV1 AVIF encoder
11 %bcond_with rav1e # rav1e AVIF encoder
13 %bcond_with ffmpeg # FFmpeg HEVC decoder (hw accelerated)
14 %bcond_with kvazaar # kvazaar HEVC encoder
15 %bcond_without libde265 # libde265 HEVC decoder
16 %bcond_without x265 # x265 HEVC encoder
18 %bcond_without jpeg # JPEG codecs support
20 %bcond_without openjpeg # OpenJPEG (J2K) codecs support
22 %ifnarch %{ix86} %{x8664} aarch64
25 Summary: ISO/IEC 23008-12:2017 HEIF file format decoder and encoder
26 Summary(pl.UTF-8): Koder i dekoder formatu plików HEIF zgodnego z ISO/IEC 23008-12:2017
30 License: LGPL v3+ (library), GPL v3+ (tools)
32 #Source0Download: https://github.com/strukturag/libheif/releases/
33 Source0: https://github.com/strukturag/libheif/releases/download/v%{version}/%{name}-%{version}.tar.gz
34 # Source0-md5: 7a5b2a82de971209cac999de20e0e95f
35 URL: https://github.com/strukturag/libheif
36 %{?with_aom:BuildRequires: aom-devel}
37 BuildRequires: cmake >= 3.16.3
38 %{?with_dav1d:BuildRequires: dav1d-devel}
40 %{?with_ffmpeg:BuildRequires: ffmpeg-devel}
41 BuildRequires: gdk-pixbuf2-devel >= 2.0
42 %{?with_golang:BuildRequires: golang >= 1.6}
43 %{?with_kvazaar:BuildRequires: kvazaar-devel}
44 %{?with_libde265:BuildRequires: libde265-devel >= 1.0.7}
45 %{?with_jpeg:BuildRequires: libjpeg-devel}
46 BuildRequires: libpng-devel
47 BuildRequires: libsharpyuv-devel
48 BuildRequires: libstdc++-devel >= 6:4.7
49 %{?with_x265:BuildRequires: libx265-devel}
50 %{?with_openjpeg:BuildRequires: openjpeg2-devel >= 2}
51 BuildRequires: pkgconfig
52 %{?with_rav1e:BuildRequires: rav1e-devel}
53 %{?with_svtav1:BuildRequires: svt-av1-devel}
54 BuildRequires: rpmbuild(macros) >= 1.734
55 %{?with_libde265:Requires: libde265 >= 1.0.7}
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 libheif is an ISO/IEC 23008-12:2017 HEIF file format decoder and
62 HEIF is a new image file format employing HEVC (h.265) image coding
63 for the best compression ratios currently possible.
65 libheif makes use of libde265 for the actual image decoding and x265
66 for encoding. Alternative codecs for, e.g., AVC and JPEG can be
69 %description -l pl.UTF-8
70 libheif to koder i dekoder formatu plików HEIF, zgodnego z ISO/IEC
73 HEIF to nowy format plików obrazów wykorzystujący kodowanie obrazu
74 HEVC (h.265) w celu osiągnięcia najwyższych dostepnych obecnie
75 współczynników kompresji.
77 libheif wykorzystuje libde265 do właściwego procesu dekodowania obrazu
78 oraz x265 do kodowania. Alternatywne kodeki do np. AVC czy JPEG mogą
79 być dostarczone jako wtyczki.
82 Summary: Header files for libheif
83 Summary(de.UTF-8): libheif Headers
84 Summary(pl.UTF-8): Pliki nagłówkowe libheif
86 Group: Development/Libraries
87 Requires: %{name} = %{version}-%{release}
88 %{?with_aom:Requires: aom-devel}
89 Requires: libde265-devel >= 1.0.7
90 Requires: libsharpyuv-devel
91 Requires: libstdc++-devel >= 6:4.7
92 Requires: libx265-devel
95 The header files are only needed for development of programs using the
98 %description devel -l pl.UTF-8
99 Pliki nagłówkowe, potrzebne jedynie do rozwijania oprogramowania
100 wykorzystującego bibliotekę libheif.
103 Summary: Static libheif library
104 Summary(pl.UTF-8): Statyczna biblioteka libheif
106 Group: Development/Libraries
107 Requires: %{name}-devel = %{version}-%{release}
110 Static libheif library.
112 %description static -l pl.UTF-8
113 Statyczna biblioteka libheif.
116 Summary: libheif utility programs
117 Summary(pl.UTF-8): Programy narzędziowe libheif
119 Group: Applications/Graphics
120 Requires: %{name} = %{version}-%{release}
123 This package contains utility programs to convert HEIF files.
125 %description progs -l pl.UTF-8
126 Ten pakiet zawiera programy narzędziowe do konwersji plików HEIF.
128 %package -n gdk-pixbuf2-loader-heif
129 Summary: gdk-pixbuf plugin to handle HEIF files
130 Summary(pl.UTF-8): Wtyczka gdk-pixbuf do obsługi plików HEIF
132 Requires: %{name} = %{version}-%{release}
134 %description -n gdk-pixbuf2-loader-heif
135 gdk-pixbuf plugin to handle HEIF files.
137 %description -n gdk-pixbuf2-loader-heif -l pl.UTF-8
138 Wtyczka gdk-pixbuf do obsługi plików HEIF.
144 %if %{with static_libs}
145 %cmake -B build-static \
146 -DBUILD_SHARED_LIBS=OFF \
147 -DENABLE_PLUGIN_LOADING=OFF \
148 %{!?with_aom:-DWITH_AOM_DECODER=OFF} \
149 %{!?with_aom:-DWITH_AOM_ENCODER=OFF} \
150 %{?with_dav1d:-DWITH_DAV1D=ON} \
151 %{?with_ffmpeg:-DWITH_FFMPEG_DECODER=ON} \
152 %{?with_jpeg:-DWITH_JPEG_DECODER=ON} \
153 %{?with_jpeg:-DWITH_JPEG_ENCODER=ON} \
154 %{?with_kvazaar:-DWITH_KVAZAAR=ON} \
155 %{!?with_libde265:-DWITH_LIBDE265=OFF} \
156 %{?with_openjpeg:-DWITH_OpenJPEG_DECODER=ON} \
157 %{?with_openjpeg:-DWITH_OpenJPEG_ENCODER=ON} \
158 %{?with_rav1e:-DWITH_RAV1E=ON} \
159 %{?with_svtav1:-DWITH_SvtEnc=ON} \
160 %{!?with_x265:-DWITH_X265=OFF}
162 %{__make} -C build-static
166 %{?with_tests:-DBUILD_TESTING=ON} \
167 %{!?with_aom:-DWITH_AOM_DECODER=OFF} \
168 %{!?with_aom:-DWITH_AOM_ENCODER=OFF} \
169 %{?with_dav1d:-DWITH_DAV1D=ON} \
170 %{?with_ffmpeg:-DWITH_FFMPEG_DECODER=ON} \
171 %{?with_ffmpeg:-DWITH_FFMPEG_DECODER_PLUGIN=ON} \
172 %{?with_jpeg:-DWITH_JPEG_DECODER=ON} \
173 %{?with_jpeg:-DWITH_JPEG_ENCODER=ON} \
174 %{?with_kvazaar:-DWITH_KVAZAAR=ON} \
175 %{?with_kvazaar:-DWITH_KVAZAAR_PLUGIN=ON} \
176 %{!?with_libde265:-DWITH_LIBDE265=OFF} \
177 %{?with_openjpeg:-DWITH_OpenJPEG_DECODER=ON} \
178 %{?with_openjpeg:-DWITH_OpenJPEG_ENCODER=ON} \
179 %{?with_rav1e:-DWITH_RAV1E=ON} \
180 %{?with_svtav1:-DWITH_SvtEnc=ON} \
181 %{!?with_x265:-DWITH_X265=OFF}
185 %{?with_tests:%{__make} -C build check}
188 rm -rf $RPM_BUILD_ROOT
190 %if %{with static_libs}
191 %{__make} -C build-static install \
192 DESTDIR=$RPM_BUILD_ROOT
195 %{__make} -C build install \
196 DESTDIR=$RPM_BUILD_ROOT
199 rm -rf $RPM_BUILD_ROOT
201 %post -p /sbin/ldconfig
202 %postun -p /sbin/ldconfig
205 %defattr(644,root,root,755)
207 %attr(755,root,root) %{_libdir}/libheif.so.*.*.*
208 %attr(755,root,root) %ghost %{_libdir}/libheif.so.1
209 %dir %{_libdir}/libheif
210 # TODO: subpackages with plugins?
212 %attr(755,root,root) %{_libdir}/libheif/libheif-dav1d.so
215 %attr(755,root,root) %{_libdir}/libheif/libheif-ffmpegdec.so
218 %attr(755,root,root) %{_libdir}/libheif/libheif-j2kdec.so
219 %attr(755,root,root) %{_libdir}/libheif/libheif-j2kenc.so
222 %attr(755,root,root) %{_libdir}/libheif/libheif-kvazaar.so
225 %attr(755,root,root) %{_libdir}/libheif/libheif-rav1e.so
228 %attr(755,root,root) %{_libdir}/libheif/libheif-svtenc.so
232 %defattr(644,root,root,755)
233 %attr(755,root,root) %{_libdir}/libheif.so
234 %{_includedir}/libheif
235 %{_pkgconfigdir}/libheif.pc
236 %{_libdir}/cmake/libheif
238 %if %{with static_libs}
240 %defattr(644,root,root,755)
245 %defattr(644,root,root,755)
246 %attr(755,root,root) %{_bindir}/heif-convert
247 %attr(755,root,root) %{_bindir}/heif-enc
248 %attr(755,root,root) %{_bindir}/heif-info
249 %attr(755,root,root) %{_bindir}/heif-thumbnailer
250 %{_datadir}/thumbnailers/heif.thumbnailer
251 %{_mandir}/man1/heif-convert.1*
252 %{_mandir}/man1/heif-enc.1*
253 %{_mandir}/man1/heif-info.1*
254 %{_mandir}/man1/heif-thumbnailer.1*
256 %files -n gdk-pixbuf2-loader-heif
257 %defattr(644,root,root,755)
258 %attr(755,root,root) %{_libdir}/gdk-pixbuf-2.0/2.*/loaders/libpixbufloader-heif.so