File giflib.spec of Package giflib

#
# spec file for package giflib
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#



Name:           giflib
%define lname	libgif4
BuildRequires:  xorg-x11-libICE-devel xorg-x11-libSM-devel xorg-x11-libX11-devel xorg-x11-libXau-devel xorg-x11-libXdmcp-devel xorg-x11-libXt-devel
BuildRequires:  libtool
License:        MIT
Group:          System/Libraries
Url:            http://sourceforge.net/projects/giflib
Version:        4.1.6
Release:        23
Summary:        A Library for Working with GIF Images
Source:         giflib-%{version}.tar.bz2
Source2:        baselibs.conf
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Patch:          giflib-visibility.patch

%description
This Library allows manipulating GIF Image files. Since the LZW patents
have expired, giflib can again be used instead of libungif.

%package -n %lname
Summary:        A Library for Working with GIF Images
Group:          System/Libraries
Obsoletes:      giflib < %version-%release
Provides:       giflib = %version-%release
# bug437293
%ifarch ppc64
Obsoletes:      giflib-64bit
Obsoletes:      libungif-64bit
%endif
#
Provides:       libungif
%ifarch ia64 x86_64 s390x ppc64
Provides:       libungif.so.4()(64bit)
%else
Provides:       libungif.so.4
%endif
Obsoletes:      libungif

%description -n %lname
This Library allows manipulating GIF Image files. Since the LZW patents
have expired, giflib can again be used instead of libungif.

%package progs
License:        MIT
Summary:        Tools for Working with the GIF Library
Group:          Productivity/Graphics/Convertors
Provides:       ungif
Obsoletes:      ungif

%description progs
A tool for converting GIFs to various formats.

%package devel
License:        MIT
Summary:        Library for Working with GIF Images - Files Mandatory for Development
Group:          Development/Libraries/C and C++
Requires:       %lname = %version
# bug437293
%ifarch ppc64
Obsoletes:      giflib-devel-64bit
%endif
#

%description devel
This Library allows manipulating GIF Image files. Since the LZW patents
have expired, giflib can again be used instead of libungif.

%prep
%setup -q
%patch

%build
# USE __TIMESTAMP__ instead of __DATE__ , __TIME__
# this change is pointless unless we preserve the original 
# file modification time
for file in `find util -name "*.c"`; do 
	touch -r $file $file.stamp; 
	sed -i -e s@'__DATE__ ",   " __TIME__'@__TIMESTAMP__@g $file; 
    touch -r $file.stamp $file;
    rm -v $file.stamp
done

mkdir m4;autoreconf -fiv
%configure --disable-static --with-pic --x-libraries=%{_libdir}
make %{?_smp_mflags}

%install
make install DESTDIR=$RPM_BUILD_ROOT
chmod 755 $RPM_BUILD_ROOT/%{_libdir}/lib*.so.*
ln -sf libgif.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libungif.so.%{version}
ln -sf libungif.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libungif.so.4
ln -sf libungif.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libungif.so
#ln -sf libgif.a $RPM_BUILD_ROOT%{_libdir}/libungif.a
rm -f %{buildroot}%{_libdir}/*.la
find doc -name "Makefile*" -print -delete
nm -C -D %{buildroot}%{_libdir}/lib*.so

%post -n %lname -p /sbin/ldconfig

%postun -n %lname -p /sbin/ldconfig

%files -n %lname
%defattr(-,root,root)
%doc COPYING
%{_libdir}/lib*.so.*

%files devel
%defattr(-,root,root)
/usr/include/gif_lib.h
%{_libdir}/lib*.so

%files progs
%defattr(-,root,root)
%doc COPYING NEWS README doc
/usr/bin/*

%changelog
openSUSE Build Service is sponsored by