Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > main-src > by-pkgid > 332fb31b67789f0055fe41ca880a3c28 > files > 5

netpbm-9.20-2mdk.src.rpm

%define name	netpbm
%define version 9.20
%define release 2mdk

%define major	9
%define libname lib%{name}%{major}

Summary:	Tools for manipulating graphics files in netpbm supported formats
Name:		%name
Version:	%version
Release:	%release
License:	GPL
Group:		Graphics

Source0:	netpbm-9.20-nojbig.tar.bz2
Source1:	mf50-netpbm_filters
Source2:	test-images.tar.bz2

Patch0:		netpbm-9.8-install.patch.bz2
Patch1:		netpbm-9.9-time.patch.bz2

BuildRequires:	flex gcc libjpeg-devel libpng-devel libtiff-devel
Buildroot:	%{_tmppath}/%{name}-%{version}-root-%(id -u -n)
Requires:	%{libname} = %version-%release
Obsoletes:	libgr-progs, libgr1-progs
Provides:	libgr-progs, libgr1-progs
Url:		http://netpbm.sourceforge.net/

%description
The netpbm package contains a library of functions which support
programs for handling various graphics file formats, including .pbm
(portable bitmaps), .pgm (portable graymaps), .pnm (portable anymaps),
.ppm (portable pixmaps) and others.

%package	-n %{libname}
Summary:        A library for handling different graphics file formats
Group:          System/Libraries
Provides:	lib%name
Provides:	libgr, libgr1, libnetpbm1
Obsoletes:      libgr, libgr1, libnetpbm1
Url:		http://netpbm.sourceforge.net/

%description 	-n %{libname}
The netpbm package contains a library of functions which support
programs for handling various graphics file formats, including .pbm
(portable bitmaps), .pgm (portable graymaps), .pnm (portable anymaps),
.ppm (portable pixmaps) and others.

%package 	-n %{libname}-devel
Summary:	Development tools for programs which will use the netpbm libraries
Group:		Development/C
Requires:	%{libname} = %version-%release
Provides:	lib%{name}-devel
Obsoletes:	libgr-devel, libgr1-devel, libnetpbm1-devel
Provides:	libgr-devel, libgr1-devel, libnetpbm1-devel
Url:		http://netpbm.sourceforge.net/

%description 	-n %{libname}-devel
The netpbm-devel package contains the header files and programmer's
documentation for developing programs which can handle the various
graphics file formats supported by the netpbm libraries.

Install netpbm-devel if you want to develop programs for handling the
graphics file formats supported by the netpbm libraries. You'll also
need to have the netpbm package installed.


%prep
%setup -q -a 2
%patch0 -p1 -b .install
%patch1 -p1 -b .time

mv shhopt/shhopt.h shhopt/pbmshhopt.h
perl -pi -e 's|shhopt.h|pbmshhopt.h|g' `find -name "*.c" -o -name "*.h"` ./GNUmakefile

%build
./configure <<EOF
gnu
/usr



EOF

TOP=`pwd`
make \
	CC=%{__cc} \
	CFLAGS="$RPM_OPT_FLAGS -fPIC" \
	LDFLAGS="-L$TOP/pbm -L$TOP/pgm -L$TOP/pnm -L$TOP/ppm" \
	JPEGINC_DIR=%{_includedir} \
	PNGINC_DIR=%{_includedir} \
	TIFFINC_DIR=%{_includedir} \
	JPEGLIB_DIR=%{_libdir} \
	PNGLIB_DIR=%{_libdir} \
	TIFFLIB_DIR=%{_libdir}


%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT/usr/share/printconf/mf_rules
cp %{SOURCE1} $RPM_BUILD_ROOT/usr/share/printconf/mf_rules/

mkdir -p $RPM_BUILD_ROOT/usr/share/printconf/tests
cp test-images/* $RPM_BUILD_ROOT/usr/share/printconf/tests/

PATH="`pwd`:${PATH}" make install \
	JPEGINC_DIR=$RPM_BUILD_ROOT%{_includedir} \
	PNGINC_DIR=$RPM_BUILD_ROOT%{_includedir} \
	TIFFINC_DIR=$RPM_BUILD_ROOT%{_includedir} \
	JPEGLIB_DIR=%{_libdir} \
	PNGLIB_DIR=%{_libdir} \
	TIFFLIB_DIR=%{_libdir} \
	INSTALL_PREFIX=$RPM_BUILD_ROOT%{_prefix} \
	INSTALLBINARIES=$RPM_BUILD_ROOT%{_bindir} \
	INSTALLHDRS=$RPM_BUILD_ROOT%{_includedir} \
	INSTALLLIBS=$RPM_BUILD_ROOT%{_libdir} \
	INSTALLMANUALS1=$RPM_BUILD_ROOT%{_mandir}/man1 \
	INSTALLMANUALS3=$RPM_BUILD_ROOT%{_mandir}/man3 \
	INSTALLMANUALS5=$RPM_BUILD_ROOT%{_mandir}/man5

# Install header files.
mkdir -p $RPM_BUILD_ROOT%{_includedir}
install -m644 pbm/pbm.h $RPM_BUILD_ROOT%{_includedir}/
#install -m644 pbmplus.h $RPM_BUILD_ROOT%{_includedir}/
install -m644 pgm/pgm.h $RPM_BUILD_ROOT%{_includedir}/
install -m644 pnm/pnm.h $RPM_BUILD_ROOT%{_includedir}/
install -m644 ppm/ppm.h $RPM_BUILD_ROOT%{_includedir}/
install -m644 shhopt/pbmshhopt.h $RPM_BUILD_ROOT%{_includedir}/

# Install the static-only librle.a
install -m644 urt/{rle,rle_config}.h $RPM_BUILD_ROOT%{_includedir}/
install -m644 urt/librle.a $RPM_BUILD_ROOT%{_libdir}/

# Fixup symlinks.
ln -sf gemtopnm $RPM_BUILD_ROOT%{_bindir}/gemtopbm
ln -sf pnmtoplainpnm $RPM_BUILD_ROOT%{_bindir}/pnmnoraw

# Fixup perl paths in the two scripts that require it.
perl -pi -e 's^/bin/perl^%{__perl}^' \
$RPM_BUILD_ROOT%{_bindir}/{ppmfade,ppmshadow}

%clean
rm -rf $RPM_BUILD_ROOT

%post   -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig

%files 	-n %{libname}
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/lib*.so.*
%doc COPYRIGHT.PATENT GPL_LICENSE.txt HISTORY README 

%files 	-n %{libname}-devel
%defattr(644,root,root,755)
%doc README.CONFOCAL COPYRIGHT.PATENT Netpbm.programming
%{_includedir}/*.h
%attr(755,root,root) %{_libdir}/lib*.so
%{_mandir}/man3/*
%{_libdir}/*.a

%files
%defattr(644,root,root,755)
%doc COPYRIGHT.PATENT
%attr(755,root,root) %{_bindir}/*
%{_mandir}/man[15]/*

%changelog
* Sun Jan 27 2002 Stefan van der Eijk <stefan@eijk.nu> 9.20-2mdk
- BuildRequires

* Tue Jan 22 2002 Chmouel Boudjnah <chmouel@mandrakesoft.com> 9.20-1mdk
- Merge with RH.
- 9.20 (whooooooooooo).

* Wed Oct 10 2001 Till Kamppeter <till@mandrakesoft.com> 9.10-8mdk
- Another attempt to recompile it with libpng3

* Fri Oct 05 2001 Yves Duret <yduret@mandrakesoft.com> 9.10-7mdk
- recompiled with libpng3
- macros

* Sat Sep 09 2001 David BAUDENS <baudens@mandrakesoft.com> 9.10-6mdk
- Fix %%major number
- Requires %%version-%%release and not only %%version
- Fix %%doc

* Mon Aug 27 2001 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 9.10-5mdk
- Explicitly use /sbin/ldconfig

* Wed Aug 08 2001 Yves Duret <yduret@mandrakesoft.com> 9.10-4mdk
- added a builrequires to zlib-devel (Buchan Milne <bgmilne@cae.co.za>)
- corrected the 4 no-ldconfig-symlink errors (thx titi)

* Fri Jul 27 2001 Frederic Lepied <flepied@mandrakesoft.com> 9.10-3mdk
- added missing obsoletes on libgr1-progs

* Fri Jul 27 2001 Yves Duret <yduret@mandrakesoft.com> 9.10-2mdk
- added patch2 to fix bad include netpbm-shhopt.h
- added provides libgr

* Tue Jul 24 2001 Yves Duret <yduret@mandrakesoft.com> 9.10-1mdk
- first MandrakeSoft package (stolen from d3bi4n and PLD)
    Obsoletes libgr libgr-progs libgr-devel