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
10 %ifarch pentium3 pentium4 %{x8664} x32
13 %ifarch pentium4 %{x8664} x32
16 %if %{without sse} || %{without sse2} || %{without ssse3}
19 %if %{without sse} || %{without sse2}
25 Summary: PNG decoding and encoding library
26 Summary(pl.UTF-8): Biblioteka do dekodowania i kodowania PNG
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
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)
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.
48 libspng is an alternative to libpng, the projects are separate and the
49 APIs are not compatible.
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
56 libspng to alternatywa dla libpng - projekty są osobne, a API nie są
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}
68 Header files for libspng library.
70 %description devel -l pl.UTF-8
71 Pliki nagłówkowe biblioteki libspng.
74 Summary: Static libspng library
75 Summary(pl.UTF-8): Statyczna biblioteka libspng
76 Group: Development/Libraries
77 Requires: %{name}-devel = %{version}-%{release}
80 Static libspng library.
82 %description static -l pl.UTF-8
83 Statyczna biblioteka libspng.
90 CPPFLAGS="%{rpmcppflags} -DSPNG_SSE=%{?with_sse41:4}%{!?with_sse41:%{?with_ssse3:3}%{!?with_ssse3:2}}"
96 %{?with_miniz:-Duse_miniz=true}
101 rm -rf $RPM_BUILD_ROOT
103 %ninja_install -C build
105 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
106 cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
109 rm -rf $RPM_BUILD_ROOT
111 %post -p /sbin/ldconfig
112 %postun -p /sbin/ldconfig
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
121 %defattr(644,root,root,755)
123 %attr(755,root,root) %{_libdir}/libspng.so
124 %{_includedir}/spng.h
125 %{_pkgconfigdir}/spng.pc
126 %{_examplesdir}/%{name}-%{version}
128 %if %{with static_libs}
130 %defattr(644,root,root,755)