source: rtems/contrib/crossrpms/cygwin/i686/i686-pc-cygwin-gmp.spec @ facca98

4.104.11
Last change on this file since facca98 was facca98, checked in by Ralf Corsepius <ralf.corsepius@…>, on May 7, 2009 at 2:40:22 PM

New.

  • Property mode set to 100644
File size: 3.8 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 gmp_version 4.2.1-1
34%define gmp_rpmvers %{expand:%(echo 4.2.1-1 | tr - _)}
35
36Name:         i686-pc-cygwin-gmp
37Release:      0.20090506.1%{?dist}
38License:      GPL
39Group:        Development/Tools
40
41BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
42BuildArch:      noarch
43
44Version:        %gmp_rpmvers
45Summary:        Cygwin gmp Libraries
46
47Source0:        ftp://cygwin.com/pub/cygwin/release/gmp/gmp-%{gmp_version}.tar.bz2
48Source1:        ftp://cygwin.com/pub/cygwin/release/gmp/libgmp3/libgmp3-%{gmp_version}.tar.bz2
49Source2:        ftp://cygwin.com/pub/cygwin/release/gmp/libgmp-devel/libgmp-devel-%{gmp_version}.tar.bz2
50
51Provides:       i686-pc-cygwin-gmp-devel = %{version}-%{release}
52
53%description
54Cygwin gmp 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~
75cat << \EOF > os_install_post~
76%__os_install_post
77EOF
78
79# Generate customized brp-*scripts
80cat os_install_post~ | while read a x y; do
81case $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  ;;
88esac
89done
90
91sed -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
96cat << EOF > %{_builddir}/%{name}-%{gmp_rpmvers}/find-provides
97#!/bin/sh
98grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-cygwin/(lib|include|sys-root)' \
99  | grep -v '^${RPM_BUILD_ROOT}%{gcclib}/i686-pc-cygwin/' | %__find_provides
100EOF
101chmod +x %{_builddir}/%{name}-%{gmp_rpmvers}/find-provides
102%define __find_provides %{_builddir}/%{name}-%{gmp_rpmvers}/find-provides
103
104cat << EOF > %{_builddir}/%{name}-%{gmp_rpmvers}/find-requires
105#!/bin/sh
106grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-cygwin/(lib|include|sys-root)' \
107  | grep -v '^${RPM_BUILD_ROOT}%{gcclib}/i686-pc-cygwin/' | %__find_requires
108EOF
109chmod +x %{_builddir}/%{name}-%{gmp_rpmvers}/find-requires
110%define __find_requires %{_builddir}/%{name}-%{gmp_rpmvers}/find-requires
111
112%ifnarch noarch
113# Extract %%__debug_install_post into debug_install_post~
114cat << \EOF > debug_install_post~
115%__debug_install_post
116EOF
117
118# Generate customized debug_install_post script
119cat debug_install_post~ | while read a x y; do
120case $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  ;;
127esac
128done
129
130sed -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
Note: See TracBrowser for help on using the repository browser.