Added win64 support

epel9
Erik van Pienbroek 13 years ago
parent 73a99a9498
commit 7467d92e08

@ -1,10 +1,11 @@
%global __strip %{mingw32_strip} %?mingw_package_header
%global __objdump %{mingw32_objdump}
%define __debug_install_post %{mingw32_debug_install_post} %global mingw_build_win32 1
%global mingw_build_win64 1
Name: mingw-libxml2 Name: mingw-libxml2
Version: 2.7.8 Version: 2.7.8
Release: 6%{?dist} Release: 7%{?dist}
Summary: MinGW Windows libxml2 XML processing library Summary: MinGW Windows libxml2 XML processing library
License: MIT License: MIT
@ -24,20 +25,26 @@ Patch1002: libxml2-gnome-bug-561340-fix.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: mingw32-filesystem BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw32-gcc BuildRequires: mingw32-gcc
BuildRequires: mingw32-binutils BuildRequires: mingw32-binutils
BuildRequires: mingw32-dlfcn
BuildRequires: mingw32-gettext BuildRequires: mingw32-gettext
BuildRequires: mingw32-win-iconv BuildRequires: mingw32-win-iconv
BuildRequires: mingw32-zlib BuildRequires: mingw32-zlib
BuildRequires: mingw64-filesystem >= 95
BuildRequires: mingw64-gcc
BuildRequires: mingw64-binutils
BuildRequires: mingw64-gettext
BuildRequires: mingw64-win-iconv
BuildRequires: mingw64-zlib
%description %description
MinGW Windows libxml2 XML processing library. MinGW Windows libxml2 XML processing library.
# Win32
%package -n mingw32-libxml2 %package -n mingw32-libxml2
Summary: MinGW Windows libxml2 XML processing library Summary: MinGW Windows libxml2 XML processing library
Requires: pkgconfig Requires: pkgconfig
@ -45,7 +52,6 @@ Requires: pkgconfig
%description -n mingw32-libxml2 %description -n mingw32-libxml2
MinGW Windows libxml2 XML processing library. MinGW Windows libxml2 XML processing library.
%package -n mingw32-libxml2-static %package -n mingw32-libxml2-static
Summary: Static version of the MinGW Windows XML processing library Summary: Static version of the MinGW Windows XML processing library
Requires: mingw32-libxml2 = %{version}-%{release} Requires: mingw32-libxml2 = %{version}-%{release}
@ -54,8 +60,24 @@ Group: Development/Libraries
%description -n mingw32-libxml2-static %description -n mingw32-libxml2-static
Static version of the MinGW Windows XML processing library. Static version of the MinGW Windows XML processing library.
# Win64
%package -n mingw64-libxml2
Summary: MinGW Windows libxml2 XML processing library
Requires: pkgconfig
%description -n mingw64-libxml2
MinGW Windows libxml2 XML processing library.
%package -n mingw64-libxml2-static
Summary: Static version of the MinGW Windows XML processing library
Requires: mingw64-libxml2 = %{version}-%{release}
Group: Development/Libraries
%description -n mingw64-libxml2-static
Static version of the MinGW Windows XML processing library.
%{?mingw32_debug_package} %?mingw_debug_package
%prep %prep
@ -69,29 +91,26 @@ Static version of the MinGW Windows XML processing library.
%build %build
# LibXML2 can't build static and shared libraries in one go, so we # LibXML2 can't build static and shared libraries in one go, so we
# build LibXML2 twice here # build LibXML2 twice here
mkdir build_static export LDFLAGS="-no-undefined"
pushd build_static export CFLAGS="$CFLAGS -DLIBXML_STATIC_FOR_DLL"
LDFLAGS="-no-undefined" \ MINGW_BUILDDIR_SUFFIX=static %mingw_configure --without-python --with-modules --enable-static --disable-shared --with-threads=win32
%{mingw32_configure} --without-python --with-modules --enable-static --disable-shared --with-threads=win32 CFLAGS="$CFLAGS -DLIBXML_STATIC_FOR_DLL" unset CFLAGS
make %{?_smp_mflags} MINGW_BUILDDIR_SUFFIX=shared %mingw_configure --without-python --with-modules --disable-static --enable-shared --with-threads=win32
popd
mkdir build_shared MINGW_BUILDDIR_SUFFIX=static %mingw_make %{?_smp_mflags}
pushd build_shared MINGW_BUILDDIR_SUFFIX=shared %mingw_make %{?_smp_mflags}
LDFLAGS="-no-undefined" \
%{mingw32_configure} --without-python --with-modules --disable-static --enable-shared --with-threads=win32
make %{?_smp_mflags}
popd
%install %install
# First install all the files belonging to the shared build # First install all the files belonging to the shared build
make -C build_shared DESTDIR=$RPM_BUILD_ROOT install MINGW_BUILDDIR_SUFFIX=shared %mingw_make_install DESTDIR=$RPM_BUILD_ROOT
# Install all the files from the static build in a seperate folder # Install all the files from the static build in a seperate folder
# and move the static libraries to the right location # and move the static libraries to the right location
make -C build_static DESTDIR=$RPM_BUILD_ROOT/build_static install MINGW_BUILDDIR_SUFFIX=static %mingw_make_install DESTDIR=$RPM_BUILD_ROOT/build_static
mv $RPM_BUILD_ROOT/build_static%{mingw32_libdir}/*.a $RPM_BUILD_ROOT%{mingw32_libdir} mv $RPM_BUILD_ROOT/build_static%{mingw32_libdir}/*.a $RPM_BUILD_ROOT%{mingw32_libdir}
mv $RPM_BUILD_ROOT/build_static%{mingw64_libdir}/*.a $RPM_BUILD_ROOT%{mingw64_libdir}
# Drop the folder which was temporary used for installing the static bits # Drop the folder which was temporary used for installing the static bits
rm -rf $RPM_BUILD_ROOT/build_static rm -rf $RPM_BUILD_ROOT/build_static
@ -101,10 +120,15 @@ rm -rf $RPM_BUILD_ROOT%{mingw32_mandir}
rm -rf $RPM_BUILD_ROOT%{mingw32_docdir} rm -rf $RPM_BUILD_ROOT%{mingw32_docdir}
rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/gtk-doc/ rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/gtk-doc/
rm -rf $RPM_BUILD_ROOT%{mingw64_mandir}
rm -rf $RPM_BUILD_ROOT%{mingw64_docdir}
rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/gtk-doc/
# Drop all .la files # Drop all .la files
find $RPM_BUILD_ROOT -name "*.la" -delete find $RPM_BUILD_ROOT -name "*.la" -delete
# Win32
%files -n mingw32-libxml2 %files -n mingw32-libxml2
%{mingw32_bindir}/libxml2-2.dll %{mingw32_bindir}/libxml2-2.dll
%{mingw32_bindir}/xml2-config %{mingw32_bindir}/xml2-config
@ -116,12 +140,29 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
%{mingw32_includedir}/libxml2 %{mingw32_includedir}/libxml2
%{mingw32_datadir}/aclocal/* %{mingw32_datadir}/aclocal/*
%files -n mingw32-libxml2-static %files -n mingw32-libxml2-static
%{mingw32_libdir}/libxml2.a %{mingw32_libdir}/libxml2.a
# Win64
%files -n mingw64-libxml2
%{mingw64_bindir}/libxml2-2.dll
%{mingw64_bindir}/xml2-config
%{mingw64_bindir}/xmlcatalog.exe
%{mingw64_bindir}/xmllint.exe
%{mingw64_libdir}/libxml2.dll.a
%{mingw64_libdir}/pkgconfig/libxml-2.0.pc
%{mingw64_libdir}/xml2Conf.sh
%{mingw64_includedir}/libxml2
%{mingw64_datadir}/aclocal/*
%files -n mingw64-libxml2-static
%{mingw64_libdir}/libxml2.a
%changelog %changelog
* Sat Mar 10 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.7.8-7
- Added win64 support
* Fri Mar 09 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.7.8-6 * Fri Mar 09 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.7.8-6
- Dropped .la files - Dropped .la files

Loading…
Cancel
Save