@ -6,7 +6,7 @@
Name: mingw32-libxml2
Name: mingw32-libxml2
Version: 2.7.2
Version: 2.7.2
Release: 8 %{?dist}
Release: 9 %{?dist}
Summary: MinGW Windows libxml2 XML processing library
Summary: MinGW Windows libxml2 XML processing library
License: MIT
License: MIT
@ -20,6 +20,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# MinGW-specific patches.
# MinGW-specific patches.
Patch1000: mingw32-libxml2-2.7.2-with-modules.patch
Patch1000: mingw32-libxml2-2.7.2-with-modules.patch
Patch1001: mingw32-libxml2-static-build-compile-fix.patch
BuildArch: noarch
BuildArch: noarch
@ -41,10 +42,20 @@ Requires: pkgconfig
MinGW Windows libxml2 XML processing library.
MinGW Windows libxml2 XML processing library.
%package static
Summary: Static version of the MinGW Windows XML processing library
Requires: %{name} = %{version}-%{release}
Group: Development/Libraries
%description static
Static version of the MinGW Windows XML processing library.
%prep
%prep
%setup -q -n libxml2-%{version}
%setup -q -n libxml2-%{version}
%patch1000 -p1
%patch1000 -p1
%patch1001 -p0
# Patched configure.in, so rebuild configure.
# Patched configure.in, so rebuild configure.
libtoolize --force --copy
libtoolize --force --copy
@ -52,15 +63,39 @@ autoreconf
%build
%build
LDFLAGS="-no-undefined" \
# LibXML2 can't build static and shared libraries in one go, so we
%{_mingw32_configure} --without-python --with-modules --disable-static
# build LibXML2 twice here
make %{?_smp_mflags}
mkdir build_static
pushd build_static
LDFLAGS="-no-undefined" \
%{_mingw32_configure} --without-python --with-modules --enable-static --disable-shared CFLAGS="$CFLAGS -DLIBXML_STATIC_FOR_DLL"
make %{?_smp_mflags}
popd
mkdir build_shared
pushd build_shared
LDFLAGS="-no-undefined" \
%{_mingw32_configure} --without-python --with-modules --disable-static --enable-shared
make %{?_smp_mflags}
popd
%install
%install
rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
# First install all the files belonging to the shared build
make -C build_shared DESTDIR=$RPM_BUILD_ROOT install
# Install all the files from the static build in a seperate folder
# and move the static libraries to the right location
make -C build_static DESTDIR=$RPM_BUILD_ROOT/build_static install
mv $RPM_BUILD_ROOT/build_static%{_mingw32_libdir}/*.a $RPM_BUILD_ROOT%{_mingw32_libdir}
# Manually merge the libtool files
sed -i s/"old_library=''"/"old_library='libxml2.a'"/ $RPM_BUILD_ROOT%{_mingw32_libdir}/libxml2.la
# Drop the folder which was temporary used for installing the static bits
rm -rf $RPM_BUILD_ROOT/build_static
# Remove manpages which duplicate Fedora native.
# Remove manpages which duplicate Fedora native.
rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}
rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}
@ -71,14 +106,13 @@ rm -rf $RPM_BUILD_ROOT
%files
%files
%defattr(-,root,root)
%defattr(-,root,root,- )
%{_mingw32_bindir}/libxml2-2.dll
%{_mingw32_bindir}/libxml2-2.dll
%{_mingw32_bindir}/xml2-config
%{_mingw32_bindir}/xml2-config
%{_mingw32_bindir}/xmlcatalog.exe
%{_mingw32_bindir}/xmlcatalog.exe
%{_mingw32_bindir}/xmllint.exe
%{_mingw32_bindir}/xmllint.exe
%{_mingw32_libdir}/libxml2.dll.a
%{_mingw32_libdir}/libxml2.dll.a
%{_mingw32_libdir}/libxml2.la
%{_mingw32_libdir}/libxml2.la
%{_mingw32_libdir}/pkgconfig
%{_mingw32_libdir}/pkgconfig/libxml-2.0.pc
%{_mingw32_libdir}/pkgconfig/libxml-2.0.pc
%{_mingw32_libdir}/xml2Conf.sh
%{_mingw32_libdir}/xml2Conf.sh
%{_mingw32_includedir}/libxml2
%{_mingw32_includedir}/libxml2
@ -87,7 +121,17 @@ rm -rf $RPM_BUILD_ROOT
%{_mingw32_datadir}/gtk-doc/html/libxml2/
%{_mingw32_datadir}/gtk-doc/html/libxml2/
%files static
%defattr(-,root,root,-)
%{_mingw32_libdir}/libxml2.a
%changelog
%changelog
* Fri Apr 3 2009 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.7.2-9
- Fixed %%defattr line
- Added -static subpackage. Applications which want to link
against this static library needs to add -DLIBXML_STATIC to the CFLAGS
- This package shouldn't own %%{_mingw32_libdir}/pkgconfig
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-8
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild