File mingw-shared-mime-info.spec of Package mingw-shared-mime-info

%{?mingw_package_header}
%define _pkg_name shared-mime-info

Name:		mingw-%{_pkg_name}
Version:	1.0
Release:	1%{?dist}
Summary:	MinGW build of shared MIME information database

License:	GPLv2+
URL:		http://freedesktop.org/Software/shared-mime-info
Source0:	http://freedesktop.org/~hadess/shared-mime-info-%{version}.tar.xz

Patch0:		shared-mime-info-1.0-exe-extension.patch
Patch1:		shared-mime-info-1.0-disable-checks.patch
Patch2:		shared-mime-info-1.0-use-uninstalled.patch
Patch3:		shared-mime-info-1.0-use-native-when-cross.patch

BuildArch:	noarch

BuildRequires:	mingw32-filesystem >= 95
BuildRequires:	mingw64-filesystem >= 95
BuildRequires:	mingw32-gcc mingw64-gcc
BuildRequires:	mingw32-binutils mingw64-binutils
BuildRequires:	mingw32-pkg-config mingw64-pkg-config
BuildRequires:	mingw32-glib2 mingw64-glib2
BuildRequires:	mingw32-libxml2 mingw64-libxml2
BuildRequires:	autoconf automake libtool
BuildRequires:	glib2-devel libxml2-devel
BuildRequires:	intltool

%description
This is the freedesktop.org shared MIME info database.

Many programs and desktops use the MIME system to represent the types of
files. Frequently, it is necessary to work out the correct MIME type for
a file. This is generally done by examining the file's name or contents,
and looking up the correct MIME type in a database.


%package -n mingw32-%{_pkg_name}
Summary:	%{summary}

%description -n mingw32-%{_pkg_name}
This is the freedesktop.org shared MIME info database.

Many programs and desktops use the MIME system to represent the types of
files. Frequently, it is necessary to work out the correct MIME type for
a file. This is generally done by examining the file's name or contents,
and looking up the correct MIME type in a database.

%package -n mingw64-%{_pkg_name}
Summary:	%{summary}

%description -n mingw64-%{_pkg_name}
This is the freedesktop.org shared MIME info database.

Many programs and desktops use the MIME system to represent the types of
files. Frequently, it is necessary to work out the correct MIME type for
a file. This is generally done by examining the file's name or contents,
and looking up the correct MIME type in a database.

%{?mingw_debug_package}

%prep
%setup -q -n shared-mime-info-%{version}

%patch0 -p1 -b .extension
%patch1 -p1 -b .checks
%patch2 -p1 -b .uninstalled
%patch3 -p1 -b .native

%build
autoreconf -f -i
%mingw_configure

# Parallel builds don't work. Fortunately there's only about 5 or so files to compile
%mingw_make

%install
%mingw_make install DESTDIR=%{buildroot}

rm -rf %{buildroot}%{mingw32_mandir}/man1/
rm -rf %{buildroot}%{mingw64_mandir}/man1/

%mingw_find_lang %{_pkg_name}

mkdir -p %{buildroot}%{mingw32_libdir}
mv %{buildroot}%{mingw32_datadir}/pkgconfig %{buildroot}%{mingw32_libdir}

mkdir -p %{buildroot}%{mingw64_libdir}
mv %{buildroot}%{mingw64_datadir}/pkgconfig %{buildroot}%{mingw64_libdir}

%files -n mingw32-%{_pkg_name} -f mingw32-%{_pkg_name}.lang
%doc ChangeLog COPYING README
%{mingw32_bindir}/update-mime-database.exe
%{mingw32_datadir}/mime
%{mingw32_libdir}/pkgconfig/shared-mime-info.pc

%files -n mingw64-%{_pkg_name} -f mingw64-%{_pkg_name}.lang
%doc ChangeLog COPYING README
%{mingw64_bindir}/update-mime-database.exe
%{mingw64_datadir}/mime
%{mingw64_libdir}/pkgconfig/shared-mime-info.pc

%changelog
* Thu Dec 13 2012 Greg Hellings <greg.hellings@gmail.com> - 1.5-1
- Initial build