[Rd] mingw-cross rpm spec file

From: Hin-Tak Leung <hin-tak.leung_at_cimr.cam.ac.uk>
Date: Wed, 02 May 2007 19:21:36 +0100


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.

HTL


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


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

BuildRequires: perl
#Requires:

%description

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.

%prep
%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

%build

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

%install

# no op

%clean

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

%files
%defattr(-,root,root,-)
%doc x86-mingw32-build.sh.log

/opt/mingw

%changelog


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


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

BuildRequires:	perl

#Requires:

%description

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.

%prep
%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

%build

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

%install

# no op

%clean

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

%files
%defattr(-,root,root,-)
%doc x86-mingw32-build.sh.log

/opt/mingw

%changelog



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 02 May 2007 - 18:25:02 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 03 May 2007 - 08:33:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.