[Rd] mingw-cross rpm spec file

Hin-Tak Leung hin-tak.leung at cimr.cam.ac.uk
Wed May 2 20:21:36 CEST 2007

Attached (and pasted in it entirety, although quite a few of the long 
lines are munched) is my rpm spec file for building the mingw
cross-compiler as an rpm. It is more or less a wrapper which massages
the cross-tool script and setting some of the directories in
the "RPM" way and eventually everything is under /opt/mingw ; the
only tricky part is telling rpm not to strip binaries.

The mingw folks has already stated that they do *not* want to distribute
mingw-cross as an rpm (or any binary-packaging), so this is likely to 
end up as part of a Wiki article on the mingw web site I'll probably
contribute in time.

As my primary use of mingw-cross at the moment is with R (and the
R people do currently provide mingw-cross binaries), I think it
is appropriate that it be taken into CRAN, either being used, or
archived somewhere for others as reference...

I have only used it on fedora core 6, so be warned :-). Hope it is 
useful to somebody else.


Name:           mingw
Version:        1.0
Release:        1%{?dist}
Summary:        MinGW environment on Linux

%define cross_tool_ver x86-mingw32-build.sh-0.0-20061107-1

# Can't allow strip to remove the archive indices
%define __strip /bin/true

Group:          Development/Libraries
License:        Distributable
URL:            http://sourceforge.net/projects/mingw/
Source0:        %{cross_tool_ver}.tar.bz2
Source1:        binutils-2.17.50-20070129-1-src.tar.gz
Source2:        gcc-ada-3.4.5-20060117-1-src.tar.gz
Source3:        gcc-core-3.4.5-20060117-1-src.tar.gz
Source4:        gcc-g++-3.4.5-20060117-1-src.tar.gz
Source5:        gcc-g77-3.4.5-20060117-1-src.tar.gz
Source6:        gcc-java-3.4.5-20060117-1-src.tar.gz
Source7:        gcc-objc-3.4.5-20060117-1-src.tar.gz
Source8:        mingw-runtime-3.12-src.tar.gz
Source9:        w32api-3.9-src.tar.gz

%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  perl

MinGW is a set of include files and import libraries that allow one to 
use GCC to build
native Windows applications that use vendor-supplied runtime.

%setup -q -n %{cross_tool_ver}

perl -pi -e "s(assume WORKING_DIR.+)(assume WORKING_DIR
${RPM_BUILD_DIR}/mingw-3.4.5)" x86-mingw32-build.sh.conf
perl -pi -e  "s(assume PACKAGE_DIR.+)(assume PACKAGE_DIR 
${RPM_SOURCE_DIR})" x86-mingw32-build.sh.conf
perl -pi -e  "s(assume INSTALL_DIR.+)(assume INSTALL_DIR 
${RPM_BUILD_ROOT}/opt/mingw)" x86-mingw32-build.sh.conf

[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
sh ./x86-mingw32-build.sh --no-download --use-latest-versions --unattended

# no op

[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%doc x86-mingw32-build.sh.log

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mingw.spec
Url: https://stat.ethz.ch/pipermail/r-devel/attachments/20070502/f54cb59a/attachment.pl 

More information about the R-devel mailing list