%define __strip %{_mingw32_strip}
%define __objdump %{_mingw32_objdump}
%define _use_internal_dependency_generator 0
%define __find_requires %{_mingw32_findrequires}
%define __find_provides %{_mingw32_findprovides}

Name:           mingw32-libvirt-glib
Version:        @VERSION@
Release:        1%{?dist}%{?extra_release}
Summary:        MinGW Windows libvirt-glib virtualization library

License:        LGPLv2+
Group:          Development/Libraries
URL:            http://libvirt.org/
Source0:        ftp://libvirt.org/libvirt-glib/libvirt-glib-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  mingw32-filesystem >= 23
BuildRequires:  mingw32-glib2
BuildRequires:  mingw32-libvirt >= 0.9.10
BuildRequires:  pkgconfig

BuildArch:      noarch

%package -n mingw32-libvirt-gconfig
Summary: MingwGW Windows libvirt-gconfig virtualization library
Group: Development/Libraries

%package -n mingw32-libvirt-gobject
Summary: MingwGW Windows libvirt-gobject virtualization library
Group: Development/Libraries

%description
MinGW Windows libvirt-glib virtualization library.

%description -n mingw32-libvirt-gconfig
MinGW Windows libvirt-gconfig virtualization library.

%description -n mingw32-libvirt-gobject
MinGW Windows libvirt-gobject virtualization library.


%prep
%setup -q -n libvirt-glib-%{version}


%build
%{_mingw32_configure} \
    --without-python
make


%install
rm -rf $RPM_BUILD_ROOT

make DESTDIR=$RPM_BUILD_ROOT install

rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libvirt-glib-1.0.a
rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libvirt-gconfig-1.0.a
rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libvirt-gobject-1.0.a
rm -rf $RPM_BUILD_ROOT%{_mingw32_datadir}/gtk-doc

%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
%{_mingw32_bindir}/libvirt-glib-1.0-0.dll

%{_mingw32_libdir}/libvirt-glib-1.0.dll.a
%{_mingw32_libdir}/libvirt-glib-1.0.la

%{_mingw32_libdir}/pkgconfig/libvirt-glib-1.0.pc

%dir %{_mingw32_includedir}/libvirt-glib-1.0
%dir %{_mingw32_includedir}/libvirt-glib-1.0/libvirt-glib
%{_mingw32_includedir}/libvirt-glib-1.0/libvirt-glib/libvirt-glib.h
%{_mingw32_includedir}/libvirt-glib-1.0/libvirt-glib/libvirt-glib-*.h

%files -n mingw32-libvirt-gconfig
%defattr(-,root,root)
%{_mingw32_bindir}/libvirt-gconfig-1.0-0.dll

%{_mingw32_libdir}/libvirt-gconfig-1.0.dll.a
%{_mingw32_libdir}/libvirt-gconfig-1.0.la

%{_mingw32_libdir}/pkgconfig/libvirt-gconfig-1.0.pc

%dir %{_mingw32_includedir}/libvirt-gconfig-1.0
%dir %{_mingw32_includedir}/libvirt-gconfig-1.0/libvirt-gconfig
%{_mingw32_includedir}/libvirt-gconfig-1.0/libvirt-gconfig/libvirt-gconfig.h
%{_mingw32_includedir}/libvirt-gconfig-1.0/libvirt-gconfig/libvirt-gconfig-*.h

%files -n mingw32-libvirt-gobject
%defattr(-,root,root)
%{_mingw32_bindir}/libvirt-gobject-1.0-0.dll

%{_mingw32_libdir}/libvirt-gobject-1.0.dll.a
%{_mingw32_libdir}/libvirt-gobject-1.0.la

%{_mingw32_libdir}/pkgconfig/libvirt-gobject-1.0.pc

%dir %{_mingw32_includedir}/libvirt-gobject-1.0
%dir %{_mingw32_includedir}/libvirt-gobject-1.0/libvirt-gobject
%{_mingw32_includedir}/libvirt-gobject-1.0/libvirt-gobject/libvirt-gobject.h
%{_mingw32_includedir}/libvirt-gobject-1.0/libvirt-gobject/libvirt-gobject-*.h


%changelog
* Fri Nov 28 2008 Daniel P. Berrange <berrange@redhat.com> - 0.0.1-1
- Initial release
