source: rtems/contrib/crossrpms/mingw32/i686/i686-pc-mingw32-mpc.spec @ c95862d

4.104.115
Last change on this file since c95862d was c95862d, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/19/10 at 08:56:51

New.

  • Property mode set to 100644
File size: 4.4 KB
Line 
1#
2# Please send bugfixes or comments to
3#       http://www.rtems.org/bugzilla
4#
5
6
7%ifos cygwin cygwin32 mingw mingw32
8%define _exeext .exe
9%define debug_package           %{nil}
10%define _libdir                 %{_exec_prefix}/lib
11%else
12%define _exeext %{nil}
13%endif
14
15%ifos cygwin cygwin32
16%define optflags -O3 -pipe -march=i486 -funroll-loops
17%endif
18
19%ifos mingw mingw32
20%if %{defined _mingw32_cflags}
21%define optflags %{_mingw32_cflags}
22%else
23%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
24%endif
25%endif
26
27%if "%{_build}" != "%{_host}"
28%define _host_rpmprefix %{_host}-
29%else
30%define _host_rpmprefix %{nil}
31%endif
32
33%define mpc_version 0.8.1
34%define mpc_rpmvers %{expand:%(echo 0.8.1 | tr - _)}
35%define debug_package %{nil}
36
37Name:         i686-pc-mingw32-mpc
38Release:      0.20100319.1%{?dist}
39License:      GPL
40Group:        Development/Tools
41
42BuildArch:      noarch
43BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
44
45Version:        %mpc_rpmvers
46Summary:        MinGW mpc Libraries
47
48Source0:        ftp://ftp.gnu.org/gnu/mpc/mpc-%{mpc_version}.tar.gz
49
50Provides:       i686-pc-mingw32-mpc-devel = %{version}-%{release}
51Provides:       i686-pc-mingw32-libmpc-devel = %{version}-%{release}
52
53%define _mingw32_target          i686-pc-mingw32
54
55# Fedora ships a mingw toolchain installed to /usr
56%define _mingw32_sysroot /usr/%{_mingw32_target}/sys-root
57
58BuildRequires:  m4
59BuildRequires:  i686-pc-mingw32-gmp-devel
60BuildRequires:  i686-pc-mingw32-mpfr-devel
61BuildRequires:  i686-pc-mingw32-gcc
62
63%description
64MinGW mpc libraries.
65
66%prep
67%setup -c -q
68
69%build
70  %if "%{_prefix}" != "/usr"
71    export PATH="%{_bindir}:${PATH}"
72  %endif
73
74  mkdir -p build
75
76  cd build
77
78  ../mpc-%{mpc_version}/configure \
79    --prefix=%{_mingw32_sysroot}/mingw \
80    --bindir=%{_bindir} \
81    --exec_prefix=%{_mingw32_sysroot}/mingw \
82    --includedir=%{_mingw32_sysroot}/mingw/include \
83    --libdir=%{_mingw32_sysroot}/mingw/lib \
84    --libexecdir=%{_mingw32_sysroot}/mingw/libexec \
85    --mandir=%{_mingw32_sysroot}/mingw/share/man \
86    --infodir=%{_mingw32_sysroot}/mingw/share/info \
87    --datadir=%{_mingw32_sysroot}/mingw/share \
88    --build=%_build --host=i686-pc-mingw32 \
89    --enable-static \
90    --disable-shared
91
92  cd ..
93
94%install
95  rm -rf $RPM_BUILD_ROOT
96
97  cd build
98
99  make DESTDIR=$RPM_BUILD_ROOT install
100
101  cd ..
102# Extract %%__os_install_post into os_install_post~
103cat << \EOF > os_install_post~
104%__os_install_post
105EOF
106
107# Generate customized brp-*scripts
108cat os_install_post~ | while read a x y; do
109case $a in
110# Prevent brp-strip* from trying to handle foreign binaries
111*/brp-strip*)
112  b=$(basename $a)
113  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
114  chmod a+x $b
115  ;;
116esac
117done
118
119sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
120< os_install_post~ > os_install_post
121%define __os_install_post . ./os_install_post
122
123
124cat << EOF > %{_builddir}/%{name}-%{mpc_rpmvers}/find-provides
125#!/bin/sh
126grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-mingw32/(lib|include|sys-root)' \
127  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i686-pc-mingw32/'} | %__find_provides
128EOF
129chmod +x %{_builddir}/%{name}-%{mpc_rpmvers}/find-provides
130%define __find_provides %{_builddir}/%{name}-%{mpc_rpmvers}/find-provides
131
132cat << EOF > %{_builddir}/%{name}-%{mpc_rpmvers}/find-requires
133#!/bin/sh
134grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-mingw32/(lib|include|sys-root)' \
135  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i686-pc-mingw32/'} | %__find_requires
136EOF
137chmod +x %{_builddir}/%{name}-%{mpc_rpmvers}/find-requires
138%define __find_requires %{_builddir}/%{name}-%{mpc_rpmvers}/find-requires
139
140%ifnarch noarch
141# Extract %%__debug_install_post into debug_install_post~
142cat << \EOF > debug_install_post~
143%__debug_install_post
144EOF
145
146# Generate customized debug_install_post script
147cat debug_install_post~ | while read a x y; do
148case $a in
149# Prevent find-debuginfo.sh* from trying to handle foreign binaries
150*/find-debuginfo.sh)
151  b=$(basename $a)
152  sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b
153  chmod a+x $b
154  ;;
155esac
156done
157
158sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \
159< debug_install_post~ > debug_install_post
160%define __debug_install_post . ./debug_install_post
161
162%endif
163
164%clean
165  rm -rf $RPM_BUILD_ROOT
166
167%files
168%defattr(-,root,root,-)
169%{_mingw32_sysroot}/mingw
170%exclude %{_mingw32_sysroot}/mingw/share/info/dir
Note: See TracBrowser for help on using the repository browser.