]> git.pld-linux.org Git - packages/libspng.git/blame - libspng.spec
- new
[packages/libspng.git] / libspng.spec
CommitLineData
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
25Summary: PNG decoding and encoding library
26Summary(pl.UTF-8): Biblioteka do dekodowania i kodowania PNG
27Name: libspng
28Version: 0.6.1
29Release: 1
30License: BSD
31Group: Libraries
32#Source0Download: https://github.com/randy408/libspng/releases
33Source0: https://github.com/randy408/libspng/archive/v%{version}/%{name}-%{version}.tar.gz
34# Source0-md5: 1300ee3c8f78032e0eff9c65607d2a52
35#Patch0: %{name}-what.patch
36URL: https://github.com/randy408/libspng
37BuildRequires: meson
38%{?with_miniz:BuildRequires: miniz-devel}
39BuildRequires: ninja >= 1.5
40BuildRequires: rpmbuild(macros) >= 1.736
41%{!?with_miniz:BuildRequires: zlib-devel}
42BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44%description
45libspng is a C library for reading and writing Portable Network
46Graphics (PNG) format files with a focus on security and ease of use.
47
48libspng is an alternative to libpng, the projects are separate and the
49APIs are not compatible.
50
51%description -l pl.UTF-8
52libspng 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
56libspng to alternatywa dla libpng - projekty są osobne, a API nie są
57kompatybilne.
58
59%package devel
60Summary: Header files for libspng library
61Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libspng
62Group: Development/Libraries
63Requires: %{name} = %{version}-%{release}
64%{?with_miniz:Requires: miniz-devel}
65%{!?with_miniz:Requires: zlib-devel}
66
67%description devel
68Header files for libspng library.
69
70%description devel -l pl.UTF-8
71Pliki nagłówkowe biblioteki libspng.
72
73%package static
74Summary: Static libspng library
75Summary(pl.UTF-8): Statyczna biblioteka libspng
76Group: Development/Libraries
77Requires: %{name}-devel = %{version}-%{release}
78
79%description static
80Static libspng library.
81
82%description static -l pl.UTF-8
83Statyczna biblioteka libspng.
84
85%prep
86%setup -q
87
88%build
89%if %{with sse2}
90CPPFLAGS="%{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
101rm -rf $RPM_BUILD_ROOT
102
103%ninja_install -C build
104
105install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
106cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
107
108%clean
109rm -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
This page took 0.113078 seconds and 4 git commands to generate.