[facca98] | 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 | |
---|
[ace475a] | 33 | %define mpfr_version 2.4.1-4 |
---|
| 34 | %define mpfr_rpmvers %{expand:%(echo 2.4.1-4 | tr - _)} |
---|
[facca98] | 35 | |
---|
| 36 | Name: i686-pc-cygwin-mpfr |
---|
[ace475a] | 37 | Release: 0.20100204.0%{?dist} |
---|
[facca98] | 38 | License: GPL |
---|
| 39 | Group: Development/Tools |
---|
| 40 | |
---|
| 41 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
| 42 | BuildArch: noarch |
---|
| 43 | |
---|
| 44 | Version: %mpfr_rpmvers |
---|
| 45 | Summary: Cygwin mpfr Libraries |
---|
| 46 | |
---|
| 47 | Source0: ftp://cygwin.com/pub/cygwin/release/mpfr/mpfr-%{mpfr_version}.tar.bz2 |
---|
| 48 | Source1: ftp://cygwin.com/pub/cygwin/release/mpfr/libmpfr1/libmpfr1-%{mpfr_version}.tar.bz2 |
---|
| 49 | Source2: ftp://cygwin.com/pub/cygwin/release/mpfr/libmpfr-devel/libmpfr-devel-%{mpfr_version}.tar.bz2 |
---|
| 50 | |
---|
| 51 | Provides: i686-pc-cygwin-mpfr-devel = %{version}-%{release} |
---|
| 52 | |
---|
| 53 | %description |
---|
| 54 | Cygwin mpfr libraries. |
---|
| 55 | |
---|
| 56 | %prep |
---|
| 57 | %setup -c -q |
---|
| 58 | |
---|
| 59 | %build |
---|
| 60 | rm -rf i686-pc-cygwin |
---|
| 61 | |
---|
| 62 | # Setup sys-root (Usable for gcc >= 3.4) |
---|
| 63 | mkdir -p i686-pc-cygwin/sys-root |
---|
| 64 | ( cd i686-pc-cygwin/sys-root; %{__tar} xvjf %{SOURCE0}) |
---|
| 65 | ( cd i686-pc-cygwin/sys-root; %{__tar} xvjf %{SOURCE1}) |
---|
| 66 | ( cd i686-pc-cygwin/sys-root; %{__tar} xvjf %{SOURCE2}) |
---|
| 67 | |
---|
| 68 | %install |
---|
| 69 | rm -rf $RPM_BUILD_ROOT |
---|
| 70 | mkdir -p $RPM_BUILD_ROOT%{_prefix} |
---|
| 71 | cp -a i686-pc-cygwin $RPM_BUILD_ROOT%{_prefix} |
---|
| 72 | |
---|
| 73 | |
---|
| 74 | # Extract %%__os_install_post into os_install_post~ |
---|
| 75 | cat << \EOF > os_install_post~ |
---|
| 76 | %__os_install_post |
---|
| 77 | EOF |
---|
| 78 | |
---|
| 79 | # Generate customized brp-*scripts |
---|
| 80 | cat os_install_post~ | while read a x y; do |
---|
| 81 | case $a in |
---|
| 82 | # Prevent brp-strip* from trying to handle foreign binaries |
---|
| 83 | */brp-strip*) |
---|
| 84 | b=$(basename $a) |
---|
| 85 | sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b |
---|
| 86 | chmod a+x $b |
---|
| 87 | ;; |
---|
| 88 | esac |
---|
| 89 | done |
---|
| 90 | |
---|
| 91 | sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ |
---|
| 92 | < os_install_post~ > os_install_post |
---|
| 93 | %define __os_install_post . ./os_install_post |
---|
| 94 | |
---|
| 95 | |
---|
| 96 | cat << EOF > %{_builddir}/%{name}-%{mpfr_rpmvers}/find-provides |
---|
| 97 | #!/bin/sh |
---|
| 98 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-cygwin/(lib|include|sys-root)' \ |
---|
[4668c7fe] | 99 | %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i686-pc-cygwin/'} | %__find_provides |
---|
[facca98] | 100 | EOF |
---|
| 101 | chmod +x %{_builddir}/%{name}-%{mpfr_rpmvers}/find-provides |
---|
| 102 | %define __find_provides %{_builddir}/%{name}-%{mpfr_rpmvers}/find-provides |
---|
| 103 | |
---|
| 104 | cat << EOF > %{_builddir}/%{name}-%{mpfr_rpmvers}/find-requires |
---|
| 105 | #!/bin/sh |
---|
| 106 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-cygwin/(lib|include|sys-root)' \ |
---|
[4668c7fe] | 107 | %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i686-pc-cygwin/'} | %__find_requires |
---|
[facca98] | 108 | EOF |
---|
| 109 | chmod +x %{_builddir}/%{name}-%{mpfr_rpmvers}/find-requires |
---|
| 110 | %define __find_requires %{_builddir}/%{name}-%{mpfr_rpmvers}/find-requires |
---|
| 111 | |
---|
| 112 | %ifnarch noarch |
---|
| 113 | # Extract %%__debug_install_post into debug_install_post~ |
---|
| 114 | cat << \EOF > debug_install_post~ |
---|
| 115 | %__debug_install_post |
---|
| 116 | EOF |
---|
| 117 | |
---|
| 118 | # Generate customized debug_install_post script |
---|
| 119 | cat debug_install_post~ | while read a x y; do |
---|
| 120 | case $a in |
---|
| 121 | # Prevent find-debuginfo.sh* from trying to handle foreign binaries |
---|
| 122 | */find-debuginfo.sh) |
---|
| 123 | b=$(basename $a) |
---|
| 124 | sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b |
---|
| 125 | chmod a+x $b |
---|
| 126 | ;; |
---|
| 127 | esac |
---|
| 128 | done |
---|
| 129 | |
---|
| 130 | sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \ |
---|
| 131 | < debug_install_post~ > debug_install_post |
---|
| 132 | %define __debug_install_post . ./debug_install_post |
---|
| 133 | |
---|
| 134 | %endif |
---|
| 135 | |
---|
| 136 | %clean |
---|
| 137 | rm -rf $RPM_BUILD_ROOT |
---|
| 138 | |
---|
| 139 | %files |
---|
| 140 | %defattr(-,root,root,-) |
---|
| 141 | %dir %{_prefix}/i686-pc-cygwin |
---|
| 142 | %{_prefix}/i686-pc-cygwin/sys-root |
---|
| 143 | |
---|
| 144 | |
---|