File gmime.spec of Package gmime

#
# spec file for package gmime (Version 2.2.11)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

Name:           gmime
BuildRequires:  glib-sharp2 glib2-devel gtk-doc gtk-sharp2 gtk-sharp2-gapi mono-devel zlib-devel
%if %suse_version <= 1020
BuildRequires: sgml-skel
%endif
Version:        2.2.11
Release:        21
Url:            http://spruce.sourceforge.net/gmime/
Group:          Productivity/Networking/Email/Utilities
License:        LGPL v2.1 or later; Public Domain, Freeware; X11/MIT
Summary:        MIME Library Utilities
Source:         %{name}-%{version}.tar.bz2
Patch:          gmime-cflags.patch
Patch1:         gmime-no-off_t-api.patch
Patch2:         gmime-no-off_t-at-all.patch
Patch3:         gmime-monoreq.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       libgmime-2_0-3 = %{version}

%description
GMime is a set of utilities for parsing and creating messages using the
Multipurpose Internet Mail Extension (MIME).



Authors:
--------
    Jeffrey Stedfast <fejj@gnome.org>

%package -n libgmime-2_0-3
Group:          Development/Libraries/C and C++
Summary:        MIME Library
Requires:       %{name} >= %{version}

%description -n libgmime-2_0-3
GMime is a set of utilities for parsing and creating messages using the
Multipurpose Internet Mail Extension (MIME).



Authors:
--------
    Jeffrey Stedfast <fejj@gnome.org>

%package sharp
Group:          Development/Libraries/Other
Summary:        MIME Library Mono Bindings
Requires:       libgmime-2_0-3 = %{version} gtk-sharp2 glib-sharp2

%description sharp
GMime is a set of utilities for parsing and creating messages using the
Multipurpose Internet Mail Extension (MIME).



Authors:
--------
    Jeffrey Stedfast <fejj@gnome.org>

%package devel
Group:          Development/Libraries/C and C++
Summary:        MIME Library
Requires:       libgmime-2_0-3 = %{version} glib2-devel zlib-devel glibc-devel

%description devel
GMime is a set of utilities for parsing and creating messages using the
Multi-purpose Internet Mail Extension (MIME).



Authors:
--------
    Jeffrey Stedfast <fejj@ximian.com>

%package doc
Group:          Development/Libraries/C and C++
Summary:        MIME Library documentation

%description doc
GMime is a set of utilities for parsing and creating messages using the
Multipurpose Internet Mail Extension (MIME).

This package contains additional documentation for the main package.



Authors:
--------
    Jeffrey Stedfast <fejj@ximian.com>

%define __find_requires env sh -c 'filelist=($(cat)) && { printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/find-requires | grep -v "no package provides" ; } '

%prep
%setup -q
%patch
mv mono/GMime.metadata.in mono/GMime.metadata
%if %suse_version > 1020
%patch1
# api file is not regenerated during build. Fix it now:
# (And current gtk# does not support goffset yet. If it will not in
# future, change goffset to long in the metadata.)
sed -i s/off_t/long/g mono/gmime-api.raw
# Optional patch:
%patch2
%endif
# fix requires for sharp bindings (GMIME_VERSION != SONAME_VERSION)
%patch3

%build
cp /usr/share/gettext/config.rpath .
autoreconf -f -i
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%configure\
	--disable-static\
	--enable-rfc2047-workarounds\
	--enable-gtk-doc
make %{?jobs:-j%jobs}

%install
%makeinstall
# rename to prevent conflict with uu* utils from sharutils
mv $RPM_BUILD_ROOT%{_bindir}/uuencode $RPM_BUILD_ROOT%{_bindir}/gmime-uuencode
mv $RPM_BUILD_ROOT%{_bindir}/uudecode $RPM_BUILD_ROOT%{_bindir}/gmime-uudecode
for FILE in COPYING ; do
    MD5SUM=$(md5sum $FILE | sed 's/ .*//')
    if test -f /usr/share/doc/licenses/md5/$MD5SUM ; then
        ln -sf /usr/share/doc/licenses/md5/$MD5SUM $FILE
    fi
done
# Obsolete GNOME1 gnome-config style:
rm $RPM_BUILD_ROOT%{_libdir}/*Conf.sh

%clean
rm -rf $RPM_BUILD_ROOT

%post -n libgmime-2_0-3 -p /sbin/ldconfig

%postun -n libgmime-2_0-3 -p /sbin/ldconfig

%files
%defattr (-, root, root)
# NEWS is empty
%doc AUTHORS COPYING ChangeLog PORTING README TODO
%exclude %{_bindir}/gmime-config
%{_bindir}/*

%files -n libgmime-2_0-3
%defattr (-, root, root)
%{_libdir}/*.so.*

%files sharp
%defattr (-, root, root)
%dir %{_prefix}/lib/mono/gmime-sharp
%dir %{_prefix}/lib/mono/gac/gmime-sharp
%dir %{_prefix}/lib/mono/gac/gmime-sharp/2.2.0.0__677013d4cb5910f0
%{_prefix}/lib/mono/gmime-sharp/gmime-sharp.dll
%{_prefix}/lib/mono/gac/gmime-sharp/2.2.0.0__677013d4cb5910f0/gmime-sharp.dll
%{_prefix}/lib/mono/gac/gmime-sharp/2.2.0.0__677013d4cb5910f0/gmime-sharp.dll.config
# devel files:
%{_datadir}/gapi-2.0/gmime-api.xml
%{_libdir}/pkgconfig/gmime-sharp.pc

%files devel
%defattr (-, root, root)
%{_bindir}/gmime-config
%{_includedir}/gmime-2.0
%{_libdir}/*.*a
%{_libdir}/*.so
%{_libdir}/pkgconfig/gmime-2.0.pc

%files doc
%defattr (-, root, root)
%{_datadir}/gtk-doc/html/*

%changelog
* Mon Jan 21 2008 ro@suse.de
- work around problem in mono-find-requires if the sharp bindings
  are a subpackage of the one providing the library
* Wed Dec 05 2007 sbrabec@suse.cz
- Removed off_t from the API. Fixes weird CFLAGS forcing gmime's
  off_t size to packages using gmime (#344662, GNOME#501830).
* Mon Nov 19 2007 sbrabec@suse.cz
- Updated to version 2.2.11:
  * Conditional for building with large file support.
  * 64-bit compatibility improvements.
  * Changed the license to LGPLv2.
  * Minor fixes and improvements.
* Tue Sep 25 2007 joeshaw@suse.de
- Add a patch to fix the Mono bindings when GMime is built with
  large file support.  (bnc #327589)
* Wed Aug 08 2007 sbrabec@suse.cz
- Fixed dependencies to allow to install more instances of library.
* Wed Aug 08 2007 ro@suse.de
- remove devel dependencies from library package
* Mon Aug 06 2007 sbrabec@suse.cz
- Updated to version 2.2.10:
  * Implemented a conditional workaround for broken rfc2047
  encodings.
- Enabled large file support and broken rfc2047 workaround.
- Split package according to shared library policy.
- Package gmime-sharp separately.
* Mon Jul 16 2007 sbrabec@suse.cz
- Fixed licenses linking.
* Sun Jul 15 2007 aj@suse.de
- Build sharp files again.
* Fri Jul 13 2007 sbrabec@suse.cz
- Updated to version 2.2.9:
  * New functions.
  * Bug fixes.
  * Memory leak fixes.
* Fri Mar 30 2007 rguenther@suse.de
- Add zlib-devel BuildRequires
* Fri Feb 16 2007 mvaner@suse.cz
- Compare strings properly, not as pointers, bug #225721
  - stdin-cmp.patch
* Tue Feb 13 2007 sbrabec@suse.cz
- Do not build unusable static libraries (#238552#c17).
* Tue Feb 06 2007 sbrabec@suse.cz
- Reduced BuildRequires.
* Wed Jan 10 2007 sbrabec@suse.cz
- Spec file cleanup.
* Tue Jan 09 2007 joeshaw@suse.de
- Clean up BuildRequires
* Mon Jan 08 2007 ro@suse.de
- GNOME moved to /usr
* Fri Oct 20 2006 sbrabec@suse.cz
- Update to version 2.2.3:
  * Decode the values for Subject, From, Reply-To.
  * Code imporvements.
  * Bug fixes.
* Mon Oct 16 2006 schwab@suse.de
- Make sure config.rpath is present.
* Fri Mar 17 2006 joeshaw@suse.de
- Update to version 2.2.1.  This contains a fix for reading mbox
  files in the middle of the last message, which would cause a
  tight CPU loop.  Fixes bnc #156916 and probably also #156927.
* Thu Feb 16 2006 joeshaw@suse.de
- Update the official tarball from 2.1.18 to 2.1.19.  There are
  actually no changes to the code at all, since the (now removed)
  backported patch contained all the differences between 2.1.18
  and 2.1.19.  This just makes already fixed bugs like bnc 147515
  a lot easier to spot.
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Sat Jan 21 2006 joeshaw@suse.de
- Added a patch which backports an important fix from 2.1.19 to
  2.1.18.
* Fri Jan 13 2006 gekker@suse.de
- Fixup nfb and requires for new gtk-sharp2-packaging
- Fixup filelist
* Fri Jan 13 2006 joeshaw@suse.de
- Updated to version 2.1.18
* Tue Jan 10 2006 sbrabec@suse.cz
- Updated to version 2.1.17.
* Sun Sep 04 2005 aj@suse.de
- build as non-root.
- Add check-build.sh.
* Fri Aug 19 2005 gekker@suse.de
- Updated to version 2.1.16
- Require gtk-sharp2
* Tue Jul 12 2005 sbrabec@suse.cz
- Updated to version 2.1.15.
* Mon Mar 14 2005 gekker@suse.de
- Add gmime-mono-leak.patch to fix memory leaks.
* Tue Mar 08 2005 gekker@suse.de
- Update to version 2.1.13
* Tue Feb 08 2005 ro@suse.de
- rename uu{en,de}code to avoid conflict with sharutils
  (taken from source-provided specfile)
* Mon Feb 07 2005 ro@suse.de
- gtk-doc docu back to /opt/gnome
* Fri Feb 04 2005 gekker@suse.de
- Update to version 2.1.11.
- Enable C# bindings, add deps to neededforbuild
- Change prefix to /usr, for mono to work
* Thu Jan 06 2005 sbrabec@suse.cz
- Updated to version 2.1.9.
* Fri Aug 20 2004 sbrabec@suse.cz
- Updated to unstable version 2.1.7, needed by balsa.
* Fri Aug 20 2004 ke@suse.de
- gmime-doc.patch: Switch to DocBook DTD 4.1; version 3.0 does not
  support QANDASET, etc; reported by Stanislav Brabec.
* Thu Aug 19 2004 sbrabec@suse.cz
- New SuSE package, version 2.0.14.
openSUSE Build Service is sponsored by