summaryrefslogtreecommitdiffstats
path: root/contrib/crossrpms/mingw32/i686/mpfr.add
blob: 7d7aec69668102a1217c033dbf7d34a809456eb2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
%define mpfr_version @MPFR_VERS@
%define mpfr_rpmvers %{expand:%(echo @MPFR_VERS@ | tr - _)} 
%define debug_package %{nil}

Name:         @rpmprefix@@tool_target@-mpfr
Release:      @MPFR_RPMREL@
License:      GPL
Group:        Development/Tools

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

Version:      	%mpfr_rpmvers
Summary:      	MinGW MPFR Libraries

Source0:	http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2

Provides:	@rpmprefix@@tool_target@-mpfr-devel = %{version}-%{release}

%define _mingw32_target          i686-pc-mingw32
%if 0%{?fedora} >= 9
# Fedora ships a mingw toolchain installed to /usr
%define _mingw32_sysroot /usr/%{_mingw32_target}/sys-root
%else
%define _mingw32_sysroot %{_prefix}/@tool_target@/sys-root
%endif

BuildRequires:	@rpmprefix@i686-pc-mingw32-gcc
BuildRequires:	@rpmprefix@i686-pc-mingw32-gmp-devel

%description
MinGW MPFR libraries.

%prep
%setup -c -q

%build
  %if "%{_prefix}" != "/usr"
    export PATH="%{_bindir}:${PATH}"
  %endif

  mkdir -p build

  cd build

  ../mpfr-%{mpfr_version}/configure \
    --prefix=%{_mingw32_sysroot}/mingw \
    --bindir=%{_bindir} \
    --exec_prefix=%{_mingw32_sysroot}/mingw \
    --includedir=%{_mingw32_sysroot}/mingw/include \
    --libdir=%{_mingw32_sysroot}/mingw/lib \
    --libexecdir=%{_mingw32_sysroot}/mingw/libexec \
    --mandir=%{_mingw32_sysroot}/mingw/share/man \
    --infodir=%{_mingw32_sysroot}/mingw/share/info \
    --datadir=%{_mingw32_sysroot}/mingw/share \
    --build=%_build --host=@tool_target@ \
    --enable-static \
    --disable-shared

  cd ..

%install
  rm -rf $RPM_BUILD_ROOT

  cd build

  make DESTDIR=$RPM_BUILD_ROOT install

  cd ..