]>
Commit | Line | Data |
---|---|---|
84d5f5a0 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with miniz # miniz instead of zlib | |
4 | %bcond_without static_libs # static library | |
5 | %bcond_with sse # SSE instructions | |
6 | %bcond_with sse2 # SSE2 instructions | |
7 | %bcond_with ssse3 # SSSE3 instructions | |
8 | %bcond_with sse41 # SSE4.1 instructions | |
9 | # | |
10 | %ifarch pentium3 pentium4 %{x8664} x32 | |
11 | %define with_sse 1 | |
12 | %endif | |
13 | %ifarch pentium4 %{x8664} x32 | |
14 | %define with_sse2 1 | |
15 | %endif | |
16 | %if %{without sse} || %{without sse2} || %{without ssse3} | |
17 | %undefine with_sse41 | |
18 | %endif | |
19 | %if %{without sse} || %{without sse2} | |
20 | %undefine with_ssse3 | |
21 | %endif | |
22 | %if %{without sse} | |
23 | %undefine with_sse2 | |
24 | %endif | |
25 | Summary: PNG decoding and encoding library | |
26 | Summary(pl.UTF-8): Biblioteka do dekodowania i kodowania PNG | |
27 | Name: libspng | |
4741b289 | 28 | Version: 0.7.4 |
84d5f5a0 JB |
29 | Release: 1 |
30 | License: BSD | |
31 | Group: Libraries | |
32 | #Source0Download: https://github.com/randy408/libspng/releases | |
33 | Source0: https://github.com/randy408/libspng/archive/v%{version}/%{name}-%{version}.tar.gz | |
4741b289 | 34 | # Source0-md5: 5072ee5d309c593080ea5f43e81e61e4 |
84d5f5a0 JB |
35 | URL: https://github.com/randy408/libspng |
36 | BuildRequires: meson | |
37 | %{?with_miniz:BuildRequires: miniz-devel} | |
38 | BuildRequires: ninja >= 1.5 | |
39 | BuildRequires: rpmbuild(macros) >= 1.736 | |
40 | %{!?with_miniz:BuildRequires: zlib-devel} | |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
42 | ||
43 | %description | |
44 | libspng is a C library for reading and writing Portable Network | |
45 | Graphics (PNG) format files with a focus on security and ease of use. | |
46 | ||
47 | libspng is an alternative to libpng, the projects are separate and the | |
48 | APIs are not compatible. | |
49 | ||
50 | %description -l pl.UTF-8 | |
51 | libspng to biblioteka C do odczytu i zapisu plików w formacie PNG | |
52 | (Portable Network Graphics), skupiająca się na bezpieczeństwie i | |
53 | łatwości użycia. | |
54 | ||
55 | libspng to alternatywa dla libpng - projekty są osobne, a API nie są | |
56 | kompatybilne. | |
57 | ||
58 | %package devel | |
59 | Summary: Header files for libspng library | |
60 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libspng | |
61 | Group: Development/Libraries | |
62 | Requires: %{name} = %{version}-%{release} | |
63 | %{?with_miniz:Requires: miniz-devel} | |
64 | %{!?with_miniz:Requires: zlib-devel} | |
65 | ||
66 | %description devel | |
67 | Header files for libspng library. | |
68 | ||
69 | %description devel -l pl.UTF-8 | |
70 | Pliki nagłówkowe biblioteki libspng. | |
71 | ||
72 | %package static | |
73 | Summary: Static libspng library | |
74 | Summary(pl.UTF-8): Statyczna biblioteka libspng | |
75 | Group: Development/Libraries | |
76 | Requires: %{name}-devel = %{version}-%{release} | |
77 | ||
78 | %description static | |
79 | Static libspng library. | |
80 | ||
81 | %description static -l pl.UTF-8 | |
82 | Statyczna biblioteka libspng. | |
83 | ||
84 | %prep | |
85 | %setup -q | |
86 | ||
87 | %build | |
88 | %if %{with sse2} | |
89 | CPPFLAGS="%{rpmcppflags} -DSPNG_SSE=%{?with_sse41:4}%{!?with_sse41:%{?with_ssse3:3}%{!?with_ssse3:2}}" | |
90 | %endif | |
91 | %meson build \ | |
92 | %if %{without sse} | |
93 | -Denable_opt=false \ | |
94 | %endif | |
95 | %{?with_miniz:-Duse_miniz=true} | |
96 | ||
97 | %ninja_build -C build | |
98 | ||
99 | %install | |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | ||
102 | %ninja_install -C build | |
103 | ||
104 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
105 | cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
106 | ||
107 | %clean | |
108 | rm -rf $RPM_BUILD_ROOT | |
109 | ||
110 | %post -p /sbin/ldconfig | |
111 | %postun -p /sbin/ldconfig | |
112 | ||
113 | %files | |
114 | %defattr(644,root,root,755) | |
4741b289 | 115 | %doc LICENSE README.md SECURITY.md |
84d5f5a0 JB |
116 | %attr(755,root,root) %{_libdir}/libspng.so.*.*.* |
117 | %attr(755,root,root) %ghost %{_libdir}/libspng.so.0 | |
118 | ||
119 | %files devel | |
120 | %defattr(644,root,root,755) | |
121 | %doc docs/*.md | |
122 | %attr(755,root,root) %{_libdir}/libspng.so | |
123 | %{_includedir}/spng.h | |
124 | %{_pkgconfigdir}/spng.pc | |
125 | %{_examplesdir}/%{name}-%{version} | |
126 | ||
127 | %if %{with static_libs} | |
128 | %files static | |
129 | %defattr(644,root,root,755) | |
130 | %{_libdir}/libspng.a | |
131 | %endif |