]>
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 | |
28 | Version: 0.6.1 | |
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 | |
34 | # Source0-md5: 1300ee3c8f78032e0eff9c65607d2a52 | |
35 | #Patch0: %{name}-what.patch | |
36 | URL: https://github.com/randy408/libspng | |
37 | BuildRequires: meson | |
38 | %{?with_miniz:BuildRequires: miniz-devel} | |
39 | BuildRequires: ninja >= 1.5 | |
40 | BuildRequires: rpmbuild(macros) >= 1.736 | |
41 | %{!?with_miniz:BuildRequires: zlib-devel} | |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
43 | ||
44 | %description | |
45 | libspng is a C library for reading and writing Portable Network | |
46 | Graphics (PNG) format files with a focus on security and ease of use. | |
47 | ||
48 | libspng is an alternative to libpng, the projects are separate and the | |
49 | APIs are not compatible. | |
50 | ||
51 | %description -l pl.UTF-8 | |
52 | libspng to biblioteka C do odczytu i zapisu plików w formacie PNG | |
53 | (Portable Network Graphics), skupiająca się na bezpieczeństwie i | |
54 | łatwości użycia. | |
55 | ||
56 | libspng to alternatywa dla libpng - projekty są osobne, a API nie są | |
57 | kompatybilne. | |
58 | ||
59 | %package devel | |
60 | Summary: Header files for libspng library | |
61 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libspng | |
62 | Group: Development/Libraries | |
63 | Requires: %{name} = %{version}-%{release} | |
64 | %{?with_miniz:Requires: miniz-devel} | |
65 | %{!?with_miniz:Requires: zlib-devel} | |
66 | ||
67 | %description devel | |
68 | Header files for libspng library. | |
69 | ||
70 | %description devel -l pl.UTF-8 | |
71 | Pliki nagłówkowe biblioteki libspng. | |
72 | ||
73 | %package static | |
74 | Summary: Static libspng library | |
75 | Summary(pl.UTF-8): Statyczna biblioteka libspng | |
76 | Group: Development/Libraries | |
77 | Requires: %{name}-devel = %{version}-%{release} | |
78 | ||
79 | %description static | |
80 | Static libspng library. | |
81 | ||
82 | %description static -l pl.UTF-8 | |
83 | Statyczna biblioteka libspng. | |
84 | ||
85 | %prep | |
86 | %setup -q | |
87 | ||
88 | %build | |
89 | %if %{with sse2} | |
90 | CPPFLAGS="%{rpmcppflags} -DSPNG_SSE=%{?with_sse41:4}%{!?with_sse41:%{?with_ssse3:3}%{!?with_ssse3:2}}" | |
91 | %endif | |
92 | %meson build \ | |
93 | %if %{without sse} | |
94 | -Denable_opt=false \ | |
95 | %endif | |
96 | %{?with_miniz:-Duse_miniz=true} | |
97 | ||
98 | %ninja_build -C build | |
99 | ||
100 | %install | |
101 | rm -rf $RPM_BUILD_ROOT | |
102 | ||
103 | %ninja_install -C build | |
104 | ||
105 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
106 | cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
107 | ||
108 | %clean | |
109 | rm -rf $RPM_BUILD_ROOT | |
110 | ||
111 | %post -p /sbin/ldconfig | |
112 | %postun -p /sbin/ldconfig | |
113 | ||
114 | %files | |
115 | %defattr(644,root,root,755) | |
116 | %doc LICENSE README.md | |
117 | %attr(755,root,root) %{_libdir}/libspng.so.*.*.* | |
118 | %attr(755,root,root) %ghost %{_libdir}/libspng.so.0 | |
119 | ||
120 | %files devel | |
121 | %defattr(644,root,root,755) | |
122 | %doc docs/*.md | |
123 | %attr(755,root,root) %{_libdir}/libspng.so | |
124 | %{_includedir}/spng.h | |
125 | %{_pkgconfigdir}/spng.pc | |
126 | %{_examplesdir}/%{name}-%{version} | |
127 | ||
128 | %if %{with static_libs} | |
129 | %files static | |
130 | %defattr(644,root,root,755) | |
131 | %{_libdir}/libspng.a | |
132 | %endif |