summaryrefslogtreecommitdiffstats
path: root/contrib/crossrpms/mingw32/i686/mpc.add
blob: d7bb544907989793d1668446a34378ca59933aca (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 mpc_version @MPC_VERS@
%define mpc_rpmvers %{expand:%(echo @MPC_VERS@ | tr - _)} 
%define debug_package %{nil}

Name:         @rpmprefix@@tool_target@-mpc
Release:      @MPC_RPMREL@
License:      GPL
Group:        Development/Tools

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

Version:      	%mpc_rpmvers
Summary:      	MinGW mpc Libraries

Source0:	ftp://ftp.gnu.org/gnu/mpc/mpc-%{mpc_version}.tar.gz

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

%define _mingw32_target          i686-pc-mingw32

# Fedora ships a mingw toolchain installed to /usr
%define _mingw32_sysroot /usr/%{_mingw32_target}/sys-root

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

%description
MinGW mpc libraries.

%prep
%setup -c -q

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

  mkdir -p build

  cd build

  ../mpc-%{mpc_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 ..