]> git.pld-linux.org Git - packages/libbpg.git/blob - libbpg.spec
d205ad77b87bade609e3e9c04d06db0d71b752cb
[packages/libbpg.git] / libbpg.spec
1 #
2 # Conditional build:
3 %bcond_without  sdl     # SDL based viewer
4 %bcond_with     x265    # x265 support in BPG encoder
5 #
6 Summary:        A library of functions for manipulating BPG image format files
7 Summary(pl.UTF-8):      Biblioteka funkcji do operacji na plikach obrazów w formacie BPG
8 Name:           libbpg
9 Version:        0.9.5
10 Release:        2
11 # The original BPG code is BSD-licensed, while the modified FFmpeg library is under LGPLv2.1.
12 License:        LGPL v2.1 and BSD
13 Group:          Libraries
14 Source0:        http://bellard.org/bpg/%{name}-%{version}.tar.gz
15 # Source0-md5:  30d1619656955fb3fbba5fe9f9f27f67
16 Patch0:         %{name}-shared.patch
17 URL:            http://bellard.org/bpg/
18 %if %{with sdl}
19 BuildRequires:  SDL-devel
20 BuildRequires:  SDL_image-devel
21 %endif
22 BuildRequires:  libjpeg-devel
23 BuildRequires:  libpng-devel
24 BuildRequires:  libstdc++-devel
25 BuildRequires:  libtool >= 2:1.5
26 %{?with_x265:BuildRequires:     libx265-devel}
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 BPG (Better Portable Graphics) is a image format whose purpose is to
31 replace the JPEG image format when quality or file size is an issue.
32
33 Its main advantages are:
34 - High compression ratio. Files are much smaller than JPEG for similar
35   quality.
36 - Supported by most Web browsers with a small JavaScript decoder.
37 - Based on a subset of the HEVC open video compression standard.
38 - Supports the same chroma formats as JPEG (grayscale, YCbCr 4:2:0,
39   4:2:2, 4:4:4) to reduce the losses during the conversion. An alpha
40   channel is supported. The RGB, YCgCo and CMYK color spaces are also
41   supported.
42 - Native support of 8 to 14 bits per channel for a higher dynamic
43   range.
44 - Lossless compression is supported.
45 - Various metadata (such as EXIF, ICC profile, XMP) can be included.
46
47 %description -l pl.UTF-8
48 BPG (Better Portable Graphics - lepsza przenośna grafika) to format
49 obrazu, którego celem jest zastąpienie formatu JPEG tam, gdzie ma
50 znaczenie jakość lub rozmiar pliku.
51
52 Główne zalety to:
53 - ma wysoki współczynnik kompresji; pliki są znacznie mniejsze niż
54   JPEG o podobnej jakości
55 - jest obsługiwany przez większość przeglądarek WWW przy użyciu małego
56   dekodera w JavaScripcie
57 - jest oparty na podzbiorze otwartego standardu kompresji obrazu HEVC
58 - obsługuje te same schematy barw, co JPEG (odcienie szarości, YCbCr
59   4:2:0, 4:2:2, 4:4:4) w celu ograniczenia strat przy konwersji;
60   obsługiwany jest kanał alfa oraz przestrzenie barw RGB, YCgCo i CMYK
61 - ma natywną obsługę 8 i 14 bitów na kanał w celu zapewnienia większej
62   dynamiki
63 - obsługiwana jest kompresja bezstratna
64 - można dołączać różne metadane (jak EXIF, profil ICC, XMP).
65
66 %package devel
67 Summary:        Development files for libbpg library
68 Summary(pl.UTF-8):      Pliki programistyczne biblioteki libbpg
69 Group:          Development/Libraries
70 Requires:       %{name} = %{version}-%{release}
71
72 %description devel
73 This package contains the header files for developing applications
74 that use libbpg.
75
76 %description devel -l pl.UTF-8
77 Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji
78 wykorzystujących libbpg.
79
80 %package static
81 Summary:        Static libbpg library
82 Summary(pl.UTF-8):      Statyczna biblioteka libbpg
83 Group:          Development/Libraries
84 Requires:       %{name}-devel = %{version}-%{release}
85
86 %description static
87 Static libbpg library.
88
89 %description static -l pl.UTF-8
90 Statyczna biblioteka libbpg.
91
92 %package tools
93 Summary:        Tools to encode and decode BPG files
94 Summary(pl.UTF-8):      Narzędzia do kodowania i dekodowania plików BPG
95 Group:          Applications/Graphics
96 Requires:       %{name} = %{version}-%{release}
97
98 %description tools
99 Tools to encode and decode BPG files.
100
101 %description tools -l pl.UTF-8
102 Narzędzia do kodowania i dekodowania plików BPG.
103
104 %package view
105 Summary:        SDL based BPG images viewer
106 Summary(pl.UTF-8):      Oparta na SDL przeglądarka obrazów BPG
107 Group:          Applications/Graphics
108 Requires:       %{name} = %{version}-%{release}
109
110 %description view
111 SDL based BPG images viewer.
112
113 %description view -l pl.UTF-8
114 Oparta na SDL przeglądarka obrazów BPG.
115
116 %prep
117 %setup -q
118 %patch0 -p1
119
120 %{__sed} -i -e 's,-Os,$(OPTFLAGS),' Makefile
121 %{__sed} -i -e 's#LDFLAGS=-g#LDFLAGS=%{rpmldflags}#' Makefile
122
123 %build
124 %{__make} \
125         CC="%{__cc}" \
126         CXX="%{__cxx}" \
127         OPTFLAGS="%{rpmcflags}" \
128         %{!?with_sdl:USE_BPGVIEW=} \
129         %{?with_x265:USE_X265=y} \
130         libdir=%{_libdir}
131
132 %install
133 rm -rf $RPM_BUILD_ROOT
134
135 %{__make} install install-lib \
136         DESTDIR=$RPM_BUILD_ROOT \
137         prefix=%{_prefix} \
138         libdir=%{_libdir}
139
140 %if %{with sdl}
141 install bpgview $RPM_BUILD_ROOT%{_bindir}
142 %endif
143
144 # no external dependencies
145 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libbpg.la
146
147 %clean
148 rm -rf $RPM_BUILD_ROOT
149
150 %post   -p /sbin/ldconfig
151 %postun -p /sbin/ldconfig
152
153 %files
154 %defattr(644,root,root,755)
155 %doc ChangeLog README doc/bpg_spec.txt html post.js
156 %attr(755,root,root) %{_libdir}/libbpg.so.*.*.*
157 %attr(755,root,root) %ghost %{_libdir}/libbpg.so.0
158
159 %files devel
160 %defattr(644,root,root,755)
161 %attr(755,root,root) %{_libdir}/libbpg.so
162 %{_includedir}/bpgenc.h
163 %{_includedir}/libbpg.h
164
165 %files static
166 %defattr(644,root,root,755)
167 %{_libdir}/libbpg.a
168
169 %files tools
170 %defattr(644,root,root,755)
171 %attr(755,root,root) %{_bindir}/bpgdec
172 %attr(755,root,root) %{_bindir}/bpgenc
173
174 %if %{with sdl}
175 %files view
176 %defattr(644,root,root,755)
177 %attr(755,root,root) %{_bindir}/bpgview
178 %endif
This page took 0.151475 seconds and 3 git commands to generate.