]> git.pld-linux.org Git - packages/libheif.git/blob - libheif.spec
- updated to 1.17.1
[packages/libheif.git] / libheif.spec
1 # MAYBE TODO: default codecs (aom, libde265, x265, jpeg) as plugins, package plugins in subpackages?
2 #
3 # Conditional build:
4 %bcond_with     golang          # Go examples
5 %bcond_without  static_libs     # static library
6 %bcond_with     tests           # testing
7 # AVIF
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
12 # HEVC
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
17 # JPEG
18 %bcond_without  jpeg            # JPEG codecs support
19 # JPEG-2000
20 %bcond_without  openjpeg        # OpenJPEG (J2K) codecs support
21
22 %ifnarch %{ix86} %{x8664} aarch64
23 %undefine       with_rav1e
24 %endif
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
27 Name:           libheif
28 Version:        1.17.1
29 Release:        1
30 License:        LGPL v3+ (library), GPL v3+ (tools)
31 Group:          Libraries
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}
39 # libavcodec
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)
57
58 %description
59 libheif is an ISO/IEC 23008-12:2017 HEIF file format decoder and
60 encoder.
61
62 HEIF is a new image file format employing HEVC (h.265) image coding
63 for the best compression ratios currently possible.
64
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
67 provided as plugins.
68
69 %description -l pl.UTF-8
70 libheif to koder i dekoder formatu plików HEIF, zgodnego z ISO/IEC
71 23008-12:2017.
72
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.
76
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.
80
81 %package devel
82 Summary:        Header files for libheif
83 Summary(de.UTF-8):      libheif Headers
84 Summary(pl.UTF-8):      Pliki nagłówkowe libheif
85 License:        LGPL v3+
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
93
94 %description devel
95 The header files are only needed for development of programs using the
96 libheif library.
97
98 %description devel -l pl.UTF-8
99 Pliki nagłówkowe, potrzebne jedynie do rozwijania oprogramowania
100 wykorzystującego bibliotekę libheif.
101
102 %package static
103 Summary:        Static libheif library
104 Summary(pl.UTF-8):      Statyczna biblioteka libheif
105 License:        LGPL v3+
106 Group:          Development/Libraries
107 Requires:       %{name}-devel = %{version}-%{release}
108
109 %description static
110 Static libheif library.
111
112 %description static -l pl.UTF-8
113 Statyczna biblioteka libheif.
114
115 %package progs
116 Summary:        libheif utility programs
117 Summary(pl.UTF-8):      Programy narzędziowe libheif
118 License:        GPL v3+
119 Group:          Applications/Graphics
120 Requires:       %{name} = %{version}-%{release}
121
122 %description progs
123 This package contains utility programs to convert HEIF files.
124
125 %description progs -l pl.UTF-8
126 Ten pakiet zawiera programy narzędziowe do konwersji plików HEIF.
127
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
131 Group:          Libraries
132 Requires:       %{name} = %{version}-%{release}
133
134 %description -n gdk-pixbuf2-loader-heif
135 gdk-pixbuf plugin to handle HEIF files.
136
137 %description -n gdk-pixbuf2-loader-heif -l pl.UTF-8
138 Wtyczka gdk-pixbuf do obsługi plików HEIF.
139
140 %prep
141 %setup -q
142
143 %build
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}
161
162 %{__make} -C build-static
163 %endif
164
165 %cmake -B build \
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}
182
183 %{__make} -C build
184
185 %{?with_tests:%{__make} -C build check}
186
187 %install
188 rm -rf $RPM_BUILD_ROOT
189
190 %if %{with static_libs}
191 %{__make} -C build-static install \
192         DESTDIR=$RPM_BUILD_ROOT
193 %endif
194
195 %{__make} -C build install \
196         DESTDIR=$RPM_BUILD_ROOT
197
198 %clean
199 rm -rf $RPM_BUILD_ROOT
200
201 %post   -p /sbin/ldconfig
202 %postun -p /sbin/ldconfig
203
204 %files
205 %defattr(644,root,root,755)
206 %doc README.md
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?
211 %if %{with dav1d}
212 %attr(755,root,root) %{_libdir}/libheif/libheif-dav1d.so
213 %endif
214 %if %{with ffmpeg}
215 %attr(755,root,root) %{_libdir}/libheif/libheif-ffmpegdec.so
216 %endif
217 %if %{with openjpeg}
218 %attr(755,root,root) %{_libdir}/libheif/libheif-j2kdec.so
219 %attr(755,root,root) %{_libdir}/libheif/libheif-j2kenc.so
220 %endif
221 %if %{with kvazaar}
222 %attr(755,root,root) %{_libdir}/libheif/libheif-kvazaar.so
223 %endif
224 %if %{with rav1e}
225 %attr(755,root,root) %{_libdir}/libheif/libheif-rav1e.so
226 %endif
227 %if %{with svtav1}
228 %attr(755,root,root) %{_libdir}/libheif/libheif-svtenc.so
229 %endif
230
231 %files devel
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
237
238 %if %{with static_libs}
239 %files static
240 %defattr(644,root,root,755)
241 %{_libdir}/libheif.a
242 %endif
243
244 %files progs
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*
255
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
This page took 0.133821 seconds and 4 git commands to generate.