File mingw32-texlive.spec of Package mingw32-texlive

%define __strip %{_mingw32_strip}
%define __objdump %{_mingw32_objdump}
%define _use_internal_dependency_generator 0
%define __find_requires %{_mingw32_findrequires}
%define __find_provides %{_mingw32_findprovides}
%define __os_install_post %{_mingw32_debug_install_post} \
                          %{_mingw32_install_post}

Name:           mingw32-texlive
Version:        20110705
Release:        0
Summary:        MinGW Windows TeXLive

License:        GPLv2+ ; TeX-License ..
Group:          Development/Libraries
Url:            http://www.tug.org/texlive
Source:         ftp://tug.org/texlive/historic/2011/texlive-20110705-source.tar.xz
Patch0:         texlive-20110705-source-ctype.patch
Patch1:         texlive-20110705-source-INPUT.patch
Patch2:         texlive-20110705-source-header.patch
Patch3:         texlive-20110705-source-texlinks.patch
Patch4:         texlive-20110705-source-ft-install.patch
Patch5:         texlive-20110705-source-getopt.patch
Patch6:         texlive-20110705-source-ptexenc.patch
Patch7:         texlive-20110705-source-freetypeconfig.patch
Patch8:         c24218.patch
Patch9:         texlive-20110705-source-offset.patch
#Patch10:        texlive-20110705-source-icuconfig.patch
Patch11:        texlive-20110705-source-icu.patch
Patch12:        texlive-20110705-source-icu-win32.patch
Patch13:        texlive-20110705-source-lcdf-typetools.patch

Patch1000:      texlive-20091011-source-wix.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildArch:      noarch
#!BuildIgnore: post-build-checks

BuildRequires:  mingw32-filesystem >= 25
BuildRequires:  mingw32-cross-gcc
BuildRequires:  mingw32-cross-gcc-c++
BuildRequires:  mingw32-cross-pkg-config
BuildRequires:  mingw32-fontconfig-devel
BuildRequires:  mingw32-libgs-devel
BuildRequires:  mingw32-libpoppler-devel
BuildRequires:  mingw32-freetype-devel
BuildRequires:  mingw32-libpng-devel
BuildRequires:  mingw32-zlib-devel
#BuildRequires:  mingw32-libicu-devel
BuildRequires:  xz
BuildRequires:  gcc-c++
BuildRequires:  texlive-devel
%if 0%{?suse_version} >= 1230
BuildRequires:  texlive-tie-bin
%endif

BuildRequires:  autoconf >= 2.68
BuildRequires:  wixwine

%description
TeX Live is an easy way to get up and running with the TeX document 
production system. It provides a comprehensive TeX system with binaries
for most flavors of Unix, including GNU/Linux, and also Windows. 
It includes all the major TeX-related programs, macro packages, and fonts
that are free software, including support for many languages around the
world. 

%package devel
License:        GPL v2 or later ; TeX-License ..
Summary:        The headers and library of the Kpathsea tools
Group:          Development/Libraries

%description devel
This package provides include files and libraries to compile and link
applications against libkpathsea and libtexenc.

This package is not required for the use of TeX or LaTeX.


# debug package
%{_mingw32_debug_package}


%prep
%setup -q -n texlive-%{version}-source
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
#%%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch1000 -p1 -b .wix

%build
autoconf -f -i
cd texk/web2c && autoconf -f -i && cd ../..

build_options=""

# Cross compile options
build_options+=" --host=%{_mingw32_host}"
build_options+=" --build=%_build"

# This seems to be the right thing to do according to README.config
build_options+=" --disable-native-texlive-build"

# We always do this in the windows:mingw project
build_options+=" --disable-static"
build_options+=" --enable-shared"

# We do not have (mingw32-)ncurses yet, which is required to build dialog
build_options+=" --disable-dialog"

# Use system libraries
#build_options+=" --with-system-libgs"
#build_options+=" --with-system-freetype2"
#build_options+=" --with-system-poppler"
#build_options+=" --with-system-libpng"
#build_options+=" --with-system-zlib"
##build_options+=" --with-system-icu"

# TODO: Use more system libraries
# e.g.
#build_options+=" --with-system-teckit"
#build_options+=" --with-system-graphite"
#build_options+=" --with-system-zziplib"
#build_options+=" --with-system-xpdf"
#build_options+=" --with-system-gd"
#build_options+=" --with-system-freetype"
#build_options+=" --with-system-t1lib"

TL_TARGET="all" \
TL_INSTALL_DEST="%{_mingw32_prefix}" \
TL_BUILD_ENV="CFLAGS='%{_mingw32_cflags}' LDFLAGS='%{_mingw32_ldflags}' CXXFLAGS='%{_mingw32_cflags}'" \
./Build $build_options

cd Work
echo "Name: libkpathsea" > libkpathsea.pc
echo "Description: TeX path search library" >> libkpathsea.pc
echo "Version: %{version}" >> libkpathsea.pc
echo "" >> libkpathsea.pc
echo "prefix=%{_mingw32_prefix}" >> libkpathsea.pc
echo "Libs: -lkpathsea" >> libkpathsea.pc
echo "Cflags: -L%{_mingw32_bindir}" >> libkpathsea.pc
echo "Wixlibs=%{_mingw32_datadir}/wixlib/libkpathsea.wixlib" >> libkpathsea.pc
echo "Fualflags=-C libkpathsea -D libkpathsea" >> libkpathsea.pc

candle -o libkpathsea.wixobj ../libkpathsea.wxs
lit -o libkpathsea.wixlib -bf libkpathsea.wixobj


%install
cd Work  && make DESTDIR=$RPM_BUILD_ROOT install

mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}/pkgconfig
cp libkpathsea.pc $RPM_BUILD_ROOT%{_mingw32_libdir}/pkgconfig/libkpathsea.pc

mkdir -p $RPM_BUILD_ROOT%{_mingw32_datadir}/wixlib
cp libkpathsea.wixlib $RPM_BUILD_ROOT%{_mingw32_datadir}/wixlib/libkpathsea.wixlib


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
%{_mingw32_prefix}
%exclude %{_mingw32_libdir}/libkpathsea.dll.a
%exclude %{_mingw32_includedir}/kpathsea
%exclude %{_mingw32_libdir}/libptexenc.dll.a
%exclude %{_mingw32_includedir}/ptexenc

%files devel
%defattr(-,root,root)
%{_mingw32_libdir}/libkpathsea.dll.a
%{_mingw32_includedir}/kpathsea
%{_mingw32_libdir}/libptexenc.dll.a
%{_mingw32_includedir}/ptexenc
%{_mingw32_libdir}/pkgconfig/libkpathsea.pc
%{_mingw32_datadir}/wixlib/libkpathsea.wixlib


%changelog
openSUSE Build Service is sponsored by