1 |
%define libname_orig libpng |
2 |
%define major 3 |
3 |
%define libname %mklibname png %{major} |
4 |
%define develname %mklibname png -d |
5 |
%define staticname %mklibname png -d -s |
6 |
|
7 |
%bcond_without uclibc |
8 |
|
9 |
Summary: A library of functions for manipulating PNG image format files |
10 |
Name: libpng |
11 |
Version: 1.2.50 |
12 |
Release: %mkrel 1 |
13 |
Epoch: 2 |
14 |
License: zlib |
15 |
Group: System/Libraries |
16 |
URL: http://www.libpng.org/pub/png/libpng.html |
17 |
Source: http://downloads.sourceforge.net/libpng/%{name}-%{version}.tar.xz |
18 |
Patch0: http://downloads.sourceforge.net/libpng-apng/libpng-1.2.49-apng.patch.gz |
19 |
Patch1: libpng-1.2.36-pngconf-setjmp.patch |
20 |
Patch2: libpng-1.2.44-CVE-2008-6218.diff |
21 |
BuildRequires: zlib-devel |
22 |
%if %{with uclibc} |
23 |
BuildRequires: uClibc-devel |
24 |
%endif |
25 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
26 |
|
27 |
%description |
28 |
The libpng package contains a library of functions for creating and |
29 |
manipulating PNG (Portable Network Graphics) image format files. PNG is |
30 |
a bit-mapped graphics format similar to the GIF format. PNG was created to |
31 |
replace the GIF format, since GIF uses a patented data compression |
32 |
algorithm. |
33 |
|
34 |
Libpng should be installed if you need to manipulate PNG format image |
35 |
files. |
36 |
|
37 |
%package -n %{libname} |
38 |
Summary: A library of functions for manipulating PNG image format files |
39 |
Group: System/Libraries |
40 |
Provides: %{libname_orig} = %{epoch}:%{version}-%{release} |
41 |
|
42 |
%description -n %{libname} |
43 |
This package contains the library needed to run programs dynamically |
44 |
linked with libpng. |
45 |
|
46 |
%package -n %{develname} |
47 |
Summary: Development tools for programs to manipulate PNG image format files |
48 |
Group: Development/C |
49 |
Requires: %{libname} = %{epoch}:%{version}-%{release} |
50 |
Requires: zlib-devel |
51 |
Provides: %{libname_orig}-devel = %{epoch}:%{version}-%{release} |
52 |
Provides: png-devel = %{epoch}:%{version}-%{release} |
53 |
Obsoletes: %{mklibname png 3 -d} < 1.2.30 |
54 |
Provides: %mklibname png 3 -d |
55 |
|
56 |
%description -n %{develname} |
57 |
The libpng-devel package contains the header files and libraries |
58 |
necessary for developing programs using the PNG (Portable Network |
59 |
Graphics) library. |
60 |
|
61 |
If you want to develop programs which will manipulate PNG image format |
62 |
files, you should install libpng-devel. You'll also need to install the |
63 |
libpng package. |
64 |
|
65 |
%package -n %{staticname} |
66 |
Summary: Development static libraries |
67 |
Group: Development/C |
68 |
Requires: %{develname} = %{epoch}:%{version}-%{release} |
69 |
Requires: zlib-devel |
70 |
Provides: %{libname_orig}-static-devel = %{epoch}:%{version}-%{release} |
71 |
Provides: png-static-devel = %{epoch}:%{version}-%{release} |
72 |
Obsoletes: %{mklibname png 3 -d -s} < 1.2.30 |
73 |
Provides: %mklibname png 3 -d -s |
74 |
|
75 |
%description -n %{staticname} |
76 |
Libpng development static libraries. |
77 |
|
78 |
%package -n %{libname_orig}-source |
79 |
Summary: Source code of %{libname_orig} |
80 |
Group: Development/C |
81 |
|
82 |
%description -n %{libname_orig}-source |
83 |
This package contains the source code of %{libname_orig}. |
84 |
|
85 |
%prep |
86 |
%setup -q |
87 |
%patch0 -p1 -b .apng |
88 |
%patch1 -p0 -b .pngconf-setjmp |
89 |
%patch2 -p0 -b .CVE-2008-6218 |
90 |
./autogen.sh |
91 |
|
92 |
%build |
93 |
export CONFIGURE_TOP=`pwd` |
94 |
%if %{with uclibc} |
95 |
mkdir -p uclibc |
96 |
cd uclibc |
97 |
%configure2_5x CC="%{uclibc_cc}" \ |
98 |
CFLAGS="%{uclibc_cflags}" \ |
99 |
--enable-shared=no \ |
100 |
--enable-static=yes \ |
101 |
--with-pic |
102 |
%make |
103 |
cd .. |
104 |
%endif |
105 |
|
106 |
mkdir -p shared |
107 |
cd shared |
108 |
CFLAGS="%{optflags} -O3 -funroll-loops" \ |
109 |
%configure2_5x --with-pic |
110 |
%make |
111 |
cd .. |
112 |
|
113 |
%check |
114 |
make -C shared check |
115 |
|
116 |
%install |
117 |
rm -rf %{buildroot} |
118 |
%makeinstall_std -C shared |
119 |
%if %{with uclibc} |
120 |
install -m644 uclibc/.libs/libpng12.a -D %{buildroot}%{uclibc_root}%{_libdir}/libpng12.a |
121 |
ln -s libpng12.a %{buildroot}%{uclibc_root}%{_libdir}/libpng.a |
122 |
%endif |
123 |
|
124 |
install -d %{buildroot}%{_mandir}/man{3,5} |
125 |
install -m0644 {libpng,libpngpf}.3 %{buildroot}%{_mandir}/man3 |
126 |
install -m0644 png.5 %{buildroot}%{_mandir}/man5/png3.5 |
127 |
|
128 |
install -d %{buildroot}%{_prefix}/src/%{libname_orig} |
129 |
cp -a *.c *.h %{buildroot}%{_prefix}/src/%{libname_orig} |
130 |
|
131 |
# remove unpackaged files |
132 |
rm -rf %{buildroot}{%{_prefix}/man,%{_libdir}/lib*.la} |
133 |
|
134 |
#multiarch |
135 |
%multiarch_binaries %{buildroot}%{_bindir}/libpng12-config |
136 |
|
137 |
%clean |
138 |
rm -rf %{buildroot} |
139 |
|
140 |
%files -n %{libname} |
141 |
%defattr(-,root,root) |
142 |
%{_libdir}/*.so.%{major}* |
143 |
%{_libdir}/libpng12.so.* |
144 |
|
145 |
%files -n %{develname} |
146 |
%defattr(-,root,root) |
147 |
%doc *.txt example.c README TODO CHANGES |
148 |
%{_bindir}/libpng-config |
149 |
%{_bindir}/libpng12-config |
150 |
%multiarch %{multiarch_bindir}/libpng12-config |
151 |
%{_includedir}/* |
152 |
%{_libdir}/libpng12.so |
153 |
%{_libdir}/libpng.so |
154 |
%{_libdir}/pkgconfig/* |
155 |
%{_mandir}/man?/* |
156 |
|
157 |
%files -n %{staticname} |
158 |
%defattr(-,root,root) |
159 |
%{_libdir}/libpng*.a |
160 |
%if %{with uclibc} |
161 |
%{uclibc_root}%{_libdir}/libpng*.a |
162 |
%endif |
163 |
|
164 |
%files -n %{libname_orig}-source |
165 |
%defattr(-,root,root) |
166 |
%{_prefix}/src/%{libname_orig} |
167 |
|
168 |
|