%define apiver 3.0
%define docver 3.2
%define _unpackaged_files_terminate_build 1

Summary:        Library for creating and parsing MIME messages
Summary(ja):	MIMEメッセージを生成またパースするためのライブラリ
Name:           gmime
Version:        3.2.15
Release:        1%{?_dist_release}
Group:          system
Vendor:         Project Vine
Distribution:   Vine Linux

License:        GPL
URL:            https://github.com/jstedfast/gmime
%global         shortver %(echo %{version} | sed -e 's/\.[0-9]*$//')
Source0:        https://github.com/jstedfast/gmime/releases/download/%{version}/gmime-%{version}.tar.xz

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root

BuildRequires:  glib2-devel >= 2.26.0
BuildRequires:  gpgme-devel
BuildRequires:  libgpg-error-devel
BuildRequires:  pkgconfig(zlib)
BuildRequires:  gobject-introspection-devel
BuildRequires:  vala
BuildRequires:  automake, libtool, gettext, gtk-doc

# Mono only availible on these:
%define mono_archs none
# no mono on s390 for now: s390 s390x 

%ifarch %mono_archs
BuildRequires:  mono-devel gtk-sharp2-gapi
BuildRequires:  gtk-sharp2 >= 2.8.0
%define monodir %{_prefix}/lib/mono
%endif

%description
The GMime suite provides a core library and set of utilities which may be
used for the creation and parsing of messages using the Multipurpose
Internet Mail Extension (MIME).


%package        devel
Summary:        Header files to develop libgmime applications
Group:          programming
Requires:       %{name} = %{version}-%{release}
Requires:       glib2-devel

%description    devel
The GMime suite provides a core library and set of utilities which may be
used for the creation and parsing of messages using the Multipurpose
Internet Mail Extension (MIME). The devel-package contains header files
to develop applications that use libgmime.


%ifarch %mono_archs
%package        sharp
Summary:        mono bindings for gmime
Group:          system
Requires:       %{name} = %{version}-%{release}
Requires:       gtk-sharp2

%description    sharp
The GMime suite provides a core library and set of utilities which may be
used for the creation and parsing of messages using the Multipurpose
Internet Mail Extension (MIME). The devel-package contains support 
for developing mono applications that use libgmime.
%endif


%debug_package


%prep
%setup -q


%build
%ifarch %mono_archs
export MONO_SHARED_DIR=%{_builddir}/%{?buildsubdir}
MONO_ARGS="--enable-mono"
%endif

%configure --disable-static $MONO_ARGS
%make_build V=1


%install
export MONO_SHARED_DIR=%{_builddir}/%{?buildsubdir}
%make_install

find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'

# Don't conflict with 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


%files
%license COPYING
%doc AUTHORS README* TODO
#%{_bindir}/gmime-uu??code
%{_libdir}/lib*.so.*
%dir %{_libdir}/girepository-1.0
%{_libdir}/girepository-1.0/GMime-3.0.typelib

%files devel
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/gmime-%{apiver}.pc
%{_includedir}/gmime-%{apiver}
%dir %{_datadir}/gir-1.0
%{_datadir}/gir-1.0/GMime-3.0.gir
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%{_datadir}/gtk-doc/html/gmime-%{docver}
%dir %{_datadir}/vala
%{_datadir}/vala/*

%ifarch %mono_archs
%files sharp
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/gmime-sharp-%{apiver}.pc
%{monodir}/gac/gmime-sharp
%{monodir}/gmime-sharp-%{apiver}
%{_datadir}/gapi-2.0/gmime-api.xml
%endif


%changelog
* Fri Jul 12 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.2.15-1
- new upstream release.

* Fri May 01 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.2.7-1
- new upstream release.

* Sat Dec 29 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.2.3-1
- new upstream release.
- disabled to build mono stuff.

* Sat Mar 29 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.20-1
- new upstream release

* Sat Jan 04 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.19-2
- rebuild with VineSeed environment

* Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.19-1
- new upstream release

* Sun Aug 11 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.17-1
- new upstream release

* Mon Jul 15 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.16-1
- new upstream release

* Sun Mar 03 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.15-1
- new upstream release

* Thu Jan 03 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.13-1
- new upstream release

* Sun Nov 04 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.12-1
- new upstream release

* Fri Oct 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.11-1
- new upstream release

* Thu Jun 21 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.10-1
- new upstream release

* Mon Apr 30 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.9-1
- new upstream release

* Sun Apr 08 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.7-1
- new upstream release
- remove Patch4

* Wed Dec 28 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.2-1
- new upstream release

* Sun Nov 20 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.1-1
- new upstream release

* Fri Sep 23 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.6.0-1
- new upstream release
- add BuildRequires: gpgme-devel

* Mon Aug 15 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.4.25-1
- new upstream release

* Thu May 05 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.4.24-1
- new upstream release

* Wed Jan 26 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.4.22-1
- new upstream release

* Tue Dec 21 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.4.21-1
- new upstream release

* Sat Nov 20 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.4.20-1
- new upstream release

* Sun Oct 03 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.4.19-1
- new upstream release

* Sat Sep 25 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.4.17-2
- rebuild with rpm-4.8.1 for pkg-config file

* Mon Jun 21 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.4.17-1
- new upstream release

* Wed Mar 31 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.4.15-1
- new upstream release
- fix files for gmime-2.4
- drop Patch1, Patch2, Patch3

* Thu Sep 18 2008 Shu KONNO <owa@bg.wakwak.com> 2.2.23-1vl5
- new upstream release
- rebuilt with mono-2.0
- added gmime-2.2.23-gacutil.patch

* Tue Aug 26 2008 Shu KONNO <owa@bg.wakwak.com> 2.2.9-1vl5
- applied new versioning policy, spec in utf-8
- updated gmime to 2.2.9
- dropt gmime-2.2.3-libdir.patch
- dropt gmime-2.2.3-automake.patch

* Sun Apr 29 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2.3-0vl1
- initial build for Vine Linux

* Tue Feb  6 2007 Alexander Larsson <alexl@redhat.com> - 2.2.3-5
- Fix build with new automake (#224157)

* Thu Oct 12 2006 Alexander Larsson <alexl@redhat.com> - 2.2.3-4
- Bump glib requirement to 2.6 (#209565)

* Tue Sep  5 2006 Alexander Larsson <alexl@redhat.com> - 2.2.3-3
- fix gmime-config multilib conflict (#205208)

* Sat Aug 19 2006 Matthias Clasen <mclasen@redhat.com> - 2.2.3-2
- Rebuild

* Fri Aug 18 2006 Alexander Larsson <alexl@redhat.com> - 2.2.3-1
- Upgrade to 2.2.3
- Use the new mono libdir

* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - sh: line 0: fg: no job control
- rebuild

* Fri Jun  9 2006 Alexander Larsson <alexl@redhat.com> - 2.2.1-2
- Disable mono parts on s390* as mono doesn't build on s390 atm

* Tue May 23 2006 Alexander Larsson <alexl@redhat.com> - 2.2.1-1
- Update to 2.2.1
- Fix multilib -devel conflict by using pkg-config in gmime-config (#192675)

* Tue Feb 28 2006 Karsten Hopp <karsten@redhat.de> 2.1.19-4
- BuildRequires: gtk-sharp2 on mono archs only

* Sun Feb 12 2006 Christopher Aillon <caillon@redhat.com> - 2.1.19-3
- Rebuild

* Tue Feb  7 2006 Jesse Keating <jkeating@redhat.com> - 2.1.19-2.1
- rebuilt for new gcc4.1 snapshot and glibc changes

* Tue Jan 31 2006 Christopher Aillon <caillon@redhat.com> - 2.1.19-2
- Rebuild

* Sun Jan 22 2006 Alexander Larsson <alexl@redhat.com> - 2.1.19-1
- Update to 2.1.19 (needed by beagle 0.2.0)

* Thu Jan 19 2006 Alexander Larsson <alexl@redhat.com> 2.1.17-3
- Build on s390x

* Mon Jan  9 2006 Alexander Larsson <alexl@redhat.com> 2.1.17-2
- build gmime-sharp conditionally on mono arches

* Mon Jan  9 2006 Alexander Larsson <alexl@redhat.com> - 2.1.17-1
- Move from Extras to Core, Update to 2.1.17, add gmime-sharp subpackage

* Wed Aug 10 2005 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 2.1.15-1
- Update to 2.1.15
- Use dist

* Wed May 18 2005 Colin Charles <colin@fedoraproject.org> - 2.1.9-5
- bump release, request build on ppc

* Thu Mar 31 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 2.1.9-4
- add dep glib2-devel for pkgconfig in -devel package

* Mon Oct 18 2004 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0:2.1.9-0.fdr.3
- Remove ldconfig from Requires pre and post

* Mon Oct 18 2004 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0:2.1.9-0.fdr.2
- BR zlib-devel
- Don't ship empty news file
- Fixes to the files section
- Change ldconfig in post* calls to -p /sbin/ldconfig


* Sun Oct 17 2004 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 0:2.1.9-0.fdr.1
- Initial RPM release.
