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